Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions paygate/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,29 @@ def cancel_url(self):
)
)

@property
def thank_you_url(self):
"""
The destination Thank-You page URL where the user is redirected after the PayGate
redirects him back to the Open edX Ecommerce success callback.

This URL replaces the previous behaviour of synchronously running
`handle_payment_and_create_order` on the success callback, which was failing for
asynchronous payments (MB) because the upstream payment is not yet confirmed
when the user comes back. The Thank-You page is part of the ecommerce
micro-frontend and links to the user's Order History page, where the payment
status is then lazily resolved per order.

Configure it by setting `thank_you_url` on the payment processor configuration,
for example:

thank_you_url: https://lms.example.com/orders/thank-you

When it is not set this returns ``None`` and the success callback falls back to
the previous receipt page behaviour, so existing deployments do not regress.
"""
return self.configuration.get("thank_you_url", None)

def get_transaction_parameters(
self, basket, request=None, use_client_side_checkout=False, **kwargs
): # pylint: disable=unused-argument, too-many-locals
Expand Down
Loading
Loading