Since I've seen several posts related to PayPal IPN on RZ lately... Here is a script you can use as a reference to automatically send coins to your players based on payments made through PayPal.
Note: This is configured for working with Dekaron Private servers, but if you know a little PHP you should be able to configure it with ease for your own game use. This is a copy of a tutorial I posted on another site around 2 years ago, so it's using the older mysql / mssql PHP functions. I highly recommend using PDO, and that you use this code only as a reference for getting your PayPal IPN setup.
Important!
This script assumes that you sent the users account name through PayPal IPN's 'custom' field when they made the payment. You have to edit your PayPal provided button code to add an input field with the name custom and value account name. This can be hidden if you have the information already by having the user logged into your website, or you can have the user enter their account name by having the field not hidden.
for example:
Code:<input value='accountname' name='custom' type='hidden'>
Requirements
- PayPal account that can make payment buttons
- Web server with mssql and mysql php extensions enabled
- MySQL database or MSSQL database.
- Patience
Setup Setup on your sever side
- Open paypalipnconfig.php and fill out for your server information and what packages you will offer
- Open paypalDB.sql and copy it into your MySQL Database and run it, this creates a table called 'paypal_logs' which will store paypal payments and coins sent out.
- Done on your server's end...
PayPal Setup
- Create a button
- make sure to set a fixed donation amount
- click "Step 3: Customize advanced features
- click add advanced variables and add the following line to the text area with your path to the script
Code:notify_url="http://www.mydomain.com/folder/paypalipn.php"
Error Logging
If there is an error with a payment, either an invalid IPN, or email, or user name, anything... it will be output to a file _paypal_error_log.txt in the same directory that holds the script. All error messages are timestamped so you can review errors and see what's going on with them.
Make sure to test the system before making it live on your server!
Enjoy!
The Code
paypalipnconfig.php
Spoiler:
paypalipn.php
Spoiler:
mysql.class.php
Spoiler:
mssql.class.php
Spoiler:
logger.php
Spoiler:
IPN Script - MSSQL Only
paypalipn.php -> this one stores your paypal logs in mssql. Just make a table with the same layout as the mysql example above in your mssql "cash" db.
Spoiler:

