Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

edit authorizenetaim.php to show credit card declined error on page


am1971

Recommended Posts

Hi

 

I hope someone can help.

 

authorizenetaim is working fine, I just would like to know how to edit the file authorizenetaim.php to show the cc declined error message on the page itself and not under my logo on the top.

 

Thanks

Link to comment
Share on other sites

  • 4 months later...

The problem is in how the authorizenetaim module handles errors. The authorizenetaim module class has an error property and a get_error method to retrieve it. Using a getter to retrieve a class property is good object-oriented design, but the authorizenetaim object does not persist through the session. Every time you refresh or get redirected to a different page, the authorizenetaim object gets destroyed and then recreated with it's default values. So, when the $error propetry gets set in checkout_process.php, it will get set back to its default value when checkout_process.php redirects to checkout_payment.php. The changes I made are just making the authorizenetaim module handle errors in the same way that authorizenet module does.

 

Line 100

$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&authorizenetaim_cc_owner=' . urlencode($HTTP_POST_VARS['authorizenetaim_cc_owner']) . '&authorizenetaim_cc_expires_month=' . $HTTP_POST_VARS['authorizenetaim_cc_expires_month'] . '&authorizenetaim_cc_expires_year=' . $HTTP_POST_VARS['authorizenetaim_cc_expires_year'];

 

Line 224

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=' . urlencode($response_vars[3]) . '&authorizenetaim_cc_owner=' . urlencode($HTTP_POST_VARS['authorizenetaim_cc_owner']) . '&authorizenetaim_cc_expires_month=' . $HTTP_POST_VARS['authorizenetaim_cc_expires_month'] . '&authorizenetaim_cc_expires_year=' . $HTTP_POST_VARS['authorizenetaim_cc_expires_year'], 'SSL', true, false));

 

Line 240

function get_error() {
  global $HTTP_GET_VARS;
  $error = array('title' => MODULE_PAYMENT_AUTHORIZENETAIM_TEXT_ERROR,
				 'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));

  return $error;
}

 

The get_error() function is the same function in the authorizenet module, only the title reference was changed to reference the authorizenetaim title instead. Hope this helps.

 

Hi

 

I hope someone can help.

 

authorizenetaim is working fine, I just would like to know how to edit the file authorizenetaim.php to show the cc declined error message on the page itself and not under my logo on the top.

 

Thanks

Link to comment
Share on other sites

  • 5 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...