how to integration paypal payment gateway in codeigniter

how to integration paypal payment gateway in codeigniter

In this tutorial, we will tell you how to use the Paypal payment gateway in Codeigniter Framework.

The Paypal payment gateway is a popular payment gateway method and it is easily used for the project. so many developers prefer that payment gateway method.

PayPal is a secure payment method and it’s work-based using API. it provides two environments for the user like a sandbox and live.

Overview

Step 1: Download Paypal Payment Gateway Library
Step 2: Create Database Tables
Step 3: Create Controller
Step 4: Create a Model
Step 5: Create View File

Step 1: Download Paypal Payment Gateway Library

If you want to download the PayPal payment Gateway library then you can download it on https://github.com/xpertphp/paypal-payment-gateway-library-for-codeigniter git repository.
Step 2: Create Database Tables
In this step, we have to create two tables in the database, so we will create a database using the below code.

Step 3: Create Controller
In this step, we will create a Products.php file in the “application/controller” directory and paste the below code in this controller.
application/controller/Products.php

Step 4: Create a Model
In this step, we will create a Product.php file in the “application/models” directory and paste the below code in this model.
application/models/Product.php

Step 5: Create View File
So finally, we need to create two directories in the “application/views/” directory like product and PayPal. so we will create that directory and create files in that directory.
application/views/products/index.php

application/views/paypal/paymentSuccess.php

application/views/paypal/paymentFail.php

Note:- Paypal Payment Gateway Live

If you want to change the sandbox to live then you can follow the below details.
now we will open the “application/config/paypallib_config.php” file and change the sandbox, and business email, pin the config file. See the below changes in a config file.

Please follow and like us: