Process checkout provider payment notification and create the order
Receives the payment notification from the checkout provider and creates the order. This endpoint is called as a callback by the provider after the customer completes the payment on the hosted form. It validates the conversation ID, resolves or creates the customer account, saves addresses, sets the shipping option, configures installment data, and finalizes the pre-order into a completed order.
Required Fields: agreements, conversation_id, payment_info, transaction, card_info, akifast_user, is_successful
Optional Fields: shipping_address, billing_address
Validation:
agreementsmust betrue(agreement acceptance required)conversation_idmust match the one stored inpre_order.checkout_provider_datais_successfulmust betrue(transaction must have succeeded)transaction.installment_countmust be between 1 and 12transaction.conversation_idmust matchpre_order.checkout_provider_data['conversation_id']
State Updates:
User account is resolved or created via social account login
Shipping and billing addresses are set and saved
pre_order.shipping_optionset fromtransaction.shipping_option_keypre_order.shipping_amountcalculated for the selected optionpre_order.payment_optionset to the first active credit card optionpre_order.pos_altset frompayment_info.payment_system_codepre_order.card_infopopulated with the card BIN numberpre_order.checkout_provider_data['installment_alt']set withinstallment_countandinterest_amountpre_order.checkout_provider_data['checkout_provider_purchase_raw_response']setpre_order.checkout_provider_data['use_three_d_secure']set fromtransaction.is_threedOrder is finalized (pre-order converted to completed order)
Error Handling:
If
is_successfuloragreementsisfalse, a validation error is returned and the order number is reset.
Next Page: CheckoutProviderThankYouPage
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>)
Payment notification payload sent by the checkout provider after the customer completes payment on the hosted form. Used to create the order, set shipping, link the customer account, and finalize the pre-order.
Customer's acceptance of the agreement. Must be true; any other value returns a validation error.
truePossible values: Payment success flag from the provider. Must be true; any other value returns a validation error.
truePossible values: Provider conversation identifier. Must match pre_order.checkout_provider_data['conversation_id'].
conv-abc-123Order created
POST /orders/checkout/?page=CheckoutProviderNotificationPage HTTP/1.1
Host: sandbox.akinon.com
x-requested-with: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 435
"agreements=true&conversation_id='conv-abc-123'&is_successful=true&payment_info={'payment_system_code':'garanti'}&transaction={'installment_count':1,'interest_rate':0,'interest_amount':0,'total_paid_amount':250,'payment_system_raw_response':'{}','shipping_option_key':1,'is_threed':false}&card_info=[{'bin':'454321'}]&akifast_user={'akinon_user_id':'user-id-123','name':'John','surname':'Doe','email':'user@example.com'}"Order created
{
"context_list": [
{
"page_name": "CheckoutProviderThankYouPage",
"page_slug": "checkoutproviderthankyoupage",
"page_context": {
"return_url": "https://shop.example.com/orders/success/abc123/",
"merchant_customer_id": 42,
"merchant_customer_date_joined": "2024-01-15T08:30:00+00:00",
"merchant_customer_akifast_date_joined": "2024-06-01T10:00:00+00:00"
}
}
],
"pre_order": {
"user_email": "user@akinon.com"
},
"errors": {},
"template_name": "orders/checkout.html"
}Last updated
Was this helpful?

