cgchris99 Posted February 15, 2005 Share Posted February 15, 2005 Here is the code that displays the errors when a credit card error occurs. I have attempted to add the code to send the store owner and email when this occurs. If I can get this to work, I will modify it and have it also send the person an email explaining the error and how to correct it. function before_process() { global $HTTP_POST_VARS,$response; // Change made by using ADC Direct Connection $response_vars = explode(',', $response[0]); $response_reason = $response_vars[3]; //added cgc $x_response_code = $response_vars[0]; if ($x_response_code != '1') { // tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR_MESSAGE), 'SSL', true, false)); $tmp_cc_err=$HTTP_POST_VARS['authorizenet_cc_owner']."\n".$HTTP_GET_VARS['authorizenet_cc_owner']."\n".'error_message=' . urlencode(MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR_MESSAGE) . 'Reason: ' .$response_reason; tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, 'MyStore CCard Error', nl2br($tmp_cc_err), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, ''); tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR_MESSAGE) . 'Reason: ' .$response_reason, 'SSL', true, false)); // tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode($_POST['x_response_reason_code'] . ' - ' . $response[0] . $_POST['x_response_reason_text']), 'SSL', true, false)); } } { Right now, I get the email but the customer name is blank. Anyone know what I am doing wrong? Quote Link to comment Share on other sites More sharing options...
cgchris99 Posted February 16, 2005 Author Share Posted February 16, 2005 Right now, I get the email but the customer name is blank. Anyone know what I am doing wrong? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.