Assign Order Number and Decide 3D Secure Routing
Assigns the order number that will be sent to Masterpass and evaluates whether the transaction must be processed under 3D Secure.
Optional Fields:
use_three_d: Boolean flag forwarded to the 3D Secure decision rule (check_three_d_secure). When the rule resolves totrue, the user will be required to complete a 3D Secure challenge before the subsequentMasterpassRestCompletePagestep. Defaults tofalse.
Processing:
The client IP is captured from the request and stored as
pre_order.remote_addr.The order number is generated via
pre_order.set_number().The 3D Secure decision is computed by
check_three_d_secure(...)using the gateway's POS configuration, the user, the basket total, the resolved card, the BIN number, and the submitteduse_three_dflag. If the gateway'smerchant_typeis"custom", the regular pre-order POS is used as the underlying POS and the Masterpass POS is supplied asproxy_pos; otherwise the Masterpass POS is used directly.pre_order.redirect_to_three_dis set to eithertrueorfalseaccordingly.
Backward Navigation:
On backward navigation:
pre_order.remote_addris cleared,pre_order.reset_number()is called, andredirect_to_three_dis reset tonull.
Next Pages:
MasterpassRestCompletePage
Previous Page (computed dynamically):
MasterpassRemoteInstallmentPage— when the payment option'sconfighas aninstallment_slugsetMasterpassRestInstallmentPage— otherwise
available_for_post_order: true
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>)
Hint forwarded to check_three_d_secure(...). When the rule
resolves to true, the user must complete a 3D Secure challenge
before the subsequent MasterpassRestCompletePage step.
falseExample: falseOrder number assigned successfully
POST /orders/checkout/?page=MasterpassRestOrderNoPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 21
"use_three_d=false"Order number assigned successfully
{
"context_list": [
{
"page_name": "MasterpassRestCompletePage",
"page_slug": "masterpassrestcompletepage",
"page_context": {
"msisdn": "905551234567",
"order_no": "ORD-2026-0042",
"three_d": false,
"extras": {
"user_id": "1042",
"bank_ica": null,
"additional_fields": {}
}
}
}
],
"pre_order": {
"payment_option": {
"pk": 7,
"slug": "masterpass-rest",
"payment_type": "masterpass_rest"
},
"number": "ORD-2026-0042",
"remote_addr": "94.235.240.102",
"redirect_to_three_d": false
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

