PayKun Payment Gateway Integration in PHP

In this tutorial, We have share how to implement PayKun Payment Gateway Integration in PHP. PayKun payment gateway is a merchant service that authorizes credit/debit card or direct payments for e-businesses, online retailers and offline businesses. In brief Payment gateway fulfills the essential needs in the e-commerce transaction process & authorizing the payment between merchant and customer. We will also allow to download source code of live demo.
PayKun payment gateway features
  • To Learn more #about the service of paykun
  • Zero setup fee
  • No Annual Maintenance charge
  • Free Integration/Technical support (support major available integration)
  • Flat 2% for all transaction made
  • All day merchant support (On-All channel)
  • 120+ payment option
  • Payment link (accept payment over email/WhatsApp/SMS by sharing pay link)
  • Provide Team Management Control over your staff(accessibility control of your employee/sale/support member)
  • PCI compliance level 1 (highest validation/class-level security)
  • Buyer/seller protection over vary metric
Before started to implement the PayKun Payment Gateway Integration in PHP look files structure:
  • paykun-payment-gateway-integration-in-php
    • css
      • style.css
    • images
    • templates
      • header.php
      • footer.php
    • config.php
    • index.php
    • request.php
    • response.php
Step 1: Create a Account and configuration file
PayKun Credentials : MERCHANT ID, ACCESS TOKEN and ENCRYPTION KEY (Copy paste these credentials config.php)
Step 2: 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 3: Create a file named response.php
if Payment process done success/failure.
Step 4: Create header (header.php)
This view contains the header section of the webpage. The Bootstrap library is used to provide a better UI, so, include it in the header section.
Located at the top of a website, the header typically contains elements that include a company’s logo, website navigation, and contact information.
Step 5: Create a view file named footer.php
This view contains the footer section of the webpage.
  • jQuery – needed by Bootstrap JavaScript.
  • Bootstrap JavaScript – to make cool UI