Introducing our brand new Rules Engine —
Read the docs
LogoLogo
Core APIOther APIsChangelog
How-tos
How-tos
  • Introduction
  • Product discovery
    • Product listing page
    • Product page
  • Placing orders
    • Shopping cart
      • Creating a shopping cart
      • Adding products to cart
      • Updating cart quantities
      • Removing products from cart
      • Displaying the cart summary
    • Checkout
      • Adding the customer
      • Adding a billing address
      • Adding a shipping address
      • Selecting a shipping method
      • Selecting a payment method
      • Adding a payment source
      • Adding a gift card or coupon
      • Placing the order
    • Subscriptions
      • Configuring a subscription model
      • Selecting the source order
      • Generating the subscriptions
      • Updating the subscriptions
    • Payments
      • Adyen
        • Adding the payment source
        • Sending back the payment details
        • Configuring the notification webhooks
        • Reusing the payment source
      • Axerve
        • Adding the payment source
        • Updating the payment intent
      • Braintree
        • Adding the payment source
        • Sending back the payment method nonce
        • Accepting local payments
        • Reusing the payment source
      • Checkout.com
        • Adding the payment source
        • Getting the payment details
        • Refreshing pending transactions
        • Reusing the payment source
      • Klarna
        • Adding the payment source
        • Sending back the authorization token
        • Reusing the payment source
      • PayPal
        • Adding the payment source
        • Preparing the payment for execution
      • Stripe
        • Adding the payment source
        • Refreshing the payment source
        • Reusing the payment source
      • Manual payments
        • Adding a wire transfer payment source
      • External payments
        • Adding the payment source
        • Reusing the payment source
    • Auto-capture
      • Enabling the auto-capture
      • Limiting the auto-capture amount
  • inventory
    • Inventory strategies
      • No split
      • Split shipments
      • Split by line items
      • Ship from first available (or primary)
      • Ship from primary
  • FAQ
    • Environments and initial setup
    • Authentication and access tokens
On this page
  • Problem
  • Solution
  • Example
  • More to read
  1. Placing orders
  2. Payments
  3. Checkout.com

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

On success, the API responds with a 200 OK status code, returning the updated Adyen payment object:

{
  "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

PreviousAdding the payment sourceNextRefreshing pending transactions

Last updated 2 years ago

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

update a Checkout.com payment
Placing the order