Initiate Redirection Payment
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: redirectionmust be selected on the pre-orderNo active transaction must exist for the current payment attempt
Processing Flow:
Stores submitted browser metadata (
browser_installments,browser_client_type) on the pre-order for use by the payment gateway strategyCaptures the customer's IP address and attaches it to the pre-order
Assigns an order number to the pre-order
Queries available installment options from the payment provider
Constructs success and failure callback URLs pointing to
RedirectionPageCompletePageAppends a single-use session token to both callback URLs to prevent session replay on return (controlled by
USE_ONE_TIME_TOKEN)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)Calls the gateway strategy to start the redirect; the strategy contacts the external payment provider and retrieves the redirect URL
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
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 (nquery 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 asRedirectionPageCompletePage) reflect the freshly initiated payment state.
Required header for AJAX requests. Must be set to XMLHttpRequest for all checkout requests.
XMLHttpRequestPossible values: Session cookie header (e.g. sessionid=abc123 or osessionid=<session_id>)
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.
Customer's acceptance of the terms and conditions. Must be true; any other value prevents the redirect from being initiated.
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.
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.
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.
Redirect to basket (empty basket) or login (guest purchase not allowed)
POST /orders/checkout/?page=RedirectionPaymentSelectedPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 18
"agreement=true"{
"context_list": [
{
"page_name": "RedirectionPageCompletePage",
"page_slug": "redirectionpagecompletepage",
"page_context": {
"redirect_url": "https://payment.provider.com/pay?token=abc123",
"is_iframe": false
}
}
],
"pre_order": {
"number": "ORD-20240101-00001",
"payment_option": {
"pk": 5,
"name": "Online Payment",
"slug": "online-payment",
"payment_type": "redirection"
},
"total_amount": "150.00",
"is_guest": false,
"is_post_order": false
},
"errors": null,
"template_name": ""
}Last updated
Was this helpful?

