Test Cards
Use these cards on Spout checkout after initializing with your test_secret_key. The simulator only inspects amount and the last four digits of the PAN— expiry, CVV, and PIN can be any plausible values (examples below). Live processors are never called. See Test Transactions for the end-to-end flow.
Checkout — enter test card
Drop a capture at public/docs/checkout-enter-test-card.png
On the hosted checkout page, paste a test PAN from the tables below to force approve or decline.
Why a screenshot helps: Shows integrators where card fields map to the simulator rules during QA.
How outcomes are decided
| Rule | Result | Webhooks |
|---|---|---|
Amount is 99, 999, or 99.99 | Declined (gateway_response: 99) | charge.processing → charge.failed |
Card PAN ends with 0002 | Declined | charge.processing → charge.failed |
| Any other amount + PAN | Approved (gateway_response: 00) | charge.processing → charge.completed |
If both a fail amount and a fail PAN are used, the charge still declines once. Prefer one clear rule per test case.
Cards that approve (success)
Use any PAN that does not end in 0002, with an initialize amount other than 99 / 999 / 99.99.
| Brand | PAN | Expiry | CVV | PIN | Suggested amount |
|---|---|---|---|---|---|
| Visa | 4084084084084081 | 12/30 (3012) | 408 | 0000 | 1000 |
| Mastercard | 5060666666666666668 | 12/30 | 123 | 0000 | 500 |
| Verve-style | 5060990580000217499 | 12/30 | 111 | 0000 | 250 |
Expected: payment status success / 00, webhook charge.completed, response flag simulated: true, mode: "test".
Cards that decline (failure)
Any PAN whose last four digits are 0002 forces a simulated decline — even with a normal amount.
| Scenario | PAN | Expiry / CVV / PIN | Amount |
|---|---|---|---|
| Decline by PAN | 4084084084080002 | 12/30 · 408 · 0000 | Any (e.g. 1000) |
| Decline by PAN | 5399834400210002 | 12/30 · 123 · 0000 | Any (e.g. 500) |
Expected: gateway_response: "99", webhook charge.failed (if enableForFailed / subscribed).
Decline by amount (any card)
Initialize with one of these amounts and a success card — the charge still declines.
| Amount | Use case |
|---|---|
99 | Quick decline in major units |
999 | Larger decline sample |
99.99 | Decimal / intl-style decline |
Pair with e.g. 4084084084084081 so the only fail signal is the amount.
Recommended QA scenarios
| # | Goal | Setup | Assert |
|---|---|---|---|
| 1 | Happy path | Amount 1000 + PAN …4081 | charge.completed, status 00 |
| 2 | Card declined | Amount 1000 + PAN …0002 | charge.failed, status 99 |
| 3 | Amount declined | Amount 99 + success PAN | charge.failed |
| 4 | Idempotent retry | Same Idempotency-Key on initialize | Same transactionRef / body |
| 5 | Webhook HMAC | Scenario 1 or 2 + test webhook URL | Valid X-Spout-Signature with whsec_test_* |
Checkout field reference
Field names vary slightly by channel UI; the simulator reads PAN from the charge request. Typical shape:
Example card fields
1{
2 "txn_ref": "SP-a1b2c3d4",
3 "pan": "4084084084084081",
4 "expDate": "3012",
5 "cvv": "408",
6 "pin": "0000"
7}expDate— oftenYYMM(e.g.3012= Dec 2030)cvv/pin— not used by the fail/success rules; send valid-looking values for UI validation- Never use these PANs against live secret keys — live mode hits real processors
Checklist
Authorization=test_secret_key- Initialize amount chosen for approve vs decline scenario
- Enter matching test card on checkout
- Confirm webhooks on
testwebhook_urlwithwhsec_test_* - Confirm payment
mode: "test"andsimulated: truein your DB / logs