How to Integrate Paypal Payment System with Paypal API in PHP and MySql


In this article, you will learn about How to Integrate PayPal Payment System with PayPal API in PHP and MySQL. Here i will show you how to use PayPal Sandbox test account for payment system development and passing arguments while click on buy now button. It’s a simple and easy way to integrate in your own web projects to process payment with PayPal gateway.

You need to follow our step by step process:

Step-1: Create a Sandbox account at

Step-2: Now signup a test account for payment system. Take a look at top menu right-side button. you need to create personal and business account both for testing purpose.

You can skip next 2 step like  details with credit card details.


After account  creation you need to create sandbox credential, in the below image  you will get sandbox menu in left-side menu bar.

Step-3: Create an index.php page to store php code displaying products, product images, Product Name and product price.


In the following code you need to put your business $paypal_id and change the url of return and cancel_return button.

Step-4: create a success.php file for gateway response.


After successful payment, Paypal return file or response with some argument like item_number, amount, currency.
Paypal data success.php?tx=xxxxxxxx&st=Completed&amt=100&cc=USD&cm=&item_number=1

Step-5: create a cancle.php page , Paypal API return you to this page when payment get error or cancel status.

Step-6: When you have done with test payment system workflow. you need to change the form action development API URLs to Live API URLs and change live valid $paypal_id seller email id.

Are you want to get implementation help, or modify or extend the functionality of this script? Submit paid service request


Related posts