Skip to content

· 11 min read · Nadeera Silva

Payments

Stripe 3D Secure Test Cards: Fix requires_action Payments

The Stripe 3D Secure test cards to use, why PaymentIntents get stuck in requires_action, and how to recover authentication_required off-session charges.

A hand holds a plain teal card beside a smartphone on an off-white linen counter, its blurred screen showing a verification panel with one amber dot, like a 3D Secure check waiting for approval, next to an amber glass of tea and a closed laptop

If you are looking for Stripe 3D Secure test cards, you are probably also staring at a PaymentIntent that never finishes. It sits in requires_action, or an off-session charge fails with authentication_required, and the order is never paid. I see this in web checkouts and Flutter apps that work fine with 4242 4242 4242 4242 and then break as soon as a bank asks for 3D Secure (3DS). This post lists the exact test cards to use, explains why payments get stuck, and shows working Node, Stripe.js and Flutter code to fix it.

Quick answer

requires_action means the customer's bank wants 3D Secure and your client code has not shown the challenge yet. Call stripe.handleNextAction() (web) or Stripe.instance.handleNextAction() (Flutter) after a server-side confirm, or let PaymentSheet and confirmPayment() handle it with a return_url. Test with 4000002760003184 (always asks for 3DS) and 4000002500003155 (asks unless the card was set up for future use), and treat authentication_required on off-session charges as "bring the customer back to confirm".

What this means for your app or business

  • Lost sales you cannot see. A payment stuck in requires_action is not a decline in the customer's eyes, it is a checkout that just hangs. Many people give up and never come back.
  • It matters most in Europe. Strong Customer Authentication (SCA) has been required for card payments in the European Economic Area since 14 September 2019, and Stripe's SCA guide says banks may decline payments that skip it. Issuers in other countries can also ask for 3DS on any payment.
  • Lower fraud risk. Payments that pass 3DS usually move fraud dispute liability to the card issuer, so supporting it properly also protects you.
  • The fix is small. In most projects it is a day of work: handle the next action on the client, add two webhook cases and a recovery path for saved cards, then test with the cards below.
  • When to get help. If your Dashboard shows payments "Incomplete" for days, or subscription renewals fail with authentication_required, have a developer review the flow before your next release.

What does requires_action mean in Stripe?

A PaymentIntent moves through statuses: requires_payment_method, requires_confirmation, requires_action, processing, succeeded or canceled. Stripe's docs say that if the payment needs extra steps, "such as authenticating with 3D Secure", the status is requires_action. The next_action field tells the client what to do, for example redirect_to_url or use_stripe_sdk.

Nothing on Stripe's side moves it forward. Your front end has to run the action. After 3DS, the authentication flow docs say a successful check moves the payment to processing and then succeeded, while a failed one sends it back to requires_payment_method, where you can retry with the same PaymentIntent.

Flow of a Stripe PaymentIntent from create to confirm, the requires_action state, the 3DS challenge and the succeeded or requires_payment_method outcomes, plus the off-session authentication_required path
requires_action is a waiting state: your client code has to show the 3DS challenge.

Which Stripe 3D Secure test cards should I use?

These numbers come from the 3D Secure section of Stripe's testing page. Use any future expiry date (for example 12/34) and any 3-digit CVC, with test API keys only.

Card numberBehaviour in test modeWhen to use it
4000002760003184Requires authentication on every transaction, however the card is set upBasic 3DS challenge test for web and mobile
4000002500003155Requires authentication for off-session payments unless set up first; on-session always asksTesting saved cards and subscriptions
4000003800000446Already set up: off-session payments succeed, on-session payments ask for 3DSChecking your off-session success path
4000008260003178Asks for 3DS, then declines with insufficient_fundsError handling after a passed challenge
40000000000032203DS required and succeeds, Ireland-issued (IE)EU customer flow
40000084000016293DS required, then declined with card_declinedShowing a decline after authentication
40000000322000003DS required on all transactions, passes through a frictionless flowMaking sure you do not wait for a challenge that never appears
40000000000030553DS supported but not required by default Radar rulesNormal payments from 3DS-capable cards
4242424242424242Supports 3DS but is not enrolled, so no promptYour happy path only

For server-side tests, Stripe recommends PaymentMethod IDs instead of raw numbers, for example pm_card_authenticationRequired, pm_card_authenticationRequiredOnSetup and pm_card_threeDSecure2Required. For native mobile challenge screens, the same page lists 4000582600000045 (one-time passcode UI) and 4000582600000094 (out-of-band UI).

Why do Stripe payments get stuck in requires_action?

These are the causes I find most often:

  1. The server confirms but the client never acts. You create and confirm the PaymentIntent on the server, return only a "pending" flag, and the client never calls handleNextAction().
  2. Confirming on the server without a `return_url`. The 3DS docs say to pass a return_url when you confirm on the server, so redirect-based authentication can bring the customer back.
  3. Off-session charges on cards that were never set up. With off_session: true, the customer is not there to authenticate. If the bank still asks, the request fails with HTTP 402 and the decline code `authentication_required`, and the PaymentIntent goes back to requires_payment_method. Saving the card with setup_future_usage: 'off_session' during an on-session payment makes this much less likely.
  4. Webhooks only handle `payment_intent.succeeded`. Nobody notices payment_intent.requires_action or payment_intent.payment_failed, so the customer is never asked to come back.
  5. A missing URL scheme in a Flutter app. Without a matching returnURL, bank redirects cannot return to the app.

How do I fix requires_action and authentication_required?

Step 1: Server (Node, stripe 23.1.0)

This Express 5 app creates on-session PaymentIntents that save the card for later, charges saved cards off-session, and recovers from authentication_required.

// server.mjs (Node 20+, stripe 23.1.0, express 5)
import express from 'express';
import Stripe from 'stripe';

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
const app = express();

// Webhook route first: it needs the raw body.
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
  let event;
  try {
    event = stripe.webhooks.constructEvent(
      req.body, req.headers['stripe-signature'], process.env.STRIPE_WEBHOOK_SECRET);
  } catch (err) {
    return res.status(400).send(`Webhook Error: ${err.message}`);
  }
  const pi = event.data.object;
  switch (event.type) {
    case 'payment_intent.succeeded':
      markOrder(pi.metadata.orderId, 'paid'); // fulfil here, not on the client
      break;
    case 'payment_intent.requires_action':
      markOrder(pi.metadata.orderId, 'awaiting_3ds'); // do not fulfil yet
      break;
    case 'payment_intent.payment_failed':
      markOrder(pi.metadata.orderId,
        pi.last_payment_error?.code === 'authentication_required' ? 'needs_customer' : 'failed');
      break;
  }
  res.json({ received: true });
});

app.use(express.json());

// On-session checkout: the client confirms and shows 3DS if the bank asks.
app.post('/checkout', async (req, res) => {
  const { customerId, amount, currency, orderId } = req.body;
  const pi = await stripe.paymentIntents.create({
    amount, currency, customer: customerId,
    automatic_payment_methods: { enabled: true },
    setup_future_usage: 'off_session', // authenticate now, charge later
    metadata: { orderId },
  });
  res.json({ clientSecret: pi.client_secret });
});

// Off-session charge with authentication_required recovery.
app.post('/charge-saved', async (req, res) => {
  const { customerId, paymentMethodId, amount, currency, orderId } = req.body;
  try {
    const pi = await stripe.paymentIntents.create({
      amount, currency, customer: customerId, payment_method: paymentMethodId,
      off_session: true, confirm: true, metadata: { orderId },
    });
    return res.json({ status: pi.status });
  } catch (err) {
    if (err.code === 'authentication_required' || err.decline_code === 'authentication_required') {
      markOrder(orderId, 'needs_customer'); // email or push a link back into your app
      return res.status(402).json({
        status: 'requires_authentication',
        clientSecret: err.payment_intent?.client_secret,
        paymentMethodId,
      });
    }
    if (err.type === 'StripeCardError') {
      return res.status(402).json({ status: 'requires_new_card', declineCode: err.decline_code });
    }
    throw err;
  }
});

function markOrder(orderId, state) { /* save to your database */ }

app.listen(4242);

Step 2: Web client (Stripe.js)

If your server confirmed and got requires_action, call handleNextAction. To recover an off-session failure, confirm the same PaymentIntent on-session with the saved card, as Stripe's save-and-reuse guide describes.

// recover.ts (@stripe/stripe-js 10.3.0)
import { loadStripe } from '@stripe/stripe-js';

const stripePromise = loadStripe('pk_test_...');

export async function finishServerConfirmedPayment(clientSecret: string) {
  const stripe = await stripePromise;
  if (!stripe) throw new Error('Stripe.js failed to load');
  const { error, paymentIntent } = await stripe.handleNextAction({ clientSecret });
  if (error) return `failed: ${error.message}`;
  return paymentIntent?.status ?? 'unknown'; // still wait for the webhook
}

export async function recoverOffSessionPayment(clientSecret: string, paymentMethodId: string) {
  const stripe = await stripePromise;
  if (!stripe) throw new Error('Stripe.js failed to load');
  const { error, paymentIntent } = await stripe.confirmPayment({
    clientSecret,
    confirmParams: { payment_method: paymentMethodId, return_url: 'https://example.com/orders/complete' },
    redirect: 'if_required',
  });
  if (error) return `failed: ${error.message}`; // ask for another card
  return paymentIntent.status;
}

Step 3: Flutter (flutter_stripe 15.0.0)

PaymentSheet shows the 3DS screen for you. The two other functions cover a server-side confirm and the off-session recovery.

// lib/stripe_payments.dart (flutter_stripe 15.0.0)
import 'package:flutter_stripe/flutter_stripe.dart';

const returnUrl = 'myapp://stripe-redirect'; // must match your URL scheme

Future<String> payWithPaymentSheet({
  required String clientSecret,
  required String customerId,
  required String ephemeralKey,
}) async {
  await Stripe.instance.initPaymentSheet(
    paymentSheetParameters: SetupPaymentSheetParameters(
      merchantDisplayName: 'My Shop',
      paymentIntentClientSecret: clientSecret,
      customerId: customerId,
      customerEphemeralKeySecret: ephemeralKey,
      returnURL: returnUrl,
    ),
  );
  try {
    await Stripe.instance.presentPaymentSheet();
    return 'submitted'; // fulfil after payment_intent.succeeded
  } on StripeException catch (e) {
    if (e.error.code == FailureCode.Canceled) return 'canceled';
    return 'failed: ${e.error.localizedMessage ?? e.error.message}';
  }
}

Future<String> finishServerConfirmed(String clientSecret) async {
  try {
    final pi = await Stripe.instance.handleNextAction(clientSecret, returnURL: returnUrl);
    return pi.status.name;
  } on StripeException catch (e) {
    return 'failed: ${e.error.localizedMessage ?? e.error.message}';
  }
}

Future<String> recoverOffSession(String clientSecret, String paymentMethodId) async {
  try {
    final pi = await Stripe.instance.confirmPayment(
      paymentIntentClientSecret: clientSecret,
      data: PaymentMethodParams.cardFromMethodId(
        paymentMethodData: PaymentMethodDataCardFromMethod(paymentMethodId: paymentMethodId),
      ),
    );
    return pi.status.name;
  } on StripeException catch (e) {
    return 'failed: ${e.error.localizedMessage ?? e.error.message}';
  }
}

How do I verify the fix?

  1. Web checkout: pay with 4000002760003184. You should see the test authentication page; approve it and the PaymentIntent should reach succeeded. Fail it and it should return to requires_payment_method.
  2. Saved card: save 4000002500003155 with an on-session payment, then charge it off-session. It should succeed. Charge pm_card_authenticationRequired off-session and your endpoint should return requires_authentication.
  3. Webhooks: run stripe listen --forward-to localhost:4242/webhook, then stripe trigger payment_intent.requires_action and stripe trigger payment_intent.payment_failed. Both fixtures exist in the Stripe CLI repo. If signature checks fail, see my post on Stripe webhook signature verification failed.
  4. Dashboard: open the payment and check the events timeline for the 3DS attempt and its result.

I tested the Node server on Node 24.22.1 against a local mock of the Stripe API: checkout, off-session success, authentication_required recovery, a generic decline, and three signed webhook events all behaved as expected. The TypeScript passed tsc --strict and the Dart passed flutter analyze with flutter_stripe 15.0.0.

How do I prevent it from happening again?

  • Return the PaymentIntent status and client secret to the client after every server-side confirm.
  • Call handleNextAction whenever the status is requires_action.
  • Pass a return_url on every confirm, and register a URL scheme in mobile apps.
  • Save cards with setup_future_usage: 'off_session' or a SetupIntent during an on-session payment.
  • Catch authentication_required on every off-session charge and send the customer a link back.
  • Handle payment_intent.requires_action and payment_intent.payment_failed webhooks, not only succeeded.
  • Fulfil orders from webhooks, never from the client result.
  • Add the 3DS test cards above to your release checklist.

Summary

ProblemCauseFix
PaymentIntent stuck in requires_actionClient never ran the next actionhandleNextAction (web or Flutter) or PaymentSheet
Bank redirect never comes backNo return_url or app URL schemePass return_url on confirm, set returnURL in Flutter
Off-session charge fails with authentication_requiredCard not set up, or bank wants fresh 3DSBring the customer back and confirm on-session
3DS never appears in testsUsing 4242 or the DashboardUse the 3DS test cards through your own checkout
Orders marked paid too earlyFulfilling from the clientFulfil on payment_intent.succeeded

Frequently asked questions

What is the Stripe 3D Secure test card number?

Use 4000002760003184 to require 3D Secure on every payment, or 4000002500003155 to require it unless the card was set up for future payments. Use any future expiry date and any 3-digit CVC with your test API keys.

Why is my Stripe PaymentIntent stuck in requires_action?

The customer's bank asked for 3D Secure and your client code has not shown the challenge. Call handleNextAction with the client secret, or confirm with PaymentSheet or confirmPayment so Stripe shows the challenge for you.

What does authentication_required mean in Stripe?

It is a decline code that means the bank wants the customer to authenticate, usually with 3D Secure. For off-session charges, bring the customer back to your app or site and confirm the same PaymentIntent on-session.

Why does 3D Secure not appear when I test in the Stripe Dashboard?

Stripe's testing docs say 3D Secure redirects do not happen for payments created directly in the Dashboard. Test through your own checkout or an API call, and use the cards from the 3D Secure section of the testing page.

Does 3D Secure apply outside Europe, for example in Sri Lanka or India?

Strong Customer Authentication is a European rule, but 3D Secure depends on the cardholder's bank and on Radar rules, so cards from any country can trigger it. Stripe does not list Sri Lanka as a supported business country, so Sri Lankan developers usually build on a client's Stripe account.

How do I test 3D Secure in Flutter with flutter_stripe?

Present PaymentSheet with a test PaymentIntent and enter 4000002760003184, or 4000582600000045 to see the one-time passcode challenge screen. Set returnURL to your app's URL scheme so bank redirects can return to the app.

Can I turn off 3D Secure in Stripe?

No. Stripe's docs say you cannot turn off 3D Secure through the API, and its mandatory authentication rules run regardless. request_three_d_secure only lets you ask for more authentication.

Sources

  1. Testing: Test 3D Secure authentication (Stripe Docs)
  2. How Payment Intents and Setup Intents work (Stripe Docs)
  3. Authenticate with 3D Secure (Stripe Docs)
  4. Save a customer's payment method without making a payment (Stripe Docs)
  5. Stripe decline codes (Stripe Docs)
  6. Strong Customer Authentication readiness (Stripe Docs)
  7. Stripe.js reference: handleNextAction (Stripe Docs)
  8. stripe-node changelog (23.1.0, API 2026-10-28.endive) (Stripe on GitHub, 2026-10-29)
  9. flutter_stripe 15.0.0 (pub.dev, 2026-11-13)
  10. flutter_stripe CHANGELOG (flutter-stripe on GitHub)
  11. Stripe CLI trigger fixtures (Stripe on GitHub)
  12. Stripe global availability (Stripe)
SharePost on XLinkedIn

Comments

Share a question or note about this article.

Loading comments…

Stripe 3D Secure Test Cards: Test and Fix requires_action | Nadeera Silva