-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Which component is this issue related to?
Checkout
Which Umbraco Commerce version are you using? (Please write the exact version, example: 10.1.0)
16.4.0
Bug summary
The /pay/{token} endpoint returns 400 Bad Request when attempting to re-initialize payment after a checkout session has been canceled, even though a new token is successfully generated.
Specifics
- Umbraco Commerce Version: 16.4.0
- Component: Checkout
- Payment Gateway: Nets Easy OneTime Payment (hosted checkout, Framed mode)
- API Endpoint:
/umbraco/commerce/storefront/api/v1/checkout/{orderId}/
The cancellation is triggered automatically by the DIBS payment gateway when the iframe is unloaded. Token generation always succeeds, but /pay/{token} fails on re-initialization.
Steps to reproduce
- User reaches payment step and payment token is generated via
GET /checkout/{orderId}/token→ Success - Payment iframe loads
GET /checkout/{orderId}/pay/{token}→ Success (payment form displays) - User navigates back to previous step
- Payment gateway automatically calls
/pay/{token}/canceledwhen iframe unloads - User navigates forward to payment step again
- New payment token is generated via
GET /checkout/{orderId}/token→ Success - Payment iframe attempts to load
GET /checkout/{orderId}/pay/{newToken}→400 Bad Request
Expected result / actual result
Expected Behavior
After a checkout session is canceled, we should be able to:
- Generate a new payment token via
/tokenendpoint - Successfully load the payment form via
/pay/{token}endpoint using the new token
Actual Behavior
- First payment initialization works:
GET /checkout/{orderId}/token→200 OK,GET /checkout/{orderId}/pay/{token}→200 OK - After navigation away and return:
GET /checkout/{orderId}/token→200 OK(new token), butGET /checkout/{orderId}/pay/{token}→400 Bad Request
Questions
- Is it expected that
/pay/{token}returns400after a checkout session has been canceled, even with a newly generated token? - Is there a way to reset the checkout session state or clear an existing checkout session programmatically?
- What is the recommended pattern for handling user navigation in multi-step checkout flows with hosted payment?
Dependencies
No response