Payments flow adaptation for lazy payments#27
Open
Tiago-Salles wants to merge 1 commit into
Open
Conversation
This was referenced May 17, 2026
3f44420 to
a4a28d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
When the user clicks Continuar on PayGate, PayGate redirects back to
PayGateCallbackSuccessResponseView. Until now, this view calledhandle_payment_and_create_ordersynchronously, which in turn invokedPayGate.handle_processor_response. That method queries the PayGateBackOfficeSearchTransactionsAPI expecting to find a completed transaction for the basket.For asynchronous payment methods (MB references, MBWAY) the upstream payment is not yet confirmed at this exact moment — the user still has to pay at an ATM / home-banking / phone. PayGate correctly returns an empty list,
handle_processor_responseraises:…and the user is shown the misleading "You have not been charged." page even when, minutes later, PayGate will confirm the payment via the server-to-server callback.
What this PR changes
The success callback no longer attempts to fulfil the order synchronously when a Thank-You URL is configured. Instead, it records the callback response and redirects the user to a Thank-You page in the ecommerce micro-frontend, where the actual payment status is lazily resolved per basket by the new
nau_extensions.BasketPaymentStatusView.PayGatenow exposes a newthank_you_urlproperty that reads the optionalthank_you_urlpayment-processor configuration entry. ReturnsNonewhen not configured.PayGateCallbackSuccessResponseView.get:thank_you_urlis configured → redirects to<thank_you_url>?order_number=<basket.order_number>without callinghandle_payment_and_create_orderand without calling PayGateBackOfficeSearchTransactions;thank_you_urlis not configured → falls back to the previous behaviour (synchronous fulfillment + redirect to the receipt page). This preserves backwards compatibility for any deployment that has not yet rolled out the Thank-You page.Configuration
Add
thank_you_urlto thepaygateentry ofPAYMENT_PROCESSOR_CONFIGto enable the new behaviour. Example:Related PRs
Related to: https://github.com/fccn/nau-technical/issues/767