Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

authorize.net - send email on error?


cgchris99

Recommended Posts

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?

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...