2017 © Pedro Peláez
 

library ccavenue

CCAvenue Payment Gateway PHP Library

image

kishanio/ccavenue

CCAvenue Payment Gateway PHP Library

  • Tuesday, December 8, 2015
  • by kishanio
  • Repository
  • 0 Watchers
  • 7 Stars
  • 127 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 12 Forks
  • 4 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

CCAvenue Payment Gateway PHP Library

Installation

composer require kishanio/ccavenue

Documentation / Example

Request Payment, (*1)

require_once __DIR__ . '/../vendor/autoload.php'; 
use Kishnio\CCAvenue\Payment as CCAvenueClient;

$ccavenue = new CCAvenueClient( '<merchant_id>', '<working_key>', '<redirect_url>' );

// set details 
$ccavenue->setAmount( '<Amount>' );
$ccavenue->setOrderId( '<order_id>' );
$ccavenue->setBillingName( '<billing_cust_name>' );
$ccavenue->setBillingAddress( '<billing_cust_address>' );
$ccavenue->setBillingCity( '<billing_cust_city>' );
$ccavenue->setBillingZip( '<billing_cust_zip>' );
$ccavenue->setBillingState( '<billing_cust_state>' );
$ccavenue->setBillingCountry( '<billing_cust_country>' );
$ccavenue->setBillingEmail( '<billing_cust_email>' );
$ccavenue->setBillingTel( '<billing_cust_tel>' );
$ccavenue->setBillingNotes( '<billing_cust_notes>' );

// 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 Redirect, (*2)

<!-- Request -->
<form method="post" name="redirect" action="http://www.ccavenue.com/shopzone/cc_details.jsp"> 
    <?php
        echo '<input type=hidden name=encRequest value="'.$data.'"">';
        echo '<input type=hidden name=Merchant_Id value="'.$merchant.'">';
    ?>
</form>

<script language='javascript'>document.redirect.submit();</script>
</body>
</html>

Payment Response, (*3)

require_once __DIR__ . '/../vendor/autoload.php'; 
use Kishnio\CCAvenue\Payment as CCAvenueClient;

// Get Response
$response=$_POST["encResponse"];    

$ccavenue = new CCAvenueClient( '<merchant_id>', '<working_key>', '<redirect_url>' );

// Check if the transaction was successfull.
echo $ccavenue->response( $response );

The Versions

08/12 2015

dev-master

9999999-dev

CCAvenue Payment Gateway PHP Library

  Sources   Download

MIT

The Requires

  • php >=5.5

 

by Kishan Thobhani

php library payment gateway ccavenue