Select Pay on Delivery Payment Choice
Saves the user's selected payment choice for pay-on-delivery.
Required Fields:
payment_choice: Thevaluestring of one of the items returned inpayment_choicesfrom the GET context. Submitting a value not present in that list causes a validation error.
Validation:
Basket amount must be greater than zero
payment_choicemust match one of the valid values returned by the payment option's choices
State Update:
pre_order.payment_choiceis set to the selectedPaymentChoiceobject
Next Pages:
SendSmsPage— when the payment option'ssms_verificationconfiguration istruePayOnDeliveryPage— in all other cases
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 value string of one of the payment choices returned in the
payment_choices list from the GET context of PayOnDeliveryPaymentChoicePage.
Submitting a value not present in that list causes a validation error.
cashPayment choice selected successfully
POST /orders/checkout/?page=PayOnDeliveryPaymentChoicePage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 25
"payment_choice='cash'"Payment choice selected successfully
{
"context_list": [
{
"page_name": "PayOnDeliveryPage",
"page_slug": "payondeliverypage",
"page_context": {}
}
],
"pre_order": {
"basket": {
"pk": 123,
"total_amount": "150.00"
},
"payment_option": {
"pk": 4,
"name": "Pay on Delivery",
"slug": "pay-on-delivery",
"payment_type": "pay_on_delivery",
"payment_type_label": "Pay on Delivery"
},
"payment_choice": {
"value": "cash",
"label": "Cash",
"price": "0.00"
},
"total_amount": "150.00",
"currency_type_label": "TRY"
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

