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
tommenquar;832875 said:
I have already found the Merchant id. all i need now is how to locate the url for the IPN and then putting everything together.

i have even downloaded the obdc driver and changed the code to 5.1 and am still unsure if everything is linked together as they should be.

Also i would like to apologize for my previous post. working on getting this to work for 2 days strait pout me behind and it is kind of annoying. thanks for the patience.

Oh and i will be more than happy to write a setup for noobs for ya. i just wanna make sure i know everything first ^^

The ODBC is for RunUO C#.NET but not for PHP.
Okay, the URL for IPN. You have the PHP file donation_paypal_ipn_handler.php in the web folder, right? The URL for IPN is where you can the donation_paypal_ipn_handler.php using for web browser. I have already put an example in the config.php. I think it is quite straight away to setup the config.php file. I put comment description onto it. After you have configured the config.php. The web part is done. You can use the admin page to generate code for PayPal "Buy" button. Actually you don't need to modify the HTML code. It should work out of the box.

Another part is the RunUO and C# part. You need the MySQL ODBC driver in order for your .NET framework to be able to access the MySQL database. Install the ODBC driver. Configure the DonationStore.cs. Restart your RunUO server to reload the new scripts. Add a donation store stone using the [add command.

The system is deployed!
 

ntony

Sorceror
Tresdni;832878 said:
I used the one he posted.

Please paste the configuration of DatabaseDriver in your DonationStore.cs?

Your problem is either the ODBC driver not being installed properly or not using the right database driver in C#.
 

tommenquar

Sorceror
i am still utterly confused by this...is there anyone willing to help me set this up free of charge? i dont care what access i have to give id just like this to work ^^
 

Tresdni

Squire
I donated towards this script, I appreciate the help you've given me! This system has opened up other possibilities as well, very neat to use.

Thanks again!
 

TUP_Charm

Wanderer
Could I suggest that the owner of the script modifys the script to not user PHP short tags. Some users may not have them enabled by default if they have just installed PHP on their servers.

For those only getting empty boxes on their page change these lines:
get_button_code.php line 53.
Code:
FROM: <?=$output ?>
TO: <?php echo $output ?>

adminpage.php line 116
Code:
FROM: <?=$output ?>
TO: <?php echo $output ?>


There is also a check for $local_currency in the ipn script, however this is not set anywhere, and is trying to trim itself (which is null), this checks against the paypal currency before allowing the payment to be accepted as Complete.
This is stopping perfectly valid transactions taking place; I have removed this from my script. I am pretty sure it is not required if anyone else is getting problems populating the other 2 tables.
 

ntony

Sorceror
TUP_Charm;840234 said:
Could I suggest that the owner of the script modifys the script to not user PHP short tags. Some users may not have them enabled by default if they have just installed PHP on their servers.

For those only getting empty boxes on their page change these lines:
get_button_code.php line 53.
Code:
FROM: <?=$output ?>
TO: <?php echo $output ?>

adminpage.php line 116
Code:
FROM: <?=$output ?>
TO: <?php echo $output ?>


There is also a check for $local_currency in the ipn script, however this is not set anywhere, and is trying to trim itself (which is null), this checks against the paypal currency before allowing the payment to be accepted as Complete.
This is stopping perfectly valid transactions taking place; I have removed this from my script. I am pretty sure it is not required if anyone else is getting problems populating the other 2 tables.

Thanks for the advice!
But is currency really redundant? I'm not sure. What if someone donates Thai baht or Zimbabwean dollar?
 

TUP_Charm

Wanderer
You can specify the currency in the hidden fields for the button. As far as I am aware this will be the currency paid in regardless of where your location is.

As it stands in your script, you are not even requesting $local_currency from the paypal message, nor does it even send it. So it is as good as useless in your script, even if I am wrong about payment currency. Have a look for the place you are setting $local_currency and you will see that it is never actually set to = something.
 

ntony

Sorceror
TUP_Charm;840316 said:
You can specify the currency in the hidden fields for the button. As far as I am aware this will be the currency paid in regardless of where your location is.

As it stands in your script, you are not even requesting $local_currency from the paypal message, nor does it even send it. So it is as good as useless in your script, even if I am wrong about payment currency. Have a look for the place you are setting $local_currency and you will see that it is never actually set to = something.

I'm sorry. I can't really understand your point. I'm not that familiar with PayPay IPN. I just spent a couple of days to read their messy doucments.

$local_currency is a variable which I declared in config.php. And people who use this script should define it by configuring the config.php.

config.php:
Code:
//The currency of donation
$local_currency = "HKD";


It is being used in [Buy] buttons, if you do use my script to generate buttons.

get_button_code.php:
Code:
<input type='hidden' name='currency_code' value='$local_currency'>


The currency, which the donor used, and your local currency are being compared in the PayPal IPN handler.
donation_paypal_ipn_handler.php:

Code:
$payment_currency = trim($post_data['mc_currency']);

if ((strcmp(strtoupper($payment_currency), strtoupper($accepted_currency)) != 0 ) || $payment_amount != ($item_quantity*$item_price))


I didn't put the line numbers. You may have to search them yourself.
 

TUP_Charm

Wanderer
I apologise, you are right there. But if it is set in the config, then it will always be paid in the currency the server owner has decided upon, so the check is not really required, but I guess it can do no harm, but it was that check which failed my script from passing that point, may just be an isolated case for it though.
 

ntony

Sorceror
TUP_Charm;840415 said:
I apologise, you are right there. But if it is set in the config, then it will always be paid in the currency the server owner has decided upon, so the check is not really required, but I guess it can do no harm, but it was that check which failed my script from passing that point, may just be an isolated case for it though.

need not apologize for that. your suggestion is good.
it's really cool that you can get your store running. keep it up!
 

Grom09

Sorceror
hi. i was wondering if someone can help me fix this. :confused:

I get this on double click on reward stone.

[Retrieve Donation Gift List] Error...
System.Data.Odbc.OdbcException: ERROR [IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified

Code:
DatabaseDriver = "{MySQL ODBC 5.0.88 Driver}",
thankss
 

TUP_Charm

Wanderer
I had an issue when I installed it, that it was installed, but was not being utilized by the system.

I use a Windows server, you may be using a local pc or unix based server, but I had to set up the ODBC driver in 'Data Sources' on my server before it would acknowledge it, although this was a few years ago now, so I am afraid I cant be of much use if that is the case.

See if it shows up in your list of ODBC drivers wherver it may say it on your system.
 

Foster

Account Terminated
what a great idea ive got this dl for a later use in my shard but i think asking for a 10 dollar donation is silly and extremely rude there are bigger systems out there that would have taken the same if not longer to code and to ask of a donation for your script i think it is unexeptable because were all here tryin to learn the same thing and to help each other learn not to ask of money from peoples if any one needs to be donated to it is deffinetley not chaos shard it is RUNUO the people who made your shard possible to even begin with sir we are all but bug testers you see for every bodys scripts and im sure people to come will Find Bugs/ and Update this with your permission and all the rest.(ofcourse) so therefor you would be taking money from their work/Contributions too and im sure you wouldnt be giving them there share for there contribution because it was yours to begin with.huh? thus making it rude to ask for money to donate for a script. " a script" maybe you should be asking your players to donate for your boy wonders work because they arent in here from dusk till dawn researching and replying as well as running a shard and handling requests/help matters/edits etc. to help everyone get going smooth on there work. so i hope you understand this is not a throw off at all personnaly against you but it jus the money thing man come on.(thats something (Orbs) would do!
 

Vorspire

Knight
Asking for donations for scripts imho is fine because you're asking to be compensated for the TIME you spent producing the system, not the system itself, and a system like this is by no means an easy thing to accomplish for most people.
This is what the author implied by saying "...if this script was helpful, please donate..."

What I find rude is when people write a wall of text with no grammar or correct spelling without first thinking of the poor readers who have to do the extra work just to read the post.
 
what a great idea ive got this dl for a later use in my shard but i think asking for a 10 dollar donation is silly and extremely rude there are bigger systems out there that would have taken the same if not longer to code and to ask of a donation for your script i think it is unexeptable because were all here tryin to learn the same thing and to help each other learn not to ask of money from peoples if any one needs to be donated to it is deffinetley not chaos shard it is RUNUO the people who made your shard possible to even begin with sir we are all but bug testers you see for every bodys scripts and im sure people to come will Find Bugs/ and Update this with your permission and all the rest.(ofcourse) so therefor you would be taking money from their work/Contributions too and im sure you wouldnt be giving them there share for there contribution because it was yours to begin with.huh? thus making it rude to ask for money to donate for a script. " a script" maybe you should be asking your players to donate for your boy wonders work because they arent in here from dusk till dawn researching and replying as well as running a shard and handling requests/help matters/edits etc. to help everyone get going smooth on there work. so i hope you understand this is not a throw off at all personnaly against you but it jus the money thing man come on.(thats something (Orbs) would do!

I find this reply extremely rude and unacceptable. For one, this script helps your shard get donations. For two, this isnt just a simple runuo system script. Its using two different systems and making them communicate for automation.

I think you are extremely out of line with that post, and can only hope that you either A) had a bad day, or B) are fishing/trolling.
 
Top