CCAvenue Payment Gateway Integration using PHP

CCavenue is most popular Payment gateway for online online e-commerce/shopping and e-transaction.It is designed to help merchants accept online payments through a spectrum of new-age payment options including major Credit Cards, Debit Cards (All MasterCard /Visa /Maestro /RuPay Cards), Amex EzeClick, Net Banking, Prepaid Instruments, UPI and Multi Bank EMI options.This is a very simple example, you can just copy paste and change according to your requirement.
Create Account and Integrate Payment Gateway
  • At first Create Merchant Account.
  • After successful registration CCavenue team will verify your provided phone no. and email Id.
  • Login to Merchant Dashboard
  • download CCAvenue payment integration kit
  • Go to dashboard and click on setting tab then select API KEYS
  • Configure CCAvenue security keys and (test/live) endpoint in your PHP application.
  • Create Payment form and deploy request / response handlers and with the guidance of the integration kit.
  • Create return pages for handling payment notification on success or cancel.
CCavenue Payment Gateway features:
  • All the major payment method like debit,credit card , netbanking
  • 7 major Credit Cards
  • 98+ Debit Cards (All MasterCard /Visa /Maestro /RuPay Cards), Amex EzeClick
  • Accept online payment from 53+ banks
  • CCavenue payment gateway is very safe and secure
  • Easy and hassle free integration
  • Payment gateway kit available on multiple programming language
  • 16 Prepaid Instruments
  • UPI and Up to 13 Multi Bank EMI options
Following screenshot shows the CCAvenue merchant Sign up form used to create a new account as the first step of CCavenue payment integration.
Before started to implement the CCAvenue Payment Gateway Integration using PHP, look files structure:
  • ccavenue-payment-gateway-integration-using-php
    • css
      • style.css
    • images
    • templates
      • header.php
      • footer.php
    • constants.php
    • index.php
    • ccAvenueRequestHandler.php
    • Crypto.php
    • ccAvenueResponseHandler.php
Step 1: Create a file named constants.php and define Merchant ID, Access Code and Working Key
Step 2: Create HTML form named index.php
Step 3: Create a file named Crypto.php
This file contains the functions to encrypt or decrypt the payment information posted via the HTML
Step 4 : Create a file named ccAvenueRequestHandler.php
Step 5: Create a file named ccAvenueResponseHandler.php
Create header.php and footer.php 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