- Joined
- Aug 6, 2009
- Messages
- 2,133
- Reaction score
- 433
I have been asked few times about how my script works with paypal ipn. So here it is. Short explanation and example.
[Behind Scenes]
Ok so here is approximetly what happens:
Here is a script itself.
Click here (pastebin)
Also here is a full list of paypal post variables.
Click here (paypal)
P.S. You have to make a button yourself
P.P.S. You have to activate IPN and set IPN link yourself as well
P.P.P.S. You and only you are responsible for the use of the script provided in this topic.
[Behind Scenes]
Ok so here is approximetly what happens:
- Customer/Player visits your web-site and clicks donate button. Now you can add custom field to button code with name "custom" and then in that hidden input variable you can put user id, or his character id, or whatever you want. Example below...
PHP:
<input type="hidden" name="custom" value="XXX"> - Once donation/payment is complete on paypal web-site, paypal will send IPN message to specified script.
- From then on your script receives information from paypal, resembles it a bit and sends back to paypal for verification.
- If everything is ok, paypal will return VERIFIED string.
- From here we check if it was verified.
- Then if payment status was completed or canceled/reversed
- If completed do one thing, if reversed then do another.
Here is a script itself.
Click here (pastebin)
Also here is a full list of paypal post variables.
Click here (paypal)
P.S. You have to make a button yourself
P.P.S. You have to activate IPN and set IPN link yourself as well
P.P.P.S. You and only you are responsible for the use of the script provided in this topic.

