Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

checkout_payment.php - payment error not displayed


khime

Recommended Posts

Hello

 

I'm using the protx direct module for accepting card payments and when there is a card error during checkout then the customer gets returned back to the checkout_payment.php page and the error should be displayed at the top.

 

From what I can gather the page grabs the error from the URL and displays it in the box under the page heading.

 

I am getting a strange error where the error box is just blank (see screenshot Error not displayed (live site))

 

This leads to customer confusion if they cant see an error message.

 

I have checked on our test site and the error message appears succesfully (see screenshot Error displayed OK on Test site) and the checkout_payment.php code is the same on both live and test site

 

<?php
if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error()))
{ ?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td>


</tr>

 

Can anybody advise why this is happening and the corrective steps to resolve this

 

Thanks

 

Simon

Link to comment
Share on other sites

I have figured out the problem now, it is in the URL

 

You can see in the non-working version the URL is /checkout_payment.php?payment_error=protx_direct&error=xxxxxx

 

the working URL is: /checkout_payment.php?payment_error=protx_direct&error=xxxxxx

 

so that is why the error doesnt appear as I tried a print_r($HTTP_GET_VARS['error']); and nothing appears but putting payment_error displays "protx_direct"

 

I am looking at the protx module where the error appears and the code is

 

 if (($result == false) || ($result < 1)) {
	$payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error) . '&protx_direct_cc_owner=' . urlencode($HTTP_POST_VARS['protx_direct_cc_owner']) . '&protx_direct_cc_expires_month=' . $HTTP_POST_VARS['protx_direct_cc_expires_month'] . '&protx_direct_cc_expires_year=' . $HTTP_POST_VARS['protx_direct_cc_expires_year'];
	tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
  }

 

Why is the website coverting the "&error" to "&error" ??

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...