# Test cards

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

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](https://pay-docs.adpromax.com/en/sandbox/test-helpers) `complete`.

## The numbers

- `4242 4242 4242 4242` (Success): Succeeds at once.

- `4000 0000 0000 3220` (3-D Secure): A simulated 3-D Secure page opens. **Approve**: succeeds. **Fail**: declined, `authentication_failed`.

- `4000 0000 0000 0002` (Declined): Declined, `card_declined`.

- `4000 0000 0000 9995` (Insufficient funds): Declined, `card_declined` with the decline code `insufficient_funds`.

- `4000 0000 0000 0069` (Expired card): Declined, `expired_card`.

- `4000 0000 0000 0119` (Processing error): Fails, `processing_error`.

- `4000 0000 0000 0077` (Slow confirmation): Succeeds after **60 seconds**; until then the payment is not confirmed.

- `4000 0000 0000 0085` (Repeated, out-of-order notifications): Succeeds once, though the confirmation reaches AdProMaxPay several times and out of order.

- `4000 0000 0000 0093` (Lost 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](https://pay-docs.adpromax.com/en/webhooks/retries).
* **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](https://pay-docs.adpromax.com/en/payments/how-payments-work). What else
differs from live mode is in [Sandbox and live: the differences](https://pay-docs.adpromax.com/en/sandbox/differences).
