am1971 Posted August 17, 2006 Share Posted August 17, 2006 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 Quote Link to comment Share on other sites More sharing options...
rsproc Posted December 18, 2006 Share Posted December 18, 2006 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 Quote Link to comment Share on other sites More sharing options...
redguy Posted January 17, 2007 Share Posted January 17, 2007 I will give it a try...Thanks 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.