Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Omnipay MiGS: how to handle users closing the browser after a successful transaction?

Assuming a user completes their transaction successfully after being redirected to Mastercard for payment, but closes the browser before redirecting back to the vpc_ReturnURL supplied to the Omnipay driver, is there a way to handle this automatically?

like image 616
Ryan Avatar asked Jan 08 '18 15:01

Ryan


1 Answers

The unfortunate short answer is that you can't handle it automatically directly via MiGS.

When using the 3-party version (Migs_ThreeParty), you are reliant on the end user coming back and hitting that completePurchase() method. You can set up cron jobs to detect 'abandoned' sales (which may or may not actually be abandoned) to manually reconcile in your Mastercard dashboard, but MiGS doesn't supply an option for a notifyUrl, nor any implementation of the acceptNotification() method for gateway-based notifications similar to PayPal's IPN. Sadly it also doesn't have a simple query URL for "is this transaction done yet" that you could attach to an abandoned-sale-checking cron job.

About the best you can hope for would be to talk to Mastercard and see if you can shorten the redirect time by automatically redirecting, or to have your return URL be a super-fast loading "do not close this window yet" page, which then does your completePurchase loading in the background.

Redirect/3-party gateways have this problem a lot. It is one of the reasons most merchants tend to prefer 2-party gateways (if they can be bothered with the PCI compliance) and has seen the rise of token-based gateways (so they can avoid the PCI compliance burden without the headaches of redirects).

like image 83
Leith Avatar answered Sep 30 '22 05:09

Leith