CCAvenue Gateway Integration – Error
-
Hi,
I have developed many responsive sites on wordpress. Now, I want to integrate CCAvenue Payment Gateway with the existing ‘Ready-Ecommerce’ theme. But at the time of testing there is an error of 112 at the following link:
https://test.ccavenue.com/transaction/transaction.do?command=initiateTransactionI need an immediate help to solve this issue. Plz check the code…It’s very imp for me to solve.
Here’s the code:<?php include(‘Crypto.php’)?>
<?php
class toecCCAvenue extends paymentModule {
public function __construct($d, $params = array()) {
parent::__construct($d, $params);
$this->_haveProcessHtml = true;
}
public function getProcessHtml() {$dataForResponseLink = array(‘mod’ => ‘ccAvenue’, ‘action’ => ‘getResponseHandler’);
if($this->_params->testMode)
$url = ‘https://test.ccavenue.com/transaction/transaction.do?command=initiateTransaction’; //Development
else
$url = ‘https://secure.ccavenue.com/transaction/transaction.do?command=initiateTransaction’; //Live$order = frame::_()->getModule(‘order’)->getCurrent();
$gifts = frame::_()->getModule(‘checkout’)->getGifts();
$discountAmountCart = !empty($gifts) && is_array($gifts) && isset($gifts[‘total’]) && !empty($gifts[‘total’])
? $gifts[‘total’]
: 0;
$parameters = array(
‘merchant_id’ => $this ->_params-> merchant_id,
‘amount’ => round(frame::_()->getModule(‘currency’)->calculate($order[‘total’], $order[‘currency’]), 2),
‘order_id’ => frame::_()->getModule(‘order’)->getCurrentID(),
‘redirect_url’ => frame::_()->getModule(‘pages’)->getLink(‘$dataForResponseLink’),
‘cancel_url’ => frame::_()->getModule(‘pages’)->getLink(‘$dataForResponseLink’),
‘billing_name’ => $order[‘billing_address’][‘first_name’].’ ‘. $order[‘billing_address’][‘last_name’],
‘billing_address’ => $order[‘billing_address’][‘street_address’],
‘billing_country’ => fieldAdapter::displayCountry($order[‘billing_address’][‘country’], ‘iso_code_2’),
‘billing_state’ => fieldAdapter::displayState($order[‘billing_address’][‘state’], ‘code’),
‘billing_city’ => $order[‘billing_address’][‘city’],
‘billing_zip’ => $order[‘billing_address’][‘postcode’],
‘billing_tel’ => $order->billing_phone,
‘billing_email’ => $order -> billing_email,
‘delivery_name’ => $order[‘shipping_address’][‘first_name’]. ‘ ‘. $order[‘shipping_address’][‘last_name’],
‘delivery_address’ => $order[‘shipping_address’][‘address’],
‘delivery_country’ => $order[‘shipping_address’][‘country’][‘iso_code_2’],
‘delivery_state’ => $order[‘shipping_address’][‘state’],
‘delivery_tel’ => ”,
‘delivery_city’ => $order[‘shipping_address’][‘city’],
‘delivery_zip’ => $order[‘shipping_address’][‘zip’],
‘language’ => ‘EN’,
‘currency’ => $order[‘currency’][‘code’],
‘paymentaction’ => (isset($this->_params->paymentaction) && !empty($this->_params->paymentaction)) ? $this->_params->paymentaction : ‘authorization’,
);
if($discountAmountCart)
$parameters[‘discount_amount_cart’] = round(frame::_()->getModule(‘currency’)->calculate($discountAmountCart, $order[‘currency’]), 2);//$parameters[‘address_override’] = ‘1’;
$parameters[‘charset’] = ‘utf-8’;
if(!empty($order[‘products’]) && is_array($order[‘products’])) {
$i = 1;
foreach($order[‘products’] as $p) {
$parameters[‘amount_’. $i] = round(frame::_()->getModule(‘currency’)->calculate(frame::_()->getModule(‘currency’)->calculateTotal($p[‘product_price’], 1, $p[‘product_id’], $p[‘product_params’]), $order[‘currency’]), 2);
$parameters[‘item_name_’. $i] = htmlspecialchars($p[‘product_name’]);
$parameters[‘quantity_’. $i] = $p[‘product_qty’];
if(isset($p[‘product_params’])
&& !empty($p[‘product_params’])
&& isset($p[‘product_params’][‘options’])
&& !empty($p[‘product_params’][‘options’])
&& is_array($p[‘product_params’][‘options’])
) {
$j = 0;
foreach($p[‘product_params’][‘options’] as $opt) {
$parameters[‘on’. $j. ‘_’. $i] = $opt[‘label’];
$parameters[‘os’. $j. ‘_’. $i] = is_array($opt[‘displayValue’]) ? implode(‘, ‘, $opt[‘displayValue’]) : $opt[‘displayValue’];
$j++;
}
}
$i++;
}
}
$merchant_data=”;
$working_key = ‘this->_params->enc_key’;
foreach($parameters as $k => $v) {
$paramsJoined[] = “$k=$v”;
}
$merchant_data = implode(‘&’, $paramsJoined);
$encrypted_data = encrypt($merchant_data, $working_key);
$ccavenue_args_array = array();
$ccavenue_args_array[] = “<input type=’hidden’ name=’encRequest’ value=’$encrypted_data’/>”;
$ccavenue_args_array[] = “<input type=’hidden’ name=’access_code’ value='{$this->_params->access_code}’/>”;$out = ‘<form action=”‘ . esc_url( $url ) . ‘” method=”post”>’ . implode( ”, $ccavenue_args_array ) . ‘
<input type=”submit” class=”button alt” id=”pay” value=”‘ . __( ‘Pay via CCAvenue’) . ‘” />
</form>’;
return $out;
}
}
?>The blog I need help with is: (visible only to logged in users)
-
Hi there,
This is the WordPress.COM support forum. You need to post to the WordPress.ORG support forum for help with your site because it is not hosted by WordPress.COM.WordPress.com and WordPress.org are completely separate and different http://support.wordpress.com/com-vs-org/
If you don’t have a username account at WordPress.ORG click http://wordpress.org/support/ and register one on the top right hand corner of the page that opens, so you can post to the support forums there and receive advice from WordPress.ORG bloggers.
- The topic ‘CCAvenue Gateway Integration – Error’ is closed to new replies.