Score:0

Off-site payment gateway success/failure return is caught by a differnt custom module

lc flag

I have created an offsite (redirect form) payment gateway Drupal 8 module for Opayo.co.uk. following drupal commerce documentation.

Issue: My custom off-site payment gateway module based on form redirect works perfectly fine on fresh Drupal 8 Commerce site with default checkout-flow. response from payment provider is received on these ends: /checkout/ORDER-ID/payment/return (on successful payment) /checkout/ORDER-ID/payment/cancel (on failure) -> But on an exisiting D8 commerce booking system (with overridden checkout-flow using a custom module) when user returns from payment providor with a response string there occurs a redirect loop between booking system and payment providers payment form. The response from provider does not reach my module's plugin where onReturn() and onCancel() functions will process the response. Redirect loop occurs on path /checkout/ORDER-ID/payment/ where user clicks finally "Pay and Complete Purchase" button and data is handled by "Payment process" pane.

-> I can find that a custom checkout module creates event subscriber which acts on every page load checks checkout url parameters.

Any help is highly appreciated, and thanks for reading this.

cn flag
If it's an order of execution problem, try [setting the module weight](https://www.drupal.org/docs/7/creating-custom-modules/howtos/how-to-update-a-modules-weight).
lc flag
Thank you for the tip. I have changed the weight in negative number. No luck. I am trying to get Order, and ability to upate payment status through a controller function on custom url implemented through my payment gateway module. Any idea how to access payment in a controller function and update the status to complete? Thanks.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.