Gaddy Posted August 28, 2012 Share Posted August 28, 2012 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§ion=attach&attach_id=46411 ccavenue.zip Link to comment Share on other sites More sharing options...
bellini13 Posted August 28, 2012 Share Posted August 28, 2012 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. 1 Link to comment Share on other sites More sharing options...
Gaddy Posted August 28, 2012 Author Share Posted August 28, 2012 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 More sharing options...
bellini13 Posted August 29, 2012 Share Posted August 29, 2012 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. 1 Link to comment Share on other sites More sharing options...
Gaddy Posted August 31, 2012 Author Share Posted August 31, 2012 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 More sharing options...
Gaddy Posted August 31, 2012 Author Share Posted August 31, 2012 //$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 More sharing options...
bellini13 Posted August 31, 2012 Share Posted August 31, 2012 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? 1 Link to comment Share on other sites More sharing options...
Gaddy Posted September 3, 2012 Author Share Posted September 3, 2012 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 More sharing options...
Gaddy Posted September 4, 2012 Author Share Posted September 4, 2012 The problem is that i am getting redirected to the validation.php page but instead of redirecting it to the index page it is not redirecting. And ccavenue is passing the proper values' Link to comment Share on other sites More sharing options...
bellini13 Posted September 4, 2012 Share Posted September 4, 2012 you have not shown what the POST or GET values of AuthDesc and Auth_Status are. I do not see echo statements in your code above, so how could you possibly know what they are sending you? 1 Link to comment Share on other sites More sharing options...
Gaddy Posted September 4, 2012 Author Share Posted September 4, 2012 Actually i did write it in the code it was like this $var1 = $_POST['AuthDesc']; $var2 = $_POST['Auth_Status']; $var3 = $_REQUEST['Checksum']; echo $var1; echo $var2; echo $var3; Link to comment Share on other sites More sharing options...
bellini13 Posted September 4, 2012 Share Posted September 4, 2012 and the values are? 1 Link to comment Share on other sites More sharing options...
Gaddy Posted September 5, 2012 Author Share Posted September 5, 2012 Dude you were right i am not getting any values from ccavenue. when i echo blank paAGE. Earlier i had assigned it to some value. Very idiotic mistake, Link to comment Share on other sites More sharing options...
Gaddy Posted September 5, 2012 Author Share Posted September 5, 2012 Am i missing some file permissions. caz i am not getting any values from ccavenue. You were right all along. Link to comment Share on other sites More sharing options...
bellini13 Posted September 5, 2012 Share Posted September 5, 2012 (edited) add these 2 lines to the top of the validation.php file and try again. Tell me what the output says on the page var_dump($_GET); var_dump($_POST); Edited September 5, 2012 by bellini13 (see edit history) 1 Link to comment Share on other sites More sharing options...
Gaddy Posted September 5, 2012 Author Share Posted September 5, 2012 (edited) 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 September 5, 2012 by Gaddy (see edit history) 1 Link to comment Share on other sites More sharing options...
bellini13 Posted September 5, 2012 Share Posted September 5, 2012 that is a question for ccavenue. the output "array(0) { } array(0) { }" means they are not passing any GET or POST parameters back to you. Link to comment Share on other sites More sharing options...
Gaddy Posted September 5, 2012 Author Share Posted September 5, 2012 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 More sharing options...
Gaddy Posted September 6, 2012 Author Share Posted September 6, 2012 (edited) 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 September 6, 2012 by Gaddy (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted September 6, 2012 Share Posted September 6, 2012 can you explain how you got it working, so others that have the same problem can benefit? can you also provide the output from the GET and POST parameters that are being passed in so we know what code is being executed. Link to comment Share on other sites More sharing options...
Gaddy Posted September 6, 2012 Author Share Posted September 6, 2012 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 More sharing options...
bellini13 Posted September 7, 2012 Share Posted September 7, 2012 yup i understood. so are you all set now? Link to comment Share on other sites More sharing options...
Gaddy Posted September 7, 2012 Author Share Posted September 7, 2012 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. Link to comment Share on other sites More sharing options...
bellini13 Posted September 7, 2012 Share Posted September 7, 2012 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 More sharing options...
Ld So Posted September 22, 2012 Share Posted September 22, 2012 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 More sharing options...
Gaddy Posted November 27, 2012 Author Share Posted November 27, 2012 For me the url is http://www.yourshopname.com/validation.php Link to comment Share on other sites More sharing options...
r3esolution Posted June 30, 2013 Share Posted June 30, 2013 (edited) any one help me in INR Payment Module of ccavanue i dont understand this and also geting some issue there please mail to me on [email protected] Edited June 30, 2013 by r3esolution (see edit history) Link to comment Share on other sites More sharing options...
chirag Posted August 3, 2013 Share Posted August 3, 2013 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 More sharing options...
Hacktronics India Posted February 5, 2014 Share Posted February 5, 2014 I ran into some checksum issues and the CCAvenue payment page is not filled with complete details. I have use the libfunctions.php to compute the checksum and it started working fine. ccavenue.zip Link to comment Share on other sites More sharing options...
chirag Posted February 6, 2014 Share Posted February 6, 2014 When my customers check-out using CC Avenue, The delivery and Billing address are same on the cc avenue page even when different addresses are entered on website during check-out. Link to comment Share on other sites More sharing options...
IndiaLinkers Posted March 20, 2014 Share Posted March 20, 2014 @chirag have you tried the module provided by ccAvenue ? they provide it free. Regards, Deepanshu Goel Link to comment Share on other sites More sharing options...
peanut Posted March 30, 2014 Share Posted March 30, 2014 @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 More sharing options...
IndiaLinkers Posted April 26, 2014 Share Posted April 26, 2014 (edited) @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 . But, that's the side effect of monopoly (sort of) . 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 April 26, 2014 by IndiaLinkers (see edit history) Link to comment Share on other sites More sharing options...
humendra Posted March 1, 2016 Share Posted March 1, 2016 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 More sharing options...
humendra Posted March 16, 2016 Share Posted March 16, 2016 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 GroupZend Engine v2.6.0, Copyright © 1998-2016 Zend Technologieswith 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 Technologieswith Xdebug v2.3.3, Copyright © 2002-2015, by Derick Rethans Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now