Paypal IPN Shopping Page Demo using PHP

Project Overview: This is a sample shopping page featuring the use of PHP in Paypal IPN transactions for selling digital products such as ebooks, mp3, etc. Since this is a demo page, you can try purchasing the test products below using your own Paypal Sandbox buyer account. Once you are convinced how this system works, you can as well read more documentation for details (links provided below).See the procedure below for details.

Finally you can download the project files (PHP script and the sample database) with the provided link above and then integrate Paypal into your own website using the procedure stated in Part 6 of the documentation (see link below).

A newly released ebook that I wrote, Codex ebook for $30:

Or my previous book entitled "How to behave like a child" for $15.

You can pay safely with Paypal. Thank you for your interest in my books.


Refer to the following tutorials for detailed documentation:

Part 1- Introduction to PayPal Instant Payment Notification and Paypal Sandbox.
Part 2- Creation of Shopping page in Paypal IPN System using Buy Now Buttons
Part 3- Creation of Required MySQL database tables for Paypal IPN System.
Part 4- The discussion of Paypal IPN Handler Script.
Part 5- Developing a Paypal Customer Download Script.
Part 6- Deploying and Implementing PayPal IPN in PHP.

How to Test Purchase this sample shopping page using my own Paypal Sandbox Buyer Account?

Step1. Login to your own Paypal Sandbox account here: If you do not have a sandbox account. Read the first part of the tutorial so that you can test purchase. Once successfully logged-in; you should never logout during the entire test purchasing process.

Step2. Click any of the test Paypal Buy Now buttons in the shopping page example above.

Step3. You will then be diverted to the Paypal sandbox for payment. Since you are in the sandbox mode, there is no real money involved in this transaction. You need to login using your own test buyer account. You can create a test buyer account by following the procedures in the Part 1 of the Paypal IPN tutorial in (see documentation above).

Step4. Complete the check out by confirming the purchase and clicking the pay now button at Paypal.

Step5. You will then diverted to the Paypal success payment verification page where you should see the CLICK HERE TO DOWNLOAD YOUR EBOOK. Click that button.

Note: Since this is just a test purchase and does not use any SSL, just ignore the errors and proceed to the download page.

Step6. You should then be diverted to the customer download page where you will need to enter your invoice number to proceed with the downloading. You should then go to your Paypal sandbox account to check for the test email sent by Paypal Sandbox that contains the invoice number sent during this test purchase.

This is how the test email should look like.Read any emails you have just received during this test purchase, it should contain the invoice number of the transaction which you can use to download the ebook.

Paypal Sandbox test email

And this is how the invoice number should look like which is found inside the test emails from Paypal inside your account:

Paypal Sandbox test email

After clicking the "Download my ebook" button, the ebook will then streamed to you which you can then save to your computer. If you need help regarding setting up your own shopping page using Paypal IPN, you can hire me to do that. Thanks.

Download PHP project files here

Download MySQL IPN database tables here

Source code last updated: August 2012

Link To This Tool
1. Click inside the codebox
2. Right-Click then Copy
3. Paste the HTML code into your webpage