Query available rewards for the Masterpass REST card
Submits the Masterpass card alias to the gateway and retrieves the list of available rewards. The returned reward list is stored in pre_order.rewards and used by the subsequent MasterpassRestRewardSelectionPage.
This is an independent page — submitting it does not advance the main checkout flow.
Required Fields:
card_alias: Alias of the Masterpass card the user wants to query rewards for. The alias is the value the Masterpass JS SDK uses to identify a stored card.
Processing:
pre_order.rewardsandpre_order.selected_rewardsare reset tonull.The Masterpass POS gateway is resolved through
pre_order.get_pos_using_slug(). If no POS is found, the page is a no-op andrewardsremainsnull.When
enable_rewardsistrueand the gateway reportshas_rewards(),gateway.query_rewards(...)is called with the current pre-order currency, the user, and the validated input data.The returned reward list is stored in
pre_order.rewards.
Next Pages:
MasterpassRestRewardSelectionPage
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>)
Alias of the Masterpass stored card to query rewards for. The alias
is the value the Masterpass JS SDK uses to identify a card. The
value is forwarded to gateway.query_rewards(...).
MP-CARD-ALIAS-001Rewards retrieved or empty list returned
POST /orders/checkout/?page=MasterpassRestRewardListPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 34
"card_alias='MP-CARD-ALIAS-001'"Rewards retrieved or empty list returned
{
"context_list": [
{
"page_name": "MasterpassRestRewardSelectionPage",
"page_slug": "masterpassrestrewardselectionpage",
"page_context": {
"rewards": [
{
"amount": "50.00",
"type": "general"
},
{
"amount": "30.00",
"type": "special"
}
]
}
}
],
"pre_order": {
"payment_option": {
"pk": 7,
"slug": "masterpass-rest",
"payment_type": "masterpass_rest"
},
"rewards": [
{
"amount": "50.00",
"type": "general"
},
{
"amount": "30.00",
"type": "special"
}
]
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

