jonesevan007 Posted January 30, 2009 Posted January 30, 2009 Hey guys, My payment contribution (Linkpoint Connect) rightfully sends users back from checkout_confirmation to checkout_payment with legitimate errors in their checkout experience. Some errors include: Their credit card was declined, Their expiration date is off, That card isn't accepted here, you get the picture... The only trouble is that these errors are only added on to the payment page's URL and not parsed out somewhere and displayed in a red-bordered box on the webpage itself. I'm looking for a way to parse out the error messages passed to the checkout_payment page from the URLs or otherwise get access to those error messages so I can display them somewhere in the page's markup. A sample error is something like /checkout_payment.php?payment_error=linkpointconnect&error=The+first+four+digits+of+the+number+entered+are%3A+4444.+If+that+number+is+correct%2C+we+do+not+accept+that+type+of+credit+card.+If+it+is+wrong%2C+please+try+again. Most user's, without seeing a red error box, just think they're getting bounced back to the payment page for no reason and end up calling me only to find that their credit cards were declined :P Any guidance? Thanks
jonesevan007 Posted January 30, 2009 Author Posted January 30, 2009 Here's a snippet from the errors section of my payment module function before_process() { global $HTTP_POST_VARS; if ($HTTP_POST_VARS['status'] == 'APPROVED') return; if ($HTTP_POST_VARS['status'] == 'DECLINED') { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_LINKPOINTCONNECT_TEXT_DECLINED_MESSAGE), 'SSL', true, false)); } tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(MODULE_PAYMENT_LINKPOINTCONNECT_TEXT_ERROR_MESSAGE), 'SSL', true, false)); } function after_process() { return false; } function get_error() { global $HTTP_GET_VARS; $error = array('title' => MODULE_PAYMENT_LINKPOINTCONNECT_TEXT_ERROR, 'error' => stripslashes(urldecode($HTTP_GET_VARS['failReason']))); return $error; } And is where the errors (if any) are called on the checkout_payment page <?php if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) { ?> <tr> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice"> <tr class="infoBoxNoticeContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main" style="font-color: blue;"><b><nobr><?php echo tep_output_string_protected($error['title']); ?></nobr></b></td> </tr> I'm looking more into this right now
Recommended Posts
Archived
This topic is now archived and is closed to further replies.