Testing
Test mode and the fake acquirer's magic cards and amounts.
Test mode is the same API with a dv_test_… key. Charges go to the fake acquirer, which
answers by card number and, when no card travels, by the amount's last three digits. No money
moves and no real card network is reached.
Magic cards and amounts
| Card | Amount ends in | Answer |
|---|---|---|
4242424242424242 | — | Approved (any other valid card too) |
4000000000009995 | 951 | Soft decline issuer_unavailable; fails over to the next channel |
4000000000000002 | 905 | Hard decline do_not_honor |
4000000000003220 | — | 3-D Secure challenge (requires_action) |
4000002500003155 | — | Declined as needing 3-D Secure, retried with a challenge |
4000000000000259 | — | Timeout (processing, 202); later settles as captured |
4000000000000119 | 919 | Acquirer HTTP 5xx: unknown outcome (processing, 202) |
4000000000000069 | 969 | Connection refused: failed, nothing charged |
4000000000006975 | — | Approved after 2 seconds |
Use any future expiry, any holder and a 3-digit cvc (4 for Amex). The amount endings apply to
merchant-initiated charges of stored cards and to captures, refunds and voids: refunding an
amount ending in 905 is declined, for example.
3-D Secure in test mode
4000 0000 0000 3220 answers requires_action with a next_action, and
4000 0025 0000 3155 is declined as needing 3-D Secure, then retried with a challenge. Send the
browser to next_action.url (or pay a checkout session with the card): it lands on the fake
ACS at https://pay.duevance.com/fake-acs/att_…, which stands in for the buyer's bank:
| Button | Answer | The payment |
|---|---|---|
| Approve | cres=Y | succeeded (or authorized with capture: false) |
| Fail authentication | cres=N | declined, decline_code authentication_failed |
From a script, skip the page and post the answer to the return leg yourself:
curl -si -X POST https://pay.duevance.com/3ds/att_0D4m…/return -d cres=Y
The answer is a 303 to your return_url with payment_id (or session_id for a session).
The fake ACS exists only in test mode outside production: in production, test charges use the
acquirer's own sandbox challenge. Saving a card (save_card: true) and the first charge of a
card stored on its own also ask for a challenge; with an approving card, the fake approves them
at once.
The hosted page in test mode
Create a checkout session with a dv_test_… key and open its url: the page shows a "Test
mode" banner and takes the magic cards above. Any future expiry, any name and a 3-digit
security code work.
Unknown outcomes
4000 0000 0000 0259 answers 202 with a processing payment, as a real acquirer that times
out would. Within minutes Duevance asks the fake again and the payment settles as
succeeded, with a payment.succeeded webhook. Use it to test that your integration waits
rather than charging again.
Webhooks in test mode
Test endpoints may use http URLs, but the host must still resolve to a public address. A
tunnel such as https://….ngrok.app works; localhost does not.
Test and live are separate
Keys, payments, cards, sessions, endpoints and idempotency keys of test mode never mix with live
ones. A dv_live_… key charges real cards: never use it in automated tests.