Skip to content
Tutorials Center
My learning

Topics

Lesson 34 of 38 ยท Compliance and Patterns

Strong Customer Authentication and 3D Secure

Learn what Strong Customer Authentication is, how 3D Secure challenges work, how PaymentIntent statuses like requires_action drive your code, exemptions, and off-session payments.

In many regions, notably the European Economic Area and the United Kingdom, banks must verify that the person paying is the cardholder. The rule is called Strong Customer Authentication (SCA). It requires two of three factors: something you know (a PIN or password), something you have (a phone), something you are (a fingerprint or face). On the web, card payments meet SCA with 3D Secure (3DS), the extra screen or app approval you may have seen when buying online.

You do not implement 3DS yourself. Stripe.js and the Payment Intents API do the heavy lifting. Your job is to build a flow that can pause for authentication and continue afterwards. The sandbox cannot talk to banks, so the state machine below is a labelled model, and real API calls are read-only.

The PaymentIntent states

A PaymentIntent moves through statuses. The ones that matter most:

  • requires_payment_method: waiting for the customer to provide or retry a card.
  • requires_confirmation: ready to confirm (when you confirm on the server).
  • requires_action: the bank wants authentication, so the customer must complete a 3DS challenge.
  • processing: the payment is in flight (common with bank debits).
  • succeeded: money was captured.
  • canceled: you or Stripe cancelled it.
stateDiagram-v2
  [*] --> requires_payment_method
  requires_payment_method --> requires_action: card needs 3DS
  requires_payment_method --> succeeded: card approved
  requires_action --> succeeded: challenge passed
  requires_action --> requires_payment_method: challenge failed
  requires_payment_method --> canceled
  succeeded --> [*]

A challenge can send the intent back for another payment method.

Node.js A PaymentIntent state machine

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Client side: let Stripe.js handle the challenge

With the Payment Element, calling stripe.confirmPayment automatically opens the 3DS dialog when the bank asks for it, then returns the customer to your return_url. The result tells you what to do. Never fulfil the order from the browser result alone; wait for the payment_intent.succeeded webhook.

JavaScript
// Read-only: browser code using Stripe.js
const { error } = await stripe.confirmPayment({
  elements,
  confirmParams: { return_url: 'https://example.com/order/complete' },
});
if (error) {
  // Show error.message; the customer can try another card.
}
Node.js Mapping a status to what the UI should do

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Exemptions and when 3DS is requested

SCA has exemptions: small amounts, trusted merchants, low-risk transactions, merchant-initiated recurring charges. You do not apply them manually. Stripe and the issuer decide using the data you provide, and Radar rules can request 3DS for risky payments. The bank can still ask for authentication even when you hoped for an exemption, so your flow must always handle requires_action.

Cards outside the SCA regions rarely trigger 3DS, but a fraud dispute is easier to win when a payment was 3DS-authenticated, since liability for fraud often moves to the issuer.

Off-session payments: subscriptions and saved cards

When the customer is not present (a monthly renewal), nobody can complete a challenge. The flow is:

  1. During the first payment, with the customer present, save the card for future use using a SetupIntent or setup_future_usage: 'off_session'. 3DS is completed once, and the customer agrees to a mandate.
  2. Later renewals are created as off-session payments, which are usually exempt from a new challenge.
  3. If the bank still demands authentication, the payment fails with authentication_required. You email the customer a link to return to your site and authenticate. Stripe's subscription emails and the hosted invoice page can handle this for you.
Node.js Handling an off-session authentication failure

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Test the challenge with the published test card 4000 0025 0000 3155 in test mode; Stripe shows a fake authentication screen with buttons to pass or fail.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does the status requires_action usually mean?

    The bank requested authentication, so the customer must complete the challenge.
  2. 2. When should you fulfil the order?

    The webhook is the reliable confirmation; the browser result can be missed or faked.
  3. 3. Why is saving the card with a mandate during the first payment useful?

    Authentication is completed once while the customer is present, enabling later merchant-initiated payments.
  4. 4. A renewal fails with authentication_required. What is a sensible response?

    Only the customer can complete the challenge, so bring them back with a link.

Summary

  • SCA requires two-factor verification for many card payments; 3D Secure delivers it.
  • Build around PaymentIntent statuses, especially requires_action.
  • Let Stripe.js run the challenge and fulfil from webhooks.
  • Save cards with a mandate for off-session renewals and handle authentication_required.

Next: Refunds, Tax and Invoices