Skip to content

3D Secure / SCA

How Cardencer handles 3D Secure 2 and Strong Customer Authentication for EU card payments, with the checkout SDK or the API.

PSD2 requires Strong Customer Authentication (SCA) for most online card payments in the EU. Cardencer handles it with 3D Secure 2 (3DS2): exemptions are applied when eligible, and the customer is asked to authenticate with their bank only when the issuer requires it. 3DS2 is included in your pricing.

With the checkout SDK#

Nothing to build. When a payment needs authentication, the SDK opens the issuer's challenge, then completes the payment or redirects to your return_url. Always pass a return_url when you create or confirm the payment.

Control when 3DS is requested#

Set authentication_type when you create the payment:

Value Behaviour
three_ds Always request 3D Secure. If the issuer grants a frictionless flow, the customer sees nothing.
no_three_ds Do not request 3D Secure. If the issuer insists (soft decline), Cardencer retries with authentication.
curl https://sandbox.cardencer.com/payments \
  -H "api-key: $CARDENCER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 4900,
    "currency": "EUR",
    "authentication_type": "three_ds",
    "return_url": "https://example.com/checkout/complete"
  }'

How the flow works#

  1. The customer submits their card, which confirms the payment.
  2. Cardencer checks whether 3DS is required and contacts the issuer's Access Control Server (ACS).
  3. Depending on the issuer:
    • Not required (exemption or frictionless): the payment continues and ends succeeded.
    • Required: the payment moves to requires_customer_action and the response contains next_action.
  4. The customer completes the challenge (banking app, one-time code) and returns to your return_url.
  5. The payment ends succeeded if authentication passed, or requires_payment_method if it failed. Ask for another card, or confirm again to retry 3DS.

Server-to-server: handle the redirect#

If you confirm from your server, inspect next_action when the status is requires_customer_action:

json
{
  "payment_id": "pay_mbabizu24mvu3mela5njyhpit4",
  "status": "requires_customer_action",
  "next_action": {
    "type": "redirect_to_url",
    "redirect_to_url": "https://sandbox.cardencer.com/payments/redirect/pay_mbabizu24mvu3mela5njyhpit4/merchant_1/pay_mbabizu24mvu3mela5njyhpit4_1"
  }
}

Redirect the customer's browser to next_action.redirect_to_url. After authentication, Cardencer sends them to your return_url with query parameters such as status and payment_intent_client_secret.

const payment = await confirmResponse.json();
if (payment.status === "requires_customer_action" && payment.next_action?.type === "redirect_to_url") {
  return res.redirect(payment.next_action.redirect_to_url);
}

Query parameters on the return_url can be tampered with. Retrieve the payment with your secret key (GET /payments/{payment_id}) before you fulfil the order.

Test it#

Use 4000 0038 0000 0446 in the sandbox: it always triggers a challenge, then succeeds. See Sandbox & test cards.