Checkout.com
What it does
Checkout.com is a payment gateway that you connect to an environment with your own Checkout.com account. Black checks your own credentials with Checkout.com and registers its notification address there, and every payment settles to your own Checkout.com account. Black holds no money and never sees a card number.
Once a connection is active, you can set the payment mode black_charges, and Black charges your customers through it: the first payment, each renewal and each retry settle to your Checkout.com account. Without an active connection, Black refuses black_charges with 409 and the code gateway_not_connected. See Connect a payment gateway.
Before you start
You need a Checkout.com account with a test side and a live side, and from each side:
- A secret key. It needs permission to register notifications, and Black refuses a key that lacks a permission it uses, as the errors below say.
- The prefix of your own address at Checkout.com. It is the first eight characters of the client ID of that side, without
cli_. The test side and the live side have different client IDs, so their prefixes differ. - The processing channel, a value that starts with
pc_, which names the channel that processes your payments. - The public key, which your page uses to collect a card in Checkout.com's own fields.
- For renewals of mada cards with the customer absent, mada version 2 enabled on your account. Ask your Checkout.com account manager to enable it.
You also need an access token for the environment and the gateways.manage permission, or a vendor that connects for you. See Authentication.
Never put the secret key in a browser or a mobile app. Only the public key belongs in your page.
Connect it
-
Choose the environment. A test environment takes the keys of the Checkout.com test side, and a live environment the keys of the live side. Black sends a test environment's calls to
{prefix}.api.sandbox.checkout.comand a live environment's to{prefix}.api.checkout.com. -
Send a
POSTrequest to/v1/gateway-connectionswithgatewayset tocheckout_com, and yoursecret_key,prefix,processing_channelandpublic_key. Black checks the shape of the prefix before it calls Checkout.com. The request in the example below writessk_test_…where your secret key goes:
curl --request POST https://api.black.example/v1/gateway-connections \
--header "Authorization: Bearer PLACEHOLDER_ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"gateway":"checkout_com","secret_key":"sk_test_…","prefix":"abcd1234","processing_channel":"pc_…","public_key":"pk_test_…"}'
-
Read the answer. Black checks your credentials with Checkout.com for the environment's kind before it keeps them. The response holds the connection with
statusactiveand anotification_url, and no part of the secret key. -
Register nothing yourself. Black registers its
notification_urlwith Checkout.com for you, under a signing key it makes. You copy no address and no key.
Black registers these Checkout.com events, so you subscribe to none of them yourself. Each row says what Black does with the notice.
| Checkout.com notice | What Black does |
|---|---|
payment_approved and payment_captured | Settles the payment as paid. Black settles it once, whichever of the two arrives first. |
payment_declined and payment_expired | Settles the payment as declined. |
payment_refunded | Settles the refund as succeeded. |
payment_refund_declined | Settles the refund as failed. |
dispute_received | Opens the dispute. |
dispute_evidence_required | Records the details, among them the time by which you must submit evidence. The dispute keeps its status. |
dispute_evidence_submitted | Records the details. The dispute keeps its status. |
dispute_evidence_acknowledged_by_scheme | Records the details. The dispute keeps its status. |
dispute_won | Moves the dispute to won. |
dispute_lost | Moves the dispute to lost. |
dispute_canceled | Moves the dispute to canceled. |
dispute_expired | Moves the dispute to expired. |
dispute_resolved | Moves the dispute to resolved: the payment was refunded already, and Checkout.com answered the dispute for you. |
dispute_accepted | Moves the dispute to accepted: you accepted the dispute instead of challenging it. It has the same effect on the membership and the flag as lost. |
dispute_arbitration_evidence_submitted | Records the details. The dispute keeps its status. |
dispute_arbitration_sent_to_scheme | Records the details. A dispute that was lost stays lost until the outcome. |
dispute_arbitration_won | Moves the dispute to won. This is the outcome of an arbitration, and it can move a dispute that was settled as lost. |
dispute_arbitration_lost | Moves the dispute to lost. This is the outcome of an arbitration. |
request_for_information_received | Records invoice.payment_information_requested. It opens no dispute: see below. |
A dispute carries the category and the reason code that Checkout.com gives it, and the time by which you must submit evidence, which dispute_evidence_required brings. Black shows the three on the dispute and in its events, and leaves a field empty until Checkout.com names it. A change of the category, the reason code or the date records dispute.updated.
A dispute that is settled keeps its status. The one move between settled states is an arbitration: Checkout.com escalates a dispute to arbitration only after you lose it, so dispute_arbitration_won moves lost to won. A notice that comes late, such as dispute_lost after an arbitration you won, never moves a settled dispute back, and Black still records its details. Each change of status records dispute.updated.
A dispute that any first notice opens ends the membership at once and flags the customer, whichever state the notice names: Checkout.com does not promise that dispute_received comes first, so a dispute_resolved or any other dispute notice that names a dispute Black does not hold yet opens it, and a notice that comes late records nothing again.
When the card holder's bank asks for information about a payment before it disputes it, Checkout.com sends request_for_information_received, which Black registers too. It opens no dispute, ends no membership and flags no customer: Black records the event invoice.payment_information_requested, with the category, the reason code and, when Checkout.com names it, the time to answer by, and you answer in your own Checkout.com dashboard. A connection set up before this notice was registered receives it only once it is registered again.
A connection set up before a notice in the table was registered receives it only once it is registered again. Replace the connection's credentials to register it again: see Connect a payment gateway.
Connect a payment gateway explains replacing the credentials and removing the connection, and who may do each.
Configuration reference
| Setting | What it does | Values it accepts | Default |
|---|---|---|---|
gateway | Picks the gateway. | checkout_com | None: required |
secret_key | Authorises Black's calls to Checkout.com. Black keeps it encrypted and never shows it. | Up to 255 characters | None: required |
prefix | Names your own address at Checkout.com. | 1 to 32 lower-case letters and digits. Black refuses another shape as gateway_credentials_invalid before it calls Checkout.com. | None: required |
processing_channel | The channel that processes your payments. | Up to 255 characters | None: required |
public_key | The key your page uses to collect a card. | Up to 255 characters | None: required |
What is supported
Today you can connect, read, replace and remove the connection, and Black registers its notification address with Checkout.com for you.
The connection is built for payments that Black sends as recurring payments of a variable amount, with 3-D Secure when the customer is present, and for the mada rule that a wallet card cannot be charged again with the customer absent. Black does not take a payment through it yet.
Black does not support these with Checkout.com:
- A second connection for an environment.
- Card updates by the card networks.
- Partial captures, authorisation without capture and voids.
- Payouts.
- Submitting dispute evidence through Black: you submit evidence in your own Checkout.com dashboard.
- stc pay, other local methods and bank debits.
- A hosted payment page served by Black.
Test data
A test environment uses your Checkout.com test side, so use Checkout.com's own test cards there. Black does not change them. For a try with no Checkout.com account, use the practice gateway, whose tokens force each outcome.
Events it produces
Connecting produces gateway_connection.created, replacing the credentials produces gateway_connection.updated, and removing the connection produces gateway_connection.disconnected. Black also sets the connection's status to failing when Checkout.com refuses the stored credentials, and to active again when a call succeeds, and sends gateway_connection.updated for each change. See Events.
Going live
-
Create a live environment's connection. Send the same request to the live environment with the secret key, prefix, processing channel and public key of your Checkout.com live side. Black checks them on the live address.
-
Read the response. The connection is
active, with its ownnotification_url. Nothing of the test environment's connection moves to the live one. -
For renewals of mada cards, check that your account manager has enabled mada version 2 on the live side.
Your vendor changes the payment mode; see Connect a payment gateway for what the mode does today.
Limits and troubleshooting
gateway_credentials_invalid(422). Checkout.com refused the credentials, or the prefix has the wrong shape.paramissecret_key. Check the four values against your Checkout.com dashboard, then send the request again.gateway_credentials_wrong_environment(422). The keys belong to the other side of your Checkout.com account, its test side or its live side. Use the test side's keys in a test environment and the live side's in a live one.gateway_credentials_missing_permission(422). Checkout.com accepted the key, but the key lacks a permission that Black uses. Give the key the permission to register notifications and the others your Checkout.com dashboard lists for payments, then connect again.gateway_unavailable(503). Checkout.com did not answer, and Black kept nothing. Send the request again later.payment_at_former_client(409). You asked to refund a payment that went through a former connection or another Checkout.com client than the active one. Black sent nothing and recorded nothing. Refund the payment in the Checkout.com dashboard of that former client, then record the refund withgateway_action, theact_…ID that Checkout.com gives: see Connect a payment gateway.gateway_unavailableon a refund (503). Checkout.com gave no clear answer, so the outcome of the refund is unknown. Send the same request again within 48 hours of the first send: Black sends the same refund, never a second one. While the first send is still under way, a repeat with the same key is answered409with the codeidempotency_request_in_progressfor up to 120 seconds: wait, then send it again. When 48 hours pass with no answer, Black stops sending it and tells you once with the eventinvoice.refund_outcome_unknown, with the reasonkey_window_passed. Check the refund in your Checkout.com dashboard.gateway_already_connected(409). The environment has a connection already. Replace its credentials, or remove it first.