Getting the payment details
How to collect payment details from Checkout.com
Problem
Solution
Example
curl -g -X PATCH \
'http://yourdomain.commercelayer.io/api/checkout_com_payments/emdEKhoOMA' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token' \
-H 'Content-Type: application/vnd.api+json' \
-d '{
"data": {
"type": "checkout_payments",
"id": "emdEKhoOMA",
"attributes": {
"_details": true,
"session_id": "sid_y3oqhf46pyzuxjbcn2giaqnb44"
}
}
}'{
"data": {
"id": "emdEKhoOMA",
"type": "checkout_com_payments",
"links": {
"self": "https://yourdomain.commercelayer.io/api/checkout_com_payments/emdEKhoOMA"
},
"attributes": {
"payment_type": "token",
"token": "tok_ubfj2q76miwundwlk72vxt2i7q",
"session_id": "sid_y3oqhf46pyzuxjbcn2giaqnb44",
"source_id": "src_n5uaa7fr6mwe5nkwmbn244gmhy",
"customer_token": "cus_pb4u3cqvs36e7p4snxukfhxfrq",
"redirect_uri": "https://3ds2-sandbox.ckotech.co/interceptor/3ds_plbzo3odshuevkh3bh4tjocl74",
"payment_response": {
"3ds": {...},
"_links": {...},
"actions": [
{...}
],
"amount": 17,
"approved": true,
"billing_descriptor": {...},
"currency": "GBP",
"customer": {
"id": "cus_6ylx5ay76wou3d4yocniv5qogy"
},
"eci": "05",
"id": "pay_y3oqhf46pyzuxjbcn2giaqnb44",
"payment_type": "Regular",
"reference": "ORD-090857",
"requested_on": "2021-02-15T14:52:39Z",
"risk": {
"flagged": false
},
"scheme_id": "440925750609151",
"source": {...},
"status": "Authorized"
},
"payment_instrument":{...},
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": null,
"reference_origin": null,
"metadata": {}
},
"relationships": {
"order": {
"links": {...}
}
},
"meta": {
"mode": "test"
}
}
}More to read
Placing the orderLast updated