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
On this page
  1. The numbers
  2. What each scenario teaches
  3. When your test mode goes through a provider's sandbox

In test mode, the card form is a simulation marked TEST: on the hosted checkout page, or on a page of its own when you confirm a payment through the API. 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.

Five scenarios have two numbers, a Visa one and a Mastercard one, which end the same way. The payment's card then names its network: visa or mastercard.

The numbers

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

Succeeds at once.

5555 5555 5555 4444Expiry12/34CVC123Success

Succeeds at once.

4000 0000 0000 3220Expiry12/34CVC1233-D Secure

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

5205 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.

5205 0000 0000 0002Expiry12/34CVC123Declined

Declined, card_declined.

4000 0000 0000 9995Expiry12/34CVC123Insufficient funds

Declined, card_declined with the decline code insufficient_funds.

5205 0000 0000 9995Expiry12/34CVC123Insufficient funds

Declined, card_declined with the decline code insufficient_funds.

4000 0000 0000 0069Expiry12/34CVC123Expired card

Declined, expired_card.

5205 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.

When your test mode goes through a provider's sandbox

Our team can set your organization's test mode to go through a card provider's own sandbox (Chari Pay's) instead of this simulation. A card payment then answers next_action.type: "redirect_to_url": your customer pays on the provider's sandbox page, with the provider's own sandbox cards, not the numbers above, and the test helper complete does not apply. The payer's name, email and phone are then required, as in live. Nothing paid there is real.