Get Saved Card Selection Page context
Returns the saved cards available for selection by the current user and active payment gateway. When the active payment gateway provides a hosted card selection interface, the response contains the data required to initialise that interface instead of the card list.
Preconditions:
Basket must not be empty.
The selected payment option must be a saved card type.
Gateway-Specific Page Context:
Standard gateways (
SavedCardSelectionPageContext): Returns acardslist. Each entry includes a display name, masked card number, and a selection token.Iyzico gateway (
IyzicoSavedCardSelectionPageContext): Returns aucsobject instead of a card list. Theucsobject contains the data required to initialise the Iyzico UCS hosted card selection widget: the customer's masked phone number, a UCS session token, the widget script URL, and the script type.
Step Completion: This page is considered already completed when all of the following are true:
Card information has been recorded, and
A card has been selected, and
The selected payment option is of saved card type.
available_for_post_order: false
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>)
Saved card selection page context retrieved
GET /orders/checkout/?page=SavedCardSelectionPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Accept: */*
Saved card selection page context retrieved
{
"context_list": [
{
"page_name": "SavedCardSelectionPage",
"page_slug": "savedcardselectionpage",
"page_context": {
"cards": [
{
"name": "My Visa",
"masked_card_number": "411111******1111",
"token": "card-token-abc123"
}
]
}
}
],
"pre_order": {
"basket": {
"pk": 123,
"total_amount": "150.00"
},
"payment_option": {
"pk": 3,
"name": "Saved Card",
"slug": "saved-card",
"payment_type": "saved_card",
"payment_type_label": "Saved Card"
},
"card_info": null
},
"errors": [],
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

