Jump to content

CCAvenue module Problems


Recommended Posts

I installed a CCAvenue Module in prestashop 1.4. I am having a unique problem. All is working fine. Only thing is that the cart isnt getting updated when the customer come back to the shop after completing the payment. Can someone tell me what particular function do i have to edit or what variable i have to clear. Thanking you guys in Advance.

 

I got the module from here: www.prestashop.com/forums/index.php?app=core&module=attach&section=attach&attach_id=46411

ccavenue.zip

Link to comment
Share on other sites

it is validation.php that is called by ccavenue when returning the customer back to your store after payment.

add some debug statements to the validation.php, and confirm that it is being called.

The module expects that ccavenue is returning AuthDesc or Auth_Status variable with a particular value. If it does not return the correct value, then nothing will happen.

  • Like 1
Link to comment
Share on other sites

This is the validation code that i am encountering. I still cannot find any error in it. Technically it should update the cart.

 

 

 

 

if($_POST['AuthDesc']=='Y' or $_POST['Auth_Status'] =='Y')

{

$ccavenue->validateOrder($cart->id, _PS_OS_PAYMENT_, $total, $ccavenue->displayName, NULL, $mailVars, $currency->id);

$order = new Order($ccavenue->currentOrder);

Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?id_cart='.$cart->id.'&id_module='.$ccavenue->id.'&id_order='.$ccavenue->currentOrder.'&key='.$ccavenue->seccode());

}

 

else if($_POST['AuthDesc']=='B' or $_REQUEST['Auth_Status'] =='B')

{

 

$ccavenue->validateOrder($cart->id, _PS_OS_PAYMENT_, $total, $ccavenue->displayName, NULL, $mailVars, $currency->id);

$order = new Order($ccavenue->currentOrder);

Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?id_cart='.$cart->id.'&id_module='.$ccavenue->id.'&id_order='.$ccavenue->currentOrder.'&key='.$ccavenue->seccode());

}

 

 

else if($_POST['AuthDesc']=='N' or $_POST['Auth_Status'] =='N')

{

// echo 'Thank you for shopping with us. However,the transaction has been declined.';

 

Tools::redirectLink(__PS_BASE_URI__.'index.php');

 

}

Link to comment
Share on other sites

as i said, it will only update the cart if ccavenue is returning AuthDesc or Auth_Status variable with a particular value (for instance, Y, B or N)

 

you should add some debug statements to this file to determine what value is being returned for those parameters.

  • Like 1
Link to comment
Share on other sites

Hey thanks for your inputs . I did put some debug statements to check how the flow is going. But it came to my realization that after the cc avenue payment is completed it is redirected to the index page of my shop. It actually should be directed to /modules/ccavenue/validation.php. Where do i put the redirect url that is passes to ccavenue? I think that should be /modules/ccavenue/validation.php in stead of index.php.

 

Thanking you in advance for you help. Your earlier inputs helped me a lot.

Link to comment
Share on other sites

//$Checksum = getCheckSum($Merchant_Id,$Order_Id,$Amount ,$WorkingKey,$Currency,$Redirect_Url);

$smarty->assign(array(

'address' => $address,

'country' => new Country(intval($address->id_country)),

'customer' => $customer,

'MerchantId' => $MerchantId,

'header' => $header,

'Checksum' => $Checksum,

'OrderId' => $OrderId,

'secure_key' => $customer->secure_key,

'workingkey' => $WorkingKey,

'currencyType' => $currencyType,

'ccavenueUrl' => $this->getccavenueUrl(),

// products + discounts - shipping cost

'Amount' => $Amount,

// shipping cost + wrapping

 

// products + discounts + shipping cost

 

'Redirect_Url' => 'http://'.htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/ccavenue/validation.php',

 

'this_path' => $this->_path

));

 

 

 

is this the place where you form a array which includes the redirect url. ? Also as you can see that the redirect url is proper.

Link to comment
Share on other sites

i concur, the redirect URL looks correct in the module you have attached. you should confirm directly with the payment gateway if they are using the value passed to them in 'Redirect_Url'. Perhaps you have overriden this in the merchant account setup?

  • Like 1
Link to comment
Share on other sites

ok i got it working. But new problem arose. The ccavenue is redirecting to the validation page but it is not entering any of the if statements. I am posting the if statements can someone please tell me if the statements are proper.

 

Here Goes :

 

 

 

 

 

Validation.php

 

<?php

 

include(dirname(__FILE__).'/../../config/config.inc.php');

include(dirname(__FILE__).'/ccavenue.php');

 

$errors = '';

// global $HTTP_POST_VARS;

$result = false;

$ccavenue = new ccavenue();

//echo "ashu";

session_start();

//echo $sequrecode;

$total=$_POST['Amount'];

 

$order_id=$_POST['Order_Id'];

$temporderid=explode('-',$order_id);

$cart->id=$temporderid['1'];

$ccavenue->currentOrder=$_POST['Order_Id'];

//echo 'order-confirmation.php?id_cart='.$cart->id.'&id_module='.$ccavenue->id.'&id_order='.$ccavenue->currentOrder.'&key='.$order->secure_key;

//$urltes=$ccavenue->pay123();90f78637fc875595b2d450086bc91e01

$MerchantId = trim(Configuration::get('CCAVENUE_MERCHANT_ID'));

$header = Configuration::get('CCAVENUE_SANDBOX');

$WorkingKey = trim(Configuration::get('CCAVENUE_WORKING_KEY'));

 

 

 

if($_POST['AuthDesc']=='Y' or $_POST['Auth_Status'] =='Y')

{

echo"it is entering the first if statement";

$ccavenue->validateOrder($cart->id, _PS_OS_PAYMENT_, $total, $ccavenue->displayName, NULL, $mailVars, $currency->id);

$order = new Order($ccavenue->currentOrder);

Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?id_cart='.$cart->id.'&id_module='.$ccavenue->id.'&id_order='.$ccavenue->currentOrder.'&key='.$ccavenue->seccode());

}

 

else if($_POST['AuthDesc']=='B' or $_REQUEST['Auth_Status'] =='B')

{

echo"the code is entering the first if statement";

$ccavenue->validateOrder($cart->id, _PS_OS_PAYMENT_, $total, $ccavenue->displayName, NULL, $mailVars, $currency->id);

$order = new Order($ccavenue->currentOrder);

Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?id_cart='.$cart->id.'&id_module='.$ccavenue->id.'&id_order='.$ccavenue->currentOrder.'&key='.$ccavenue->seccode());

}

 

 

else if($_POST['AuthDesc']=='N' or $_POST['Auth_Status'] =='N')

{

echo 'Thank you for shopping with us. However,the transaction has been declined.';

 

Tools::redirectLink(__PS_BASE_URI__.'index.php');

 

}

 

?>

Link to comment
Share on other sites

Ok i did the transaction. i was redirected to ccavenue page and at the final page the transaction was rejected by the bank. Probably caz i made a lot of transactions in a day. It had happened before. Bank rejected my purchase and the output of the vlidation.php file is

 

 

array(0) { } array(0) { }

 

Also the funny this is the ccavenue displays my order number in the last page. why isnt that value coming to my shop?

Edited by Gaddy (see edit history)
  • Like 1
Link to comment
Share on other sites

thanks dude that was a lot of help. They say they have to check logs in the morning. Are you 100% sure there is no problem from my side. I know all the evidence points to ccavenue. But it is unlikely that a payment gateway will not send values to a merchant website. Maybe I have to check some of the settings in my merchant account. But are you 100% sure there is no problem from my side?

Link to comment
Share on other sites

Ok i finally got it working now one last problem. i dont think i am getting redirected properly

I AM NOT REDIRECTING PROPERLY

 

[quote]if($_POST['AuthDesc']=='Y' or $_POST['Auth_Status'] =='Y')
 {
  echo'The code is entering herw';
 $ccavenue->validateOrder($cart->id,  _PS_OS_PAYMENT_, $total, $ccavenue->displayName, NULL, $mailVars, $currency->id);
$order = new Order($ccavenue->currentOrder);
Tools::redirectLink(__PS_BASE_URI__.'order-confirmation.php?id_cart='.$cart->id.'&id_module='.$ccavenue->id.'&id_order='.$ccavenue->currentOrder.'&key='.$ccavenue->seccode());
}[/quote]
[quote][/quote]

 

 

You have been a tremendous help man. My sincere thanks for all your help and patience.

Edited by Gaddy (see edit history)
Link to comment
Share on other sites

Actually i had put the redirect url in the ccavenue.php file which was being passes to ccavenue when the customer is redirected. Somehow it wasnt passing the index.php of my shop as redirect url. So the telemarketing lady at ccavenue asked me to deactivate something in my merchat account settings. Then also asked me to put the redirect url in the merchant account settings. But it so seems that when you deactivate it the ccavenue doesnt send you the AuthDesc and Auth_status values. And surprisingly accepts all payments (eventhough the account is deactivated). So i changed it to Activate. And it started working. The the dump statements were giving me all values from ccavenue. So i would say get to know all your settings and how they work in the ccavenue merchant settings. I am not good at explaining stuff,...... Hope you understood what i said.

Link to comment
Share on other sites

haha actually no. But its a new topic all together. Actually when the customer makes the payment. In his invoice he gets 2 extra products which are the default ones. Like ipod and something else. I dont have those products in the catalog but still the customer gets a weird email. I am attatching the image of the email below.

 

The circled products arent supposed to be there. Only Lip bam should be there in the invoice.

post-358142-0-40864900-1347028996_thumb.jpg

Link to comment
Share on other sites

i noticed it is order 1. this is likely a known issue.

 

typically when you install prestashop, there is test order for "john doe". if you deleted that order, prestashop does not actually delete the products associated with the order. so then a new order is created, it uses order 1 again, and now the new products and the old products are both associated to order 1.

 

try to create another order and see if it happens again

Link to comment
Share on other sites

  • 2 weeks later...

Actually i had put the redirect url in the ccavenue.php file which was being passes to ccavenue when the customer is redirected. Somehow it wasnt passing the index.php of my shop as redirect url. So the telemarketing lady at ccavenue asked me to deactivate something in my merchat account settings. Then also asked me to put the redirect url in the merchant account settings. But it so seems that when you deactivate it the ccavenue doesnt send you the AuthDesc and Auth_status values. And surprisingly accepts all payments (eventhough the account is deactivated). So i changed it to Activate. And it started working. The the dump statements were giving me all values from ccavenue. So i would say get to know all your settings and how they work in the ccavenue merchant settings. I am not good at explaining stuff,...... Hope you understood what i said.

 

Hello Gaddy,

 

Could you please let us know what was the value you have given for "redirect url in the merchant account settings" while fixing the problem ?

Link to comment
Share on other sites

  • 2 months later...
  • 7 months later...
  • 1 month later...

on my website www.flowermagics.com when i make payment through cc avenue, the payment is successful, but the customer gets the message that order is "cancelled".

customer is redirected back to the website but why doesnt the backoffice indicate that payment is successful?

Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...
  • 2 weeks later...

@chirag

 

have you tried the module provided by ccAvenue ?

 

they provide it free.

 

Regards,

Deepanshu Goel

I have been asking CCAvenue for the module for ages but they never bother to respond. I also don't understand why they simply don't have a download on their website like the most of the other payment gateways. I'm fed up of CCAvenue running & behaving like a dinosaur in today's e-commerce world. Would appreciate it if someone could pass their module. Thanks in advance.

Link to comment
Share on other sites

  • 4 weeks later...

@peanut, Sorry for replying so late.

 

Yes I also agree with you about the behaviour of ccAvenue and their tech support team. They are one of the worst ppl in field  :angry: .

But, that's the side effect of monopoly (sort of)  :mellow: .

 

As for your question for their official module, they don't have one. ccAvenue has a tie-up with some freelancer type company named BlueZeal for all their modules. It comes with BlueZeal branding (easily removable) and zero warranty  :( .

 

I'm attaching the module mailed by ccAvenue to me. Hope you find it useful.

 

Regards,

Deepanshu Goel

 

CCAvenue_Prestashop_1.5.6.0_Module_v1.6.zip

Edited by IndiaLinkers (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Have issue with ccavenue (india) payment integration for 1.6 keep losing the link during checkout the ccavenue option not visible.

Need to clear cache everytime to get it visible again .

 

Any permanent fix since i cannot keep track of the issue will lose order due to this?

Link to comment
Share on other sites

  • 2 weeks later...

I still have issue with ccavenue india payment gateway .. after installing module loading of admin pages very slow .. also pages such as product, category etc if you click next page give error too many redirects any help will be appreciated 

 

Details of environment are as follows:

 

 

PHP 5.6.19-1~dotdeb+7.1 (cli) (built: Mar 4 2016 07:24:13)
Copyright © 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright © 1998-2016 Zend Technologies
with the ionCube PHP Loader + Intrusion Protection from ioncube24.com v5.0.1, Copyright © 2002-2015, by ionCube Ltd.
with Zend OPcache v7.0.6-dev, Copyright © 1999-2016, by Zend Technologies
with Xdebug v2.3.3, Copyright © 2002-2015, by Derick Rethans

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...