Guest Posted January 8, 2004 Share Posted January 8, 2004 Many osCommerce users have had the misfortune of coming across the dreaded "There has been an error processing your credit card. Please try again." message. Finding the exact cause/meaning of the problem has for some involved many days of frustration and hair pulling :unsure: Authorizenet in fact sends an "response reason code" when the above message is triggered - it is a simple matter to parse the data posted from the Authorizenet server for the code, and from this to look up the exact reason on the Authorizenet website. In catalog/includes/modules/payment/authorizenet.php change: ? ? ?// Code 3 is an error - but anything else is an error too (IMHO) ? ? ?tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR_MESSAGE), 'SSL', true, false)); to: ? ? ?// Code 3 is an error - but anything else is an error too (IMHO) ? ? ?tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR_MESSAGE . ' ' . $HTTP_POST_VARS['x_response_reason_code']), 'SSL', true, false)); This will append the response reason code to the end of the error message displayed at the top of the checkout page. HTH Matti Link to comment Share on other sites More sharing options...
Guest Posted March 12, 2004 Share Posted March 12, 2004 Thanks Matti, Link to comment Share on other sites More sharing options...
Guest Posted March 14, 2004 Share Posted March 14, 2004 Sorry to be so negative all the time...I really am trying to help osc succeed. The problem is that the messages given by payment modules sometimes dont mean anything to the customer so the customer just tries again and again generating the same error every time and then gives up. I tried to figure out how to jump to a full page explanation that was customer friendly but this is so complicated I gave up. It has to tie in with the overall checkout process design. It turns out that payment vendors just dont develop very robust error handling for osc. They just do the minimum. I've tried to add lots of html to warn customers how to use the cart but still about 4% of them just "satisfice", ie, click away and get stupid errors. And this costs money for the merchant because each transaction attempt generates some nickel and dime sized charges at the gateway. I believe the entire checkout process needs to be redesigned to allow custom error explanation pages to be inserted into the checkout process. This will require the hooks (or API) that is given to payment processors to be redesigned. Its a major flaw in osc and one that is very embarrassing. I have a world class customer who puts on events which presidents and prime ministers speak at and the customer(s) sometimes spends $5000 to $25,000 for a block of tickets and if I have just one customer complain that he couldnt use the cart because he doesnt know what the error message means I will lose the account just because I look unprofessional. I have a hard time recommending osc when I know it has this checkout flaw. Link to comment Share on other sites More sharing options...
afaik Posted March 15, 2004 Share Posted March 15, 2004 I added this in, but I still seem to get an error with no response code at all... any ideas on what the problem could be? Link to comment Share on other sites More sharing options...
♥ecartz Posted March 16, 2004 Share Posted March 16, 2004 I believe the entire checkout process needs to be redesigned to allow custom error explanation pages to be inserted into the checkout process. This will require the hooks (or API) that is given to payment processors to be redesigned.Uhmmm....no. You just need to process the return code from the processor and convert it to a meaningful string. Some payment modules already do this to some extent. No complicated rewrite needed, just some parsing of the return codes. Remember, the return codes are intended to be read by computers not people. The coder is responsible for converting NA---S-GGG into a meaningful statement like "We are sorry, we can only ship to the billing address of the card. Please change the ship to address to match the address held by the card merchant. Or contact your card merchant to update their records to include this address." Adding an extra page to the checkout just adds confusion. Now the customer clicks to get rid of that page and vainly tries to remember what it said to do. Disgusted, they just click out of the whole process. Hth, Matt Always back up before making changes. Link to comment Share on other sites More sharing options...
yella Posted March 21, 2004 Share Posted March 21, 2004 Thank you Matt.... your posting was just what I needed. You've just made my day... thanks again. Danielle Link to comment Share on other sites More sharing options...
Guest Posted March 28, 2004 Share Posted March 28, 2004 I am getting nowhere here. I can process cards to authorized, I can get a response if the card is good. Tells me order will be ship in 2-5 days. When I use a known bad card I get nothing the web page is redirect to the checkout_payment.php page and no error the url say https://secure.authorize.net/gateway/transact.dll Should there be a messege in the web page saying the card has been declined? Anyone else have this problem Link to comment Share on other sites More sharing options...
Guest Posted March 29, 2004 Share Posted March 29, 2004 I am getting nowhere here. I can process cards to authorized, I can get a response if the card is good. Tells me order will be ship in 2-5 days. When I use a known bad card I get nothing the web page is redirect to the checkout_payment.php page and no error the url say https://secure.authorize.net/gateway/transact.dll Should there be a messege in the web page saying the card has been declined? Anyone else have this problem If I remember correctly, this is how the "stock" authorizenet module is written. Your not doing anything wrong, it's doing that it was designed to do. I re-wrote mine to be a heck of lot more user friendly. And my sales went up after this as the customer knew what they were doing wrong and corrected themselves and completed the transaction. B) Link to comment Share on other sites More sharing options...
barbarshop Posted April 2, 2004 Share Posted April 2, 2004 Matti, Thanks so much for the code. Using it I was able to fix my problem. Now, after that wonderful Tip do you know where I can go to change the error code into something a user can understand like, "I'm sorry we don't accept this type of credit card"? Thanks, Jeremy Link to comment Share on other sites More sharing options...
211655 Posted May 11, 2004 Share Posted May 11, 2004 any1 knows if it will solve this error: http://www.oscommerce.com/forums/index.php?act=ST&f=11&t=91974 anyone. Matti please help. 211655 SEO Optimization Export Orders into CSV file Link to comment Share on other sites More sharing options...
rebertha Posted October 7, 2004 Share Posted October 7, 2004 I replaced the code in the authorizenet.php page as you stated. I still get an error, but now it says: There has been an error processing your credit card. Please try again. 103 How do I solve the 103 error? Thanks! Link to comment Share on other sites More sharing options...
Guest Posted October 10, 2004 Share Posted October 10, 2004 I replaced the code in the authorizenet.php page as you stated. I still get an error, but now it says: There has been an error processing your credit card. Please try again. 103 How do I solve the 103 error? Thanks! <{POST_SNAPBACK}> Hello rebertha, First, the original module of Authorize.net that came with OsCommerce is out of date. You need to download and install the updated module. http://www.oscommerce.com/community/contri...lidated+for+AIM Next, you need to be sure that cURL is installed on you server, what version (other words if it's current) and if it's compiled...and the pathway if not (ask your web host these questions). Let me know this info and what type of server you are running. You can contact me here. https://shop.ronaldreagan.com/oscommerce/contact_us.php Sincerely The Finman Link to comment Share on other sites More sharing options...
snook789 Posted April 30, 2006 Share Posted April 30, 2006 Uhmmm....no. You just need to process the return code from the processor and convert it to a meaningful string. Some payment modules already do this to some extent. No complicated rewrite needed, just some parsing of the return codes. Remember, the return codes are intended to be read by computers not people. The coder is responsible for converting NA---S-GGG into a meaningful statement like "We are sorry, we can only ship to the billing address of the card. Please change the ship to address to match the address held by the card merchant. Or contact your card merchant to update their records to include this address." Adding an extra page to the checkout just adds confusion. Now the customer clicks to get rid of that page and vainly tries to remember what it said to do. Disgusted, they just click out of the whole process. Hth, Matt I know this is an old post, but this is excatly what I am looking to do. Could you point me to examples or Contrib that might do this ? Or perhaps example code to add to our authorizenet.php to do this ? I just posted this in the payment forum, but this is excatly what I am looking for, so I will post the area of the code I see where these responds would go. Then maybe someone can post an example how I should edit it to get Authorize.Nets responds Here is the code from Authorize.net Consolidated v1.7 in authorizenet.php // Change made by using ADC Direct Connection $response_vars = explode(',', $response[0]); $x_response_code = $response_vars[0]; $x_response_subcode = $response_vars[1]; $x_response_reason_code = $response_vars[2]; $x_response_reason_text = $response_vars[3]; if ($x_response_code != '1') { tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$insert_id . "'"); //Remove order if($x_response_code == '') { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('The server cannot connect to Authorize.net. Please check your cURL and server settings.'), 'SSL', true, false)); } else if($x_response_code == '2') { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('Your credit card was declined ') . urlencode('(') . urlencode("$x_response_reason_code") . urlencode('): ') . urlencode("$x_response_reason_text"), 'SSL', true, false)); } else if($x_response_code == '3') { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an error processing your credit card ') . urlencode('(') . urlencode("$x_response_reason_code") . urlencode('): ') . urlencode("$x_response_reason_text"), 'SSL', true, false)); } else { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an unspecified error processing your credit card.'), 'SSL', true, false)); } Link to comment Share on other sites More sharing options...
freedomt Posted June 8, 2006 Share Posted June 8, 2006 Hello; I made the approximate change you suggested and here is the URL with an error (i put in the wrong cvv) Can you tell me if the Authorize.net error Code is in there and where? and the Authorize.net error text? If the error code and text is not there, can you see what I am doing wrong? (We use Authorize..Consolidated) https://secure.uneekchess.com/store/checkout_payment.php?error_message=Your+credit+card+was+declined+%28%29%3A+&osCsid=6e924084b548def4d490cfa8499fd281 My code in authorizenet.php looks like this: if ($x_response_code != '1') { tep_db_query("delete from " . TABLE_ORDERS . " where orders_id = '" . (int)$insert_id . "'"); //Remove order if($x_response_code == '') { // tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('The server cannot connect to Authorize.net. Please check your cURL and server settings.'), 'SSL', true, false)); tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('The server cannot connect to Authorize.net. Please check your cURL and server settings.') . urlencode('(') . urlencode("$x_response_reason_code") . urlencode('): ') . urlencode("$x_response_reason_text"), 'SSL', true, false)); } else if($x_response_code == '2') { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('Your credit card was declined ') . urlencode('(') . urlencode("$x_response_reason_code") . urlencode('): ') . urlencode("$x_response_reason_text"), 'SSL', true, false)); } else if($x_response_code == '3') { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an error processing your credit card ') . urlencode('(') . urlencode("$x_response_reason_code") . urlencode('): ') . urlencode("$x_response_reason_text"), 'SSL', true, false)); } else { //tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an unspecified error processing your credit card.'), 'SSL', true, false)); tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was an unspecified error processing your credit card. ') . urlencode('(') . urlencode("$x_response_reason_code") . urlencode('): ') . urlencode("$x_response_reason_text"), 'SSL', true, false)); } } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.