PayPal Express Checkout Payment Gateway Integration with Codeigniter

In this tutorial, We have share how to integrate PayPal Express Checkout payment gateway in Codeigniter. The tutorial covered in easy steps with a live example.PayPal is a widely used payment gateway that allows you to accept payment online in the web application. Express Checkout is a fast and very easy way for buyers to pay for the product they are buying.PayPal Express Checkout payment gateway is very useful when you want to provide a user-friendly user interface to the user for the online payment.
Step 1: Create PayPal Account
First we need to create sandbox account on Sandbox account to run this demo example.
Step 2: Update PayPal Config Details
Here in this example, we will use Test App to integrate PayPal Express gateway. So we will update constants.php with KeyID and Secret Key from PayPal.
Step 3: Open file constants
Open “application/config/constants.php” file and add code like as bellow:
Step 4: Create a Controller file PayPal Express
Create a controller file named “Paypal.php” inside “application/controllers” folder.
Step 5: Create a view file index
Create a view file named “index.php” inside “application/views/paypal” folder
Step 6: Create a view file checkout
Create a view file named “checkout.php” inside “application/views/paypal” folder
Step 7: Open file constants
Open “application/config/routes.php” file and add code like as bellow: