Process Redirection Payment Callback
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:
Merges GET query parameters from the callback redirect URL into the submitted data
Selects the gateway-specific input schema based on the active payment provider. TeqPay note: the gateway submits fields as
TokenandResult(capitalised); these are normalised totokenandresultbefore validationValidates callback fields (transaction ID, hash, status codes). Extension gateway note:
installment_countandinterest_feevalues from the callback are stored on the pre-order underinstallment_alt(installment_count+installment_interest_amount) for downstream order and interest calculationRecords a return transaction entry with the payment outcome
On success: finalises the order, submits the basket, sends order confirmation email and SMS notifications
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 (nquery parameter) to support isolated pre-order session recovery on return from the payment provider.
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>)
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.
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.
Redirect to basket (empty basket) or login (guest purchase not allowed)
POST /orders/checkout/?page=RedirectionPageCompletePage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 16
"success=true"{
"context_list": [
{
"page_name": "ThankYouPage",
"page_slug": "thankyoupage",
"page_context": {
"order_number": "ORD-20240101-00001",
"redirect_url": "",
"new_user": false
}
}
],
"pre_order": {
"number": "ORD-20240101-00001",
"total_amount": "150.00",
"is_guest": false,
"is_post_order": false
},
"errors": null,
"template_name": ""
}Last updated
Was this helpful?

