RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0] Fully Automated Donation Store System

ntony

Sorceror
[RunUO 2.0] Fully Automated Donation Store System

Fully Automated Donation Store System

This system is distributed under the terms of the GNU General Public License.

Features:

  • Provides Gump for player
    to get their donation gift after they have made their donation to the shard.
  • Provides webapp back-office for administrator
  • to add/remove gift type
  • generate HTML code for donation gift button to make their web store
  • monitoring PayPal payment transactions.
  • administrator can add gift to specific account using the back-office panel
It automatically handles the donation process. Players can get their donation items without administrator involved.

Instructions:
Please read my very nice one page readme in the package.

Download:
I will not update to attachment on this thread anymore! Please download the script from Google Code.
You may checkout runuodonationstoresystem - /trunk on SVN.
or
download the attachment in this thread.

Googe Code project page: http://code.google.com/p/runuodonationstoresystem/

Thanks RunUO team on making such a great project, and thanks to everyone who have contributed to RunUO!

You want your work and your shard to be appreciated and to be donated, you donate to appreciate other people's work/contribution. Please consider to donate to RunUO project. Please also consider making donation to this script if this script works and helps your shard.


The back-office web panel is still a bit simple, but fully functional. You may make it fancy by simply editing the HTML inside the PHP scripts.



Change logs:
18-3-2010: support parameters for class
1-12-2009: fix some typo and the log files showing problem
24-11-2009: fix for compatibility for apache_request_headers() function
22-11-2009: new feature "manually add gift"


Update:
The class name support parameters now, you can use "BankCheck 1000000" to make stacked items for your gifts. Thanks for the test by Giraffe!
 

Attachments

  • donation_store.zip
    32.4 KB · Views: 674

Vorspire

Knight
Good work :D

Glad to see this type of system eventually become a public possiblity for all shards to impliment :)
 

Kamon

Wanderer
I guess I'll have to figure out how to grant access from "outside" my hosting to the database, or maybe set the web server in the machine that runs the shard, but that would not be a good idea (secutiry risks and stuff). Anyway, as soon as I get it done, I'll give you some feedback.
 

ntony

Sorceror
Kamon;819141 said:
I guess I'll have to figure out how to grant access from "outside" my hosting to the database, or maybe set the web server in the machine that runs the shard, but that would not be a good idea (secutiry risks and stuff). Anyway, as soon as I get it done, I'll give you some feedback.

Thanks, Kamon!
Do you have phpMyAdmin access to your MySQL database?
 

Underdog

Wanderer
Well the only problem after I got it all set up, is that paypal says "The link you have used to enter the PayPal system contains an incorrectly formatted item amount."

What does this mean?
 

Vorspire

Knight
Underdog;819193 said:
Well the only problem after I got it all set up, is that paypal says "The link you have used to enter the PayPal system contains an incorrectly formatted item amount."

What does this mean?

I would guess that the quantity of the item is not formatted as an Int32.
 

Underdog

Wanderer
Well, how can I fix it so that it works for my site?
All my database stuff is working correctly and everything. There's not a field for item amount on the admin page of this system.


Also, two more questions about this system....
After you type in the name of the item, can you put like.....
bankcheck 1000000 ?

would it in fact add the value of the bank check just like the command would?

and, is it really instant, or does the stone have a timer in which it checks the db again?
I've done a dollar transaction, but its still not even showing in the backoffice app.

Thanks!

Any help would be greatly appreciated!
 

ntony

Sorceror
Underdog;819193 said:
Well the only problem after I got it all set up, is that paypal says "The link you have used to enter the PayPal system contains an incorrectly formatted item amount."

What does this mean?


Sorry, it was my typo on the "get_button_code.php" PHP script. I have fixed it and uploaded the new package. Please download the scripts again and replace the "get_button_code.php" on your server. Thanks for the test!
 

ntony

Sorceror
All my database stuff is working correctly and everything. There's not a field for item amount on the admin page of this system.


That was my typo on the amount in PHP script. I have got it fixed. Please download the script again and replace "get_button_code.php" in your web server. Sorry about my mistake!


Also, two more questions about this system....
After you type in the name of the item, can you put like.....
bankcheck 1000000 ?


would it in fact add the value of the bank check just like the command would?

No, this is not supported yet. Maybe I can enhance it as the feature in next version. Or you may make a class "DonationCheck" with 1000000 amount yourself.

and, is it really instant, or does the stone have a timer in which it checks the db again?
I've done a dollar transaction, but its still not even showing in the backoffice app.

It is "instant" as soon as you finish the donation and transaction completed by PayPal. In my experience, PayPal should send back an IPN in a very short time right after your payment has been made. Take a look on the logs. Is there any log? Are you using your own shopping cart/donation button?


If you are using your own shopping cart or donation button, let me know. You need some configuration or modification to make it work with PayPal IPN
 

Underdog

Wanderer
Take a look on the logs. Is there any log? Are you using your own shopping cart/donation button?

I modified it before you sent me the fix, but no, no log was showing....prolly why.

I will use the new file you emailed me and try that out. Thanks for the response!
 

Underdog

Wanderer
I am getting this when I try to look at the logs

Warning: file_get_contents(/home/untolduo/public_html/logs/donation_paypal.log) [function.file-get-contents]: failed to open stream: No such file or directory in /home/untolduo/public_html/donationshop/admin_ops.php on line 46

Warning: file_get_contents(/home/untolduo/public_html/logs/donation_paypal_error.log) [function.file-get-contents]: failed to open stream: No such file or directory in /home/untolduo/public_html/donationshop/admin_ops.php on line 51

Warning: file_get_contents(/home/untolduo/public_html/logs/donation_paypal_invalid_txn.log) [function.file-get-contents]: failed to open stream: No such file or directory in /home/untolduo/public_html/donationshop/admin_ops.php on line 56

Warning: file_get_contents(/home/untolduo/public_html/logs/paypal_request.log) [function.file-get-contents]: failed to open stream: No such file or directory in /home/untolduo/public_html/donationshop/admin_ops.php on line 61

Is this because no transactions have been made yet, or because something is wrong?
 

Vorspire

Knight
The file donation_paypal.log does not exist and PHP thus fails to open it, creating these errors.

I have a question for the Author :p

In the event of a malicious post to your IPN, are there security checks in place to stop the fraud?
How does this system handle e-checks and how does RunUO know exactly when soemone has donated? -Paypal does not always send a notification and if it fails to get a response it will keep trying for at least another 24 hours.
 

ntony

Sorceror
Underdog;819385 said:
I am getting this when I try to look at the logs



Is this because no transactions have been made yet, or because something is wrong?

Check whether there are log files in this directory: /home/untolduo/public_html/logs/
If it is empty, you have no log to open.
If you are sure you have done something before so that you should have logs to read. Check the permission of this directory.

If you have done the donation but not getting the response from PayPal. Please check the $ipn_handler_url in config.php. Is that your correctl URL for donation_paypal_ipn_handler.php script?

Vorspire;819412 said:
The file donation_paypal.log does not exist and PHP thus fails to open it, creating these errors.

I have a question for the Author :p

In the event of a malicious post to your IPN, are there security checks in place to stop the fraud?
How does this system handle e-checks and how does RunUO know exactly when soemone has donated? -Paypal does not always send a notification and if it fails to get a response it will keep trying for at least another 24 hours.

Thanks for help answering!
There is a mechanism for merchant to check the IPN with PayPal. Read this: https://cms.paypal.com/cgi-bin/mark...t&content_ID=developer/e_howto_admin_IPNIntro
I thought you must have read this before. My script just checks the response from IPN whether the transaction is "VERIFIED" or "INVALID" as PayPal advised. Not secure enough? I think it is not easy for dummy to make a security fraud to trick this. Yeah, people can make Man-in-the-middle Fake DNS attack. But it is not easy for a novice. If he/she can fake as PayPal and certificate authority, why doesn't he/she treat some larger sites to have real money but a private UO shard donation item?

I didn't test my system with eCheck, but it SHOULD be able to handle eCheck. It only put items to "Completed" transactions from PayPal IPN. RunUO doesn't know whether there is donation. It just check the database record. The PHP IPN handler inserts donation items to database table when there is completed valid PayPal transaction.
 

ntony

Sorceror
Please download and use the latest PHP scripts. (don't overwrite your config.php)
I have fixed several bugs. Thanks all for trying this system!
 

Underdog

Wanderer
Okay, I found my main problem.....my IPN was disabled in paypal itself.

So I fixed that, turned it on using the correct directory to the ipn handler.

It gave me this in my IPN history after transaction completed.

Notification URLhttp://www.ultimauntold.com/donationshop/donation_paypal_ipn_handler.php

HTTP response code 200

I researched the 200 code, and it says that means it was completed and correct.

Still no database entries, nor a gift for the player.

I have used your updates up until now, I receive the money, I can pull up logs without errors (there are none though), but they dont' get the gift, and it's not placed in the transaction history at all......I'm at a standstill.

Any more suggestions?

Thanks again, I'm really looking forward to using your system!
 

Feid

Sorceror
Great System

Just wanted to thank you for writing this system, it really seems to be working well. You are also fast to respond to e-mail and make the small additions I requested. Haven't tested a full paypal transaction yet, but hope to soon.
 

ntony

Sorceror
Feid;819572 said:
Just wanted to thank you for writing this system, it really seems to be working well. You are also fast to respond to e-mail and make the small additions I requested. Haven't tested a full paypal transaction yet, but hope to soon.

That's good. You can use PayPal sandbox to test your system before applying it to your running shard.
Register an PayPal sandbox testing account here:
http://developer.paypal.com/

Remember to change the PHP configuration and the generated HTML buttons again if you toggle between sandbox testing mode or production mode. ;)
You can see that the <form> action value are different.

production mode: http://www.paypal.com/cgi-bin/webscr
sandbox testing mode: http://www.sandbox.paypal.com/cgi-bin/webscr


Thanks for your generous donation!
 
Top