CLIENT-SIDE DEMO (NO SERVER-SIDE IMPLEMENTATION): https://shadowsych.github.io/synced-billing/billing.html
This is the billing system programmed by Pravat Bhusal (www.github.com/Shadowsych) for Richard Fraser. This code may be given to anyone to study and use as his or her billing service for their Whirled server. However, proper set-up must be completed for the billing files. For this reason, I have provided step-by-step documentation below to properly set-up the billing system.
- Copy and paste the "billing.html" file into your Whirled's or Synced's servers "pages" folder.
- Copy and paste the "BillingSuccess.php" file into the "htdocs" folder of an Apache web-server.
- Copy and paste the "UpdateSubscribers.php" file into the "htdocs" folder of an Apache web-server.
- Open the "BillingIPN.php" file and on line 57 replace the "http://www.syncedonline.com:8080/BillingSuccess.php"
with the URL for your "BillingSuccess.php" file from step 2. - Now copy and paste the "BillingIPN.php" in a new Apache web-server that runs on port 80.
- Now we're going to set-up the PayPal IPN, so go to this link and click the "Update" button on the "Instant payment notifications" row:
"https://www.paypal.com/uk/cgi-bin/webscr?cmd=_profile-display-handler&tab_id=SELLER_PREFERENCES" - Set the "Notification URL" to the URL of your "BillingIPN.php" file.
- Tick the "receive IPN messages (Enabled)" checkbox and press the "Save" button.
- Now we're going to set-up a cron job to update the subscribers' subscription status. This cron job will execute every hour. So open a new Linux Terminal and type "crontab -e" and in the bottom of the file type this cron job:
0 * * * * /usr/bin/php [PATH_TO_YOUR_UPDATESUBSCRIBERS.PHP_FILE]
and replace the [PATH_TO_YOUR_UPDATESUBSCRIBERS.PHP_FILE] to your UpdateSubscribers.php file's path - Press Ctrl + X and save the cron job file
- You are finished setting-up the PayPal IPN!
- Windows Apache Server: XAMPP
- Mac Apache Server: MAMP
- Linux Apache Server: LAMP
NOTE: If you're using a Linux server and PostgreSQL, make sure to install the PHP and PostgreSQL driver: sudo apt-get install php5-pgsql
"https://developer.paypal.com/docs/classic/products/instant-payment-notification/"