Sandbox

Test cards

Card numbers that succeed, decline, ask for 3-D Secure or answer late on the simulated payment page of test mode.

Open as Markdown

In test mode, the card payment page is a simulation marked TEST. It takes the numbers below and nothing else: any other number is refused with "use a test card", and is never stored. A real card never works in test mode.

Type a number on the page, or tap it in the page's list. If the page asks for an expiry date or a security code, use any future date and any three digits. To pay without a browser, send the same number to the test helper complete.

The numbers

Card numberExpiryany future dateCVCany 3 digitsScenarioResult
4242 4242 4242 4242Expiry12/34CVC123Success

Succeeds at once.

4000 0000 0000 3220Expiry12/34CVC1233-D Secure

A simulated 3-D Secure page opens. Approve: succeeds. Fail: declined, authentication_failed.

4000 0000 0000 0002Expiry12/34CVC123Declined

Declined, card_declined.

4000 0000 0000 9995Expiry12/34CVC123Insufficient funds

Declined, card_declined with the decline code insufficient_funds.

4000 0000 0000 0069Expiry12/34CVC123Expired card

Declined, expired_card.

4000 0000 0000 0119Expiry12/34CVC123Processing error

Fails, processing_error.

4000 0000 0000 0077Expiry12/34CVC123Slow confirmation

Succeeds after 60 seconds; until then the payment is not confirmed.

4000 0000 0000 0085Expiry12/34CVC123Repeated, out-of-order notifications

Succeeds once, though the confirmation reaches AdProMaxPay several times and out of order.

4000 0000 0000 0093Expiry12/34CVC123Lost confirmation

No confirmation ever arrives: the payment never succeeds, and the attempt expires after about 30 minutes.

After a decline, the payment intent goes back to requires_payment_method, with the reason in last_payment_error, and you receive payment_intent.payment_failed. Your customer can try another card on the same page.

What each scenario teaches

  • Success and Declined: your page for a paid order and your page for a failed one.
  • 3-D Secure: the extra step a bank can ask for. Your code does nothing special; the hosted page handles it.
  • Slow confirmation: your customer is back on your success_url before the payment is confirmed. Show "We are confirming your payment", and deliver on the webhook, not on the return.
  • Repeated notifications: you still receive one payment_intent.succeeded event, though a webhook delivery itself may come twice: see deduplication.
  • Lost confirmation: a payment can end without money even after your customer went through the payment page. Never deliver before succeeded.

The whole picture of statuses is in How payments work. What else differs from live mode is in Sandbox and live: the differences.