Tech Arise

PayKun Payment Gateway Integration using PHP

 
PayKun is the best payment gateway for Indian businesses. It is a safe, secure and easy way to collect payments from the customers. It is gaining popularity because of its trending payment gateway technology and infrastructure, up to the mark services and cost-effectiveness. It is suitable for any kind of venture, may it be blogging, YouTuber, offline shop, online eCommerce store, a tech business, a small startup, large enterprise, etc.
It provides online payment options, webhooks, payment links, master links, etc making it an easy tool to get the payments. This article provides an easy stepwise process on how to integrate the PayKun Payment Gateway with PHP platform.
In this tutorial, you will learn you how to implement PayKun Payment Gateway Integration using PHP. This is a very simple example, you can just copy paste and change according to your requirement.
PayKun Payment Gateway features
Before started to implement the REST API with PHP and MySQL, look files structure:
Step 1: PayKun Account Sign Up
Access Test/Sandbox Mode
Generate API Encryption Key
Note: (Note: If you have generated API Key before then you will see the date of the API Key generated, since you will not be able to retrieve the old API Key (For security reasons) they have provided the re-generate option, so you can re-generate API Key in case you have lost the old one.)
Installation Step
If your project uses composer, run the below command
Direct Download Zip file
Download the PayKun-PHP zip file. Download the Source code.zip file and include Payment.php in your application.
Step 2: Create configuration file named config.php
Step 3: Create a files named index.php and request.php
index.php
request.php
Note: Set true for production environment and false for sandbox or testing mode
For sandbox integration use: $obj = new Payment(PAYKUM_MERCHANT_ID, PAYKUM_ACCESS_TOKEN, PAYKUM_ENCRYPTION_KEY, false, true);
For live integration use: $obj = new Payment(PAYKUM_MERCHANT_ID, PAYKUM_ACCESS_TOKEN, PAYKUM_ENCRYPTION_KEY, true, true);
Step 4: Create a file named response.php
if Payment process done success/failure.
Create files named (header.php and footer.php)
This file contains the header and footer section of the webpage. The Bootstrap library is used to provide a better UI, so, include it in the header and footer section.
header.php
footer.php
Exit mobile version