Stripe decline code: testmode_decline
Stripe's wording: "A Stripe test card number was used." A genuine card must be used to make a payment. This means a test card reached live mode — nothing is broken with the card or the issuer.
testmode_declineHard decline
Retrying the same request will fail the same way.
What it means
One of Stripe's published test card numbers, such as 4000 0000 0000 0002, was submitted to a live-mode request. Live mode declines them by design so that test data can never produce a real charge. In practice it almost always means the wrong API key is in play, or a seeded fixture leaked into a production environment.
Common causes
- A live secret key paired with a test card, usually because environments were crossed during a deploy.
- Seed or fixture data containing test PANs running against production.
- A staging environment pointed at live keys.
- A developer testing against production deliberately, which is what the code exists to prevent.
How to fix it
- Check which key the request used. A `sk_live_` key with a test card produces this every time, and the mismatch is the actual defect.
- Keep test and live keys in separate environment configurations, and never fall back from one to the other.
- Strip test PANs out of any fixture data that could run against production.
- Use Stripe's designated test cards in test mode only — that is the environment where their documented decline behaviours work.
Tools that help
Frequently asked questions
- Does this mean my Stripe account is in test mode?
- The opposite. Live mode rejected a test card, so the request was live and the card was not. Look at which API key the request carried — a `sk_live_` key that received a test PAN is the situation this code describes.