For the complete documentation index, see llms.txt. This page is also available as Markdown.

Wallet & Redirection Payments

Checkout Wallet & Redirection Payments

Integrate digital wallet payments and external payment provider redirects into your checkout.

Wallet payments let customers pay using a pre-funded account balance. The flow covers wallet selection, payment initiation, redirect-based completion, and a return callback page.

Redirection payments redirect the customer to an external payment provider. On return, the result is processed via a callback URL.

Confirmation Payment Complete is the final step of the deferred confirmation payment flow initiated in the alternative payments section.

Authentication

These endpoints support both authenticated and anonymous sessions.

  • Authenticated users: Session cookie (sessionid) tracks checkout progress.

  • Anonymous users: Guest checkout is available when the CAN_GUEST_PURCHASE setting is enabled.

Request Format

Include the following header in all checkout requests:

  • x-requested-with: XMLHttpRequest

Dynamic Settings

The following settings are managed at runtime through the admin interface and do not require a server restart.

USE_ONE_TIME_TOKEN

Controls whether a single-use token is appended to redirect callback URLs to prevent replay attacks. When enabled, the token is validated on return before the payment result is processed.

Static Settings

The following settings are configured in the server environment and require a restart to take effect.

ORDERS_USE_ISOLATED_PRE_ORDER_ON_RETURN

When enabled, an encoded order number is embedded in callback URLs so the correct session can be restored after a redirect, even if the browser session has changed (for example, in mobile app redirect flows).

Get Wallet Selection Page context

get

Returns the payment data required to initialise the digital wallet flow (Apple Pay, Google Pay, or Cybersource UC). The active wallet method is determined by the payment gateway and stored in the checkout session.

Preconditions:

  • Basket must not be empty.

  • The selected payment option must be of wallet type.

Page Context:

  • paymentData: Payment initialisation data provided by the gateway (supportedMethods, data, detail).

  • paymentMethod: Identifies the active wallet provider (apple_pay, google_pay, or cybersource_uc).

Step Completion: This page is considered already completed when agreement_confirmed is stored in the checkout session.

available_for_post_order: true

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Responses
200

Wallet selection page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=WalletSelectionPage
200

Wallet selection page context retrieved

Confirm wallet agreement and initialise payment session

post

Accepts the terms and conditions agreement and, for Apple Pay, performs the merchant validation step. For all other wallet providers only agreement is required. For Apple Pay the validationURL returned by the browser's Payment Request API must also be supplied so the server can validate the merchant session with Apple.

Required Fields:

  • agreement: Must be true.

  • validationURL (Apple Pay only): Validation URL from the browser Payment Request API.

Session Initialisation: After agreement is confirmed, the server calls the gateway's start_session(). If the gateway's payment strategy reports session_required=False, this call is skipped entirely and the flow proceeds directly to WalletPaymentPage without storing context_data in the session. Otherwise, if the session response contains data, it is stored in pre_order.data['context_data'] and later surfaced as the context_data field in WalletPaymentPage context (Apple Pay only).

Backward Navigation:

  • Removes agreement_confirmed from the session on backward navigation.

Next Page:

  • WalletPaymentPage

available_for_post_order: true

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Body
or
Responses
200

Wallet agreement confirmed — routes to WalletPaymentPage

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=WalletSelectionPage
200

Wallet agreement confirmed — routes to WalletPaymentPage

Get Wallet Payment Page context

get

Returns any supplementary payment context required by the wallet gateway after the agreement step. For Apple Pay this includes the session context_data from the gateway; for all other wallet methods the context is an empty object.

Preconditions:

  • Basket must not be empty.

  • The selected payment option must be of wallet type.

  • Agreement must have been confirmed (agreement_confirmed in session).

Page Context:

  • Apple Pay (WalletPaymentPageContext): context_data — gateway session data required by the browser Payment Sheet.

  • All other wallet providers: empty object {}.

Step Completion: This page is considered already completed when payment_started is stored in the checkout session.

available_for_post_order: true

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Responses
200

Wallet payment page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=WalletPaymentPage
200

Wallet payment page context retrieved

Submit wallet payment token and execute payment

post

Submits the payment token obtained from the wallet provider and starts the payment transaction. The required fields vary by wallet method:

  • Apple Pay: payment_token (required, JSON) plus optional device_info, merchant_defined_info, and merchant_defined_secure_info.

  • Google Pay: payment_token (required, JSON).

  • Cybersource UC: payment_token (required, string) plus optional browser fingerprint fields (browser_java_enabled, browser_language, browser_color_depth, browser_screen_height, browser_screen_width, browser_time_zone). browser_header and browser_user_agent are populated automatically from request headers.

  • Other wallet providers: No input required (null serializer).

Backward Navigation:

  • Removes payment_started, context_extras, token, redirection_started, redirect_url, remote_redirect_url, and html_content from the session.

Next Page:

  • WalletRedirectCompletePage — when the gateway requires a browser redirect.

  • WalletCompletePage — for direct (non-redirect) wallet flows.

Dynamic Settings Used:

  • USE_ONE_TIME_TOKEN: When enabled, a one-time token is appended to the redirect callback URLs to prevent session replay.

  • ORDERS_USE_ISOLATED_PRE_ORDER_ON_RETURN (static): When enabled, the encoded order number is appended to the redirect callback URLs for isolated pre-order recovery.

available_for_post_order: true

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Body
or
or
Responses
200

Payment token accepted — routes to next page

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=WalletPaymentPage
200

Payment token accepted — routes to next page

Get Wallet Complete Page context

get

Terminal step for direct (non-redirect) wallet payment flows. Returns an empty context; all relevant data was collected in previous steps. Used when the wallet gateway completes payment without a browser redirect.

Preconditions:

  • Basket must not be empty.

  • The selected payment option must be of wallet type.

  • Payment must have been started (payment_started in session).

Page Context:

  • Empty object {}. No additional data is needed.

Step Completion: This page is considered already completed when the order has been finalised.

available_for_post_order: true

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Responses
200

Wallet complete page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=WalletCompletePage
200

Wallet complete page context retrieved

Finalise wallet payment order

post

Finalises the wallet payment. For the checkout_flow gateway, the oid parameter (Checkout.com payment ID) must be supplied and success must be true. For all other gateways no input is required.

Required Fields (checkout.com gateway only):

  • success: Must be true.

  • oid: Checkout.com payment identifier.

  • cko_payment_id (optional): Checkout.com payment reference.

Next Page:

  • ThankYouPage

available_for_post_order: true

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Body

Input for WalletCompletePage. Required only when the active payment gateway is checkout_flow (Checkout.com); for all other wallet gateways the page accepts an empty submission.

successboolean · enumOptional

Must be true for checkout.com gateway. Indicates the payment was authorised on the provider side.

Possible values:
oidstring · max: 64Optional

Checkout.com payment identifier. Required for the checkout_flow gateway.

Example: pay_abc123def456
cko_payment_idstringOptional

Optional Checkout.com payment reference returned by the provider.

Example: pay_abc123def456
Responses
200

Wallet order finalised — routes to ThankYouPage

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=WalletCompletePage
200

Wallet order finalised — routes to ThankYouPage

Get Wallet Redirect Complete Page context

get

Returns the redirect URL to which the browser should navigate for wallet gateways that require an external redirect (e.g., a 3-D-Secure challenge or a hosted payment page). After the redirect the provider calls back to the checkout URL with ?page=WalletRedirectCompletePage&success=true/false.

Preconditions:

  • Basket must not be empty.

  • The selected payment option must be of wallet type.

  • A redirection must have been initiated (redirection_started in session).

Page Context:

  • redirect_url: The external URL the browser should navigate to.

Step Completion: This page is considered already completed when the order has been finalised.

Dynamic Settings Used:

  • USE_ONE_TIME_TOKEN: One-time token appended to callback URLs; validated on return to prevent session replay.

  • ORDERS_USE_ISOLATED_PRE_ORDER_ON_RETURN (static): Encoded order number appended to callback URLs; used to restore the pre-order on return when the browser session may have changed.

available_for_post_order: true

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Responses
200

Wallet redirect complete page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=WalletRedirectCompletePage
200

Wallet redirect complete page context retrieved

Process wallet payment provider callback

post

Called when the payment provider redirects back after the external payment step. The success parameter must be true for the order to be finalised; a false value causes the flow to roll back to WalletPaymentPage. Query parameters from the provider callback (success, gateway-specific fields) are merged into the request data automatically.

Input Serializer: The fields accepted by this endpoint are determined by the active payment gateway. Each gateway may expose a custom completed_serializer attribute. If none is defined, the default SuccessRequiredInputSerializer is used, which requires success=true. Gateway-specific serializers may accept additional fields (e.g., provider-generated tokens or transaction references).

Required Fields (default / SuccessRequiredInputSerializer):

  • success: Must be true. Submitting false triggers a validation error and rolls the flow back to WalletPaymentPage.

Backward Navigation (on failure):

  • Removes agreement_confirmed, payment_started, redirect_url, redirection_started, and html_content from the session.

  • For isolated pre-order flows, also persists the rolled-back state to the basket-hash pre-order store.

Next Page:

  • ThankYouPage (on success)

  • WalletPaymentPage (on failure / rolled back)

available_for_post_order: true

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Body

Input for WalletRedirectCompletePage. The success flag is required and is supplied by the payment provider as a query parameter in the callback URL. A value of true finalises the order; false rolls the flow back to WalletPaymentPage.

successbooleanRequired

true if the payment provider reports a successful transaction; false if it reports a failure.

Responses
200

Callback processed — routes to next page

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=WalletRedirectCompletePage
200

Callback processed — routes to next page

Get Confirmation Payment Complete Page context

get

Finalizes the confirmation payment and completes the order. This page is reached after the user has confirmed the payment on their device. The page processes the finalization logic inherited from PaymentPageMixin and advances to ThankYouPage on success.

Preconditions:

  • Basket must not be empty

  • A confirmation payment option must be selected (check_confirmation_payment_selected)

  • Order number must be assigned (has_order_number)

  • User must have confirmed the payment (is_payment_confirmed_by_user): user_confirmed = true and token are both set in pre-order data

Skip Conditions:

  • Page is skipped if the order is already finalized

Page Context: (empty)

Next Pages:

  • ThankYouPage

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Responses
200

Confirmation Payment Complete Page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=ConfirmationPaymentCompletePage
200

Confirmation Payment Complete Page context retrieved

Finalize the confirmation payment and complete the order

post

Submits the finalization of the confirmation payment. No input data is required. The page processes the order finalization via PaymentPageMixin and advances to the ThankYouPage.

Required Fields: (none — submitting with an empty body is sufficient)

State Updates:

  • Order is finalized; the pre-order is converted to a completed order.

  • Note: set_defaults is overridden with set_number=False to preserve the already-assigned order number.

Next Pages:

  • ThankYouPage

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Body
objectOptional
Responses
200

Order finalized

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=ConfirmationPaymentCompletePage
200

Order finalized

Get Redirection Payment Selected Page context

get

Returns the context for the Redirection Payment Selected Page.

This page acts as a transition step in the redirection-based payment flow. It is reached after a payment option with payment_type: redirection has been selected on the pre-order. The page itself carries no additional context data; its purpose is to confirm that the preconditions for initiating the redirect are met before the customer proceeds to submit the form.

Preconditions:

  • The basket must not be empty

  • A payment option with payment_type: redirection must be selected on the pre-order

  • No active transaction must exist for the current payment attempt (the transaction slot must be clear so that a fresh transaction can be created on form submission)

Auto-advance:

  • If all three preconditions are met and the redirect has already been initiated (an order number is assigned and the redirection flow has started), the system considers this step complete and automatically advances to RedirectionPageCompletePage without requiring the customer to resubmit.

Navigation:

  • Previous page: PaymentOptionSelectionPage

  • Next page: RedirectionPageCompletePage

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Responses
200

Redirection Payment Selected Page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=RedirectionPaymentSelectedPage

Initiate Redirection Payment

post

Initiates the external payment gateway redirect for the selected redirection-based payment option. After successful submission, the system advances to RedirectionPageCompletePage, where the customer is sent to the payment provider's hosted page.

The customer must accept the terms and conditions (agreement: true) before the redirect can be initiated. Optionally, browser metadata fields may be submitted to support gateway-level installment selection or device fingerprinting.

Preconditions:

  • The basket must not be empty

  • A payment option with payment_type: redirection must be selected on the pre-order

  • No active transaction must exist for the current payment attempt

Processing Flow:

  1. Stores submitted browser metadata (browser_installments, browser_client_type) on the pre-order for use by the payment gateway strategy

  2. Captures the customer's IP address and attaches it to the pre-order

  3. Assigns an order number to the pre-order

  4. Queries available installment options from the payment provider

  5. Constructs success and failure callback URLs pointing to RedirectionPageCompletePage

  6. Appends a single-use session token to both callback URLs to prevent session replay on return (controlled by USE_ONE_TIME_TOKEN)

  7. Optionally embeds an encoded order number in the callback URLs to support isolated session recovery on return from the provider (controlled by ORDERS_USE_ISOLATED_PRE_ORDER_ON_RETURN)

  8. Calls the gateway strategy to start the redirect; the strategy contacts the external payment provider and retrieves the redirect URL

  9. On success: stores the redirect URL, remote redirect URL, inline HTML content (if applicable), transaction identifier, and marks the redirection as started on the pre-order

  10. On failure: rolls back the assigned order number and returns a validation error so the customer may retry

Configuration:

  • USE_ONE_TIME_TOKEN (dynamic setting, default: true): When enabled, a single-use token is appended to both the success and failure callback URLs. The token is validated on return to prevent session replay attacks.

  • ORDERS_USE_ISOLATED_PRE_ORDER_ON_RETURN (static setting, default: false): When enabled, an encoded order number is embedded in the callback URLs (n query parameter) to allow the system to recover the correct pre-order session when the customer returns from the payment provider.

Post-order support:

  • This page is available for post-order flows (available_for_post_order: true), allowing the payment step to be re-initiated on an existing order.

Forward page invalidation:

  • Submitting this page invalidates all subsequent checkout pages (invalidate_forward_pages: true), ensuring that downstream steps (such as RedirectionPageCompletePage) reflect the freshly initiated payment state.

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Body

Submission payload for initiating a redirection-based payment. Accepting the terms and conditions is mandatory. Browser metadata fields are optional and are forwarded to the payment gateway strategy to support installment pre-selection and device fingerprinting at the provider level.

agreementboolean · enumRequired

Customer's acceptance of the terms and conditions. Must be true; any other value prevents the redirect from being initiated.

Possible values:
browser_installmentsstring · max: 64 · nullableOptional

Colon-separated list of installment counts supported by the customer's browser environment (e.g., "1:3:6:9:12"). Each value must be an integer between 0 and 120 inclusive. Forwarded to the payment gateway to pre-select compatible installment options on the provider's hosted page.

browser_client_typestring · max: 64 · nullableOptional

Identifier for the type of client or browser environment initiating the payment (e.g., "web", "mobile"). Forwarded to the payment gateway strategy for device-aware routing or display decisions.

Responses
200

Redirect initiated. On success the system advances to RedirectionPageCompletePage. On failure the order number is rolled back and a validation error is returned so the customer may retry.

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=RedirectionPaymentSelectedPage

Get Redirection Payment Completion Page context

get

Returns the payment gateway redirect URL and iframe display settings for completing a redirection-based payment flow.

This page is reached after the payment provider has accepted the transaction initiation (RedirectionPaymentSelectedPage). It provides the URL of the provider's hosted payment page where the customer authorises the transaction, along with a flag that controls whether that page is rendered inline or as a full redirect.

Preconditions:

  • A redirection-based payment option (payment_type: redirection) must be selected on the pre-order

  • The redirect flow must have been started (the payment provider accepted the transaction start and issued a redirect URL)

  • The pre-order must have an assigned order number

Page Context:

  • redirect_url — The full URL of the payment provider's hosted payment page

  • is_iframe — Whether the provider's page should be embedded in an inline frame rather than navigating away from the checkout

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Responses
200

Redirection payment completion page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=RedirectionPageCompletePage

Process Redirection Payment Callback

post

Processes the callback returned by the external payment gateway after the customer completes or abandons the payment on the provider's hosted page.

The gateway posts its result to this endpoint (or the browser is redirected back to it). Query parameters present on the incoming URL are automatically merged with the POST body before validation, so gateway implementations that return data as redirect query strings are handled transparently.

The specific fields required vary by the active payment gateway. Most gateways include a success indicator; additional fields carry transaction identifiers, hash values, and status codes for server-side verification.

Preconditions:

  • A redirection-based payment option must be selected

  • The redirect flow must have been started

  • The pre-order must have an assigned order number

Processing Flow:

  1. Merges GET query parameters from the callback redirect URL into the submitted data

  2. Selects the gateway-specific input schema based on the active payment provider. TeqPay note: the gateway submits fields as Token and Result (capitalised); these are normalised to token and result before validation

  3. Validates callback fields (transaction ID, hash, status codes). Extension gateway note: installment_count and interest_fee values from the callback are stored on the pre-order under installment_alt (installment_count + installment_interest_amount) for downstream order and interest calculation

  4. Records a return transaction entry with the payment outcome

  5. On success: finalises the order, submits the basket, sends order confirmation email and SMS notifications

  6. On failure: rolls back the redirection state and resets the order number so the customer may retry from the payment selection step

Configuration:

  • USE_ONE_TIME_TOKEN (dynamic setting, default: true): When enabled, a single-use token is appended to both the success and failure callback URLs at transaction start. The token is validated on return to prevent session replay.

  • ORDERS_USE_ISOLATED_PRE_ORDER_ON_RETURN (static setting, default: false): When enabled, an encoded order number is embedded in the callback URLs (n query parameter) to support isolated pre-order session recovery on return from the payment provider.

Header parameters
x-requested-withstring · enumRequired

Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.

Default: XMLHttpRequestPossible values:
CookiestringOptional

Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)

Body

Gateway callback payload posted to this endpoint after the customer completes or abandons the payment on the provider's hosted page. The exact fields required depend on the active payment gateway. The gateway is determined by the POS record associated with the selected payment option. Most providers include a success indicator; additional fields carry transaction identifiers, hash values, and status codes for server-side verification.

or
or
or
or
or
or
or
or
or
or
or
or
or
Responses
200

Payment callback processed. On success the order is finalised and the response advances to ThankYouPage. On failure the redirection state is reset and an error is returned so the customer may retry.

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
post/orders/checkout/?page=RedirectionPageCompletePage

Last updated

Was this helpful?