Zen Cart Logo
Forums / Addon Payment Modules / Sessions and offsite payment modules

Sessions and offsite payment modules

Views: 808

Results 1 to 4 of 4
3 Jun 2012, 11:09 PM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

Sessions and offsite payment modules

I am battling to fix a problem with an offsite-payment module and need some information as to how things are supposed to work.

After Checkout Confirmation, the user gets sent to an offsite payment gateway. If their session expires/times-out before they return, what should happen when they return:
they see the whoops expired notice, or the gateway should be calling checkout_process with their previous zenid appended to the url and it should autologin and process the order/payment?

4 Jun 2012, 8:58 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Sessions and offsite payment modules

Seriously. If the session times out, that's it. Done. Over. It's gone. The previous zenid is expired, as it should. There is no auto-login to an expired session.

Equally, if not more, important is determining why the customer is taking half an hour to make a payment, and sorting out that matter.

4 Jun 2012, 9:23 PM
#3
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

Re: Sessions and offsite payment modules

Thanks, that’s what I thought. It’s just something I was not sure about while I was trying to artificially test the urls being passed about to avoid using the live gateway.

The real crux is this..

  1. When the payment is ok,
    customer hits “Continue” in the gateway,
    this passes the payment transaction id to a file in the shop passing the payment transaction id,
    that redirects to the checkout_process,
    the payment transaction id is checked against the db record of the transaction,
    and the order is recorded via the payment module processes correctly.
    All OK.

  2. If the payment fails in the gateway,
    the customer is presented with "Continue" which takes him (unexpectedly, for most people) back to the payment options screen in the shop, via the usual payment module processes, and is shown an error message.
    Despite the error message saying “don’t go back”, if at this point,
    he presses the browser back button to go back to the gateway,
    and then "continue" again (yes people actually do this),
    he goes forward to the shop, gets order success and it is recorded as a discount coupon.

I think that this is happening because the shop doesn't know which payment module to use at this point/ the session information is not now available.

I am working with another version of this module (for osc) that has code that retrieves the session id (stored during process_button) associated with that payment transaction id and then calls checkout_process with that id appended:
Eg:

https://www.shop.com/index.php?main_page=checkout_process&zenid=5iiljnjd08ejbajhqp3k29XXX

But it doesn’t stop the false payment/order being recorded (assuming I am doing it right…!).

How should this really be handled “correctly” (in general terms….)?

I've spent an embarrassing amount of time figuring out how (almost) all of this works, all very educational of course, but I'm stuck at this point.

5 Jun 2012, 1:48 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Sessions and offsite payment modules

torvista:

I think that this is happening because the shop doesn't know which payment module to use at this point/ the session information is not now available.
Kinda.
If no payment module name is supplied, it defaults to Coupon/GV, because that's the only way to describe an order that doesn't have payment detail associated with it (which would normally only ever happen if an order is free).