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

Get Masterpass REST Complete Page context

Returns the context required to drive the final Masterpass REST payment request from the client. The context contains the MSISDN, the order number, the 3D Secure routing flag, and a set of gateway-specific extras that are passed through to the Masterpass JS SDK.

Preconditions:

  • Basket must not be empty

  • Payment option must be Masterpass REST (check_masterpass_selected)

  • Card information must be present (check_card_info_not_empty)

  • An installment must be selected (check_installment_selected)

  • Order number must have been generated (check_order_no_generated)

  • pre_order.redirect_to_three_d must be set (check_redirect_to_three_d_not_none)

Page Context:

  • msisdn: The user's phone number formatted with the country code, obtained from payment_gateway._get_msisdn(...).

  • order_no: The previously assigned pre_order.number.

  • three_d: pre_order.redirect_to_three_dtrue if a 3D Secure challenge is required, otherwise false.

  • extras:

    • user_id: The user's PK as a string. null for guest checkouts.

    • bank_ica: ACQ ICA value when the gateway's merchant_type is "custom" (resolved via payment_gateway.get_pos_config(vpos)). null for non-custom gateways.

    • additional_fields: Free-form dict returned by payment_gateway.get_additional_fields(...). Includes user, billing/shipping addresses, remote address, the total with interest, and reward state.

Step Completion:

  • is_already_done returns true when the order is finalised (pre_order.order_finalized() is true).

available_for_post_order: true

get
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

Masterpass REST complete page context retrieved

application/json
errorsone of · nullableOptional
or
string[]Optional
template_namestringOptional
get/orders/checkout/?page=MasterpassRestCompletePage
GET /orders/checkout/?page=MasterpassRestCompletePage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Accept: */*
200

Masterpass REST complete page context retrieved

{
  "context_list": [
    {
      "page_name": "MasterpassRestCompletePage",
      "page_slug": "masterpassrestcompletepage",
      "page_context": {
        "msisdn": "905551234567",
        "order_no": "ORD-2026-0042",
        "three_d": true,
        "extras": {
          "user_id": "1042",
          "bank_ica": "9999",
          "additional_fields": {}
        }
      }
    }
  ],
  "pre_order": {
    "payment_option": {
      "pk": 7,
      "slug": "masterpass-rest",
      "payment_type": "masterpass_rest"
    },
    "number": "ORD-2026-0042",
    "total_amount": "165.59",
    "currency_type_label": "TRY"
  },
  "errors": [],
  "template_name": "orders/checkout.html"
}

Last updated

Was this helpful?