Query available campaigns for the selected credit card
Submits the full card number to the payment gateway and retrieves the list of available campaigns. The returned campaign list is stored in the pre-order state and used by the subsequent CampaignSelectionPage to allow the user to choose a campaign.
Required Fields:
card_number: The full credit card number. Spaces are stripped before validation. Must pass card number format validation.
Validation:
card_numbermust be a valid card number; all spaces are removed before the check is appliedIf the card number is invalid, an error is returned and the user remains on
CampaignListPage
State Update:
On success,
campaignsin the pre-order is populated with the list of campaign objects returned by the payment gateway. If the gateway returns no campaigns,campaignsis set to[](empty array).
Backward Navigation:
When navigating backward from this page,
campaignsis reset tonull, requiring the user to re-submit the card number.
Next Pages:
CampaignSelectionPage
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>)
The full credit card number. Leading, trailing, and internal spaces are stripped before validation is applied. Must be a valid card number.
5400010000000004Campaign list retrieved successfully
POST /orders/checkout/?page=CampaignListPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 34
"card_number='5400010000000004'"Campaign list retrieved successfully
{
"context_list": [
{
"page_name": "CampaignSelectionPage",
"page_slug": "campaignselectionpage",
"page_context": {
"campaigns": [
{
"code": "CAMP001",
"name": "3 Installments Campaign"
},
{
"code": "CAMP002",
"name": "6 Installments Campaign"
}
]
}
}
],
"pre_order": {
"user_email": "user@akinon.com",
"payment_option": {
"pk": 3,
"name": "Credit Card",
"slug": "credit-card",
"payment_type": "credit_card",
"payment_type_label": "Credit Card"
},
"campaigns": [
{
"code": "CAMP001",
"name": "3 Installments Campaign"
},
{
"code": "CAMP002",
"name": "6 Installments Campaign"
}
]
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

