FugNutz Posted June 11, 2005 Share Posted June 11, 2005 hello all! using authorize.net consolidated - dated march 24, 04 by renfroe. had any one modified it so that "credit card declined" appears within the page, such as CVV errors, instead of only appearing in URL? i am observing that people are not seeing the error as it appears in URL, for them, it just looks like its having a problem and looping. i see them trying and trying. if they could know, that the error was "declined", they would be better able to solve this issue with the card. that error should be passed and appear on the page as an error. anyone rewrote this already.... possible saving me some time on trial and error hacking away at the code? thanx all! fug Link to comment Share on other sites More sharing options...
FugNutz Posted June 11, 2005 Author Share Posted June 11, 2005 i think this would be nifty little section of code: but it does appear as though it is only coded to allow URL errors, and it is not being posted back to the html page for clients to see.... anyone hacked away at this yet? anyone have some ideas on how i should mod this to work? thanx! from the file includes/payment/authorizenet.php function before_process() { global $response; // 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)); } } } function after_process() { return false; } function get_error() { global $HTTP_GET_VARS; $error = array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR, 'error' => stripslashes(urldecode($HTTP_GET_VARS['error']))); return $error; } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.