Getting the payment details

How to collect payment details from Checkout.com

Problem

Your customer has submitted credit card information to Checkout.com and has already authenticated through 3DS upon the authorization process. You now need to collect the details of the authorization which are used to update the payment.

Solution

To fetch the details of the payment, send a PATCH request to the /api/checkout_com_payments/:id endpoint, setting the _details attribute to true and passing the session_id parameter you've got from the 3DS page. You can check the output of the authorization in the payment_response attribute of the response.

Example

The following request updates the Checkout.com payment source identified by the "emdEKhoOMA" ID to get the authorization details from Checkout.com:

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"
    }
  }
}'

More to read

See our documentation if you need more information on how to update a Checkout.com payment. See our Checkout guide for more details on how to place an order.

Placing the order

Last updated