Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 38 ยท Payment Concepts and Security

Strong Customer Authentication and 3D Secure

Learn what Strong Customer Authentication is, how 3D Secure challenges work, when exemptions apply, and how requires_action and off-session payments fit into your Stripe integration.

For years, online card payments needed only the number, expiry and CVC, all of which can be stolen together. Strong Customer Authentication (SCA) adds a second proof that the person paying really owns the card. It became law in the European Economic Area and the UK (under the revised Payment Services Directive, PSD2) and similar rules exist elsewhere, such as in India. If you sell to customers in those regions, your integration must handle it. The good news is that Stripe does most of the work, as long as you built your flow to cope with one extra step.

What SCA requires

A payment is "strongly authenticated" when the customer proves two of three factors:

  • Knowledge: something they know (a password, PIN).
  • Possession: something they have (a phone receiving a code, a banking app).
  • Inherence: something they are (fingerprint, face).

Card networks implement this with 3D Secure (3DS), currently version 2. The issuer's bank page or app challenges the customer, typically with a banking-app approval or an SMS code, and sends back a cryptographic proof that the issuer approved. When that proof exists, liability for fraud generally shifts to the issuer: you are protected from some fraud chargebacks.

Frictionless or challenge

3DS 2 sends a lot of data about the purchase and device to the issuer. For low-risk payments the issuer may approve silently (frictionless flow). For risky ones it asks for a challenge. You cannot predict which, so your UI must always be ready for both.

Two paths through 3D Secure

Frictionless Bank approves silently
Challenge Customer confirms in app
1 / 2

Exemptions

Not every payment needs a challenge. Regulations allow exemptions, such as low-value payments (under 30 EUR, with cumulative limits), trusted beneficiaries, low-risk transactions assessed by the acquirer, and recurring payments of a fixed amount once the first one was authenticated. Stripe's Radar and payment logic apply exemptions automatically when it is safe to. If an exempted payment is declined with "authentication required", Stripe prompts you to retry with the customer present, which brings us to the status that signals it.

How it shows up in your code: requires_action

A PaymentIntent moves through statuses. When 3DS is needed the status becomes requires_action and the object carries a next_action describing what to do. Stripe.js handles this in the browser: stripe.confirmPayment(...) opens the bank's challenge in a modal automatically, and once it completes the status becomes succeeded (or requires_payment_method if it failed).

JavaScript
// Real Stripe.js usage (read-only).
const { error, paymentIntent } = await stripe.confirmPayment({
  elements,
  confirmParams: { return_url: "https://example.com/order/complete" },
  redirect: "if_required",
});

if (error) {
  showMessage(error.message);          // card declined or authentication failed
} else if (paymentIntent.status === "succeeded") {
  showSuccess();
}

The important design rule: your page must not assume the payment completes in one call. Build the flow around the status, and let Stripe.js deal with the challenge.

A state machine for authentication

This stand-in models what the PaymentIntent does. It is not Stripe; it demonstrates why you branch on status instead of assuming success.

Node.js Handling requires_action (stand-in)

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.

The same input (needs3ds: true) leads to three different endings. Your UI and your fulfilment code must handle each one.

Off-session payments and SCA

Subscriptions renew while the customer is asleep: this is an off-session payment, with nobody present to approve a challenge. The rule of thumb:

  1. Authenticate the customer on-session when they first save the card or subscribe. Stripe's SetupIntent or the first PaymentIntent does this, with the right setup_future_usage or usage: "off_session" setting.
  2. Later, off-session charges ride on that authentication as "merchant-initiated" and are usually approved.
  3. Occasionally an issuer still demands authentication on a renewal. Stripe then marks the payment as needing action and emails the customer a link to authenticate (hosted invoice page); you also receive a webhook.

You will implement the saved-card half in Customers and Saved Payment Methods and renewal failures in Billing Portal, Retries and Dunning.

Node.js On-session setup, then off-session charge (stand-in)

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.

Testing 3DS

Stripe's test cards simulate each case: one that always requires authentication, one that authenticates and then succeeds, one that fails authentication. You will use the full list in the testing chapter. Test the challenge cancelled path too: a customer who closes the modal ends up with a PaymentIntent that is back in requires_payment_method, and your page must let them try again.

Common mistakes

  • Treating the browser's first response as "paid".
  • Not handling requires_action in server-confirmed flows (you must pass the client secret back so Stripe.js can run the challenge).
  • Building a custom flow without a return_url, so redirect-based methods cannot return.
  • Asking customers to re-enter a card because of an authentication_required decline instead of letting them authenticate.

Next chapter: building real payments, starting with the simplest way: Stripe Checkout.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which pair of factors makes a payment 'strongly authenticated'?

    SCA requires two independent categories: something you know, have or are.
  2. 2. A PaymentIntent has status requires_action. What should the page do?

    requires_action means the customer must complete 3D Secure. Stripe.js handles the modal.
  3. 3. What is a frictionless 3DS flow?

    3DS 2 lets low-risk payments pass with no challenge shown to the customer.
  4. 4. How are subscription renewals usually handled under SCA?

    The customer authenticates once when saving the card; renewals are merchant-initiated, with occasional fallbacks.

Summary

  • SCA (PSD2) requires two of three authentication factors; 3D Secure delivers it.
  • Flows are frictionless or challenged; exemptions apply to low-risk and recurring payments.
  • A PaymentIntent in requires_action needs Stripe.js to run the challenge.
  • Authenticate on-session once; renewals run off-session and may occasionally ask again.
  • Never assume a payment finishes in a single step.

Next: Stripe Checkout