Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

2.1 payment module question


cmcnulty

Recommended Posts

Hi, I've developed a payment module for 2.1 (for the Skipjack Service). The problem I'm having is figuring out what to do if I get back a failed authorization code from the cc processor.

 

It seems like the right thing to do is to check the response codes in PM_BEFORE_PROCESS and then re-direct via a header("Location:") call if the payment failed.

 

The problem that I'm encountering is that even though the page does get re-directed properly, all of the stuff that happens in checkout_process.php still happens. (e-mail is still sent, basket is emptied, etc.) Obviously, I don't want a confirmation e-mail sent and the basket to be emptied if their payment failed. I'm not sure why the stuff in that page is happening since I redirected the page.

 

Here is a little snippet of code from the bottom of PM_BEFORE_PROCESS

 

 

$response = SkipJack_Authorize($request);

 

if (!$response['szIsApproved']) {

tep_session_register('response');

header('Location: ' . tep_href_link (FILENAME_CHECKOUT_FAILURE, '',

'SSL'));

}

 

Any suggestions?

 

-Chuck

 

PS. I consider myself a fairly experienced php coder, and an expert in the intracacies of osCommerce 2.1 having custom added coupons, bulk discounts, VIP discounts, etc.

Link to comment
Share on other sites

  • 5 months later...

Archived

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

×
×
  • Create New...