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

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:

  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.

post
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
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?