CCAvenue Payment Gateway Integration in PHP

CCAvenue Payment Gateway Integration in PHP –
In this tutorial I am going to share simple php script to integrate CCAvenue Payment Gateway. It is most popular payment gateway but expensive as compared to any other gateway, but presents your customers with lot of payment options, including wallets. Also success rate and reliability is good. South Asia’s largest payment gateway solution powering thousands of eMerchants with real time, multi-currency, multiple payment options online payment processing services. The solution is powered by proprietary technology that integrates transaction-processing, advance shopping cart, auction payment collection facility, fraud control, financial reporting and order tracking. Collect payments in 27 major foreign currencies and allow your customer to pay in the currency they know best, Multilingual Checkout Page, 200+ Payment Options, 17+ Shopping cart plugins. So if your we based application in PHP then here you’ll get solution to integrate CCAvenue Payment Gateway in PHP.

Install

Install library via composer.

composer require kishanio/ccavenue

PHP

Include the library on page, don’t forget to generate 'merchant_id', 'working_key', 'redirect_url' from CCAvenue website. and set required parameter like Amount, billing_cust_name, billing_cust_address and so on.

require_once __DIR__ . '/../vendor/autoload.php'; 
use Kishnio\CCAvenue\Payment as CCAvenueClient;
 
$ccavenue = new CCAvenueClient( '', '', '' );
 
// set details 
$ccavenue->setAmount( '' );
$ccavenue->setOrderId( '' );
$ccavenue->setBillingName( '' );
$ccavenue->setBillingAddress( '' );
$ccavenue->setBillingCity( '' );
$ccavenue->setBillingZip( '' );
$ccavenue->setBillingState( '' );
$ccavenue->setBillingCountry( '' );
$ccavenue->setBillingEmail( '' );
$ccavenue->setBillingTel( '' );
$ccavenue->setBillingNotes( '' );
 
// copy all the billing details to chipping details
$ccavenue->billingSameAsShipping();
 
// get encrpyted data to be passed
$data = $ccavenue->getEncryptedData();
 
// merchant id to be passed along the param
$merchant = $ccavenue->getMerchantId();

HTML

Create simple form where which you can submit on user action.


Payment Response

After successful payment process you will get payment response in below parameter and you now redirect invoice page or any page your want.

require_once __DIR__ . '/../vendor/autoload.php'; 
use Kishnio\CCAvenue\Payment as CCAvenueClient;
 
// Get Response
$response=$_POST["encResponse"];    
 
$ccavenue = new CCAvenueClient( '', '', '' );
 
// Check if the transaction was successfull.
echo $ccavenue->response( $response );

See live demo and download source code.

This awesome script developed by kishanio, Visit their official github repository for more information and follow for future updates.

FREE PHP CCAvenue Payment Gateway Integration Script

Following are the list of popular top rated hand picked PHP CCAvenue Payment Gateway Integration.

I Hope you liked Hand-picked list of PHP CCAvenue Payment Gateway Integration, Don’t forget to Subscribe My Public Notebook for more useful Hand-picked PHP and MySql code examples, tutorials and articles.

Don’t forget to Subscribe My Public Notebook for more useful free scripts, tutorials and articles.

Leave a Reply

Your email address will not be published. Required fields are marked *

Top