On this page
What this issue is
Payment gateways publish special test card numbers (for example Stripe's 4242 4242 4242 4242). They only work when the gateway is in test mode. If the card is declined, the checkout is not talking to the gateway the way you think it is.
Why it costs you leads or sales
If a test card fails because of a setup fault, real customers often fail for the same reason. They see a decline, assume their card is the problem, and leave. Checkout is the last step before revenue, so every failed attempt is a lost order.
- Product pageAdd to cart works
- Checkout formDetails entered
- Card paymentValid card declined
- Order createdNever happens
- Purchase trackingNever fires
The decline happens at the payment step, so everything after it is lost.
Example: illustrative numbers for a store with steady checkout traffic.
How to check if your site has it
Confirm the mode
Check that both your store and the gateway dashboard are in test mode. Test cards do not work in live mode, and live cards do not work in test mode.
Use the right test card
Take the card number from your gateway's official test card page. Use any future expiry date, any 3-digit CVC and any postcode unless the docs say otherwise.
Read the decline code
Open the gateway dashboard (for Stripe, Developers > Logs, or Payments) and find the failed attempt. The code, such as invalid_api_key, card_declined or currency_not_supported, tells you the cause.
Check the keys
Make sure the publishable and secret keys come from the same mode and the same account. A test publishable key with a live secret key will fail.
Try a second card and browser
Use a different test card in a private window to rule out cached scripts or autofill.
| Cause | Sign | Fix |
|---|---|---|
| Live mode with a test card | Generic card declined | Switch to test mode or use a real card |
| Mismatched keys | Invalid API key error in logs | Paste matching test keys |
| Unsupported currency or country | Currency or country error | Enable it in the gateway account |
| Fraud or radar rule | Blocked by rule in logs | Review the rule for test traffic |
| Plugin or theme conflict | Script errors in browser console | Disable conflicting plugins and retest |
How to fix it
Open the gateway settings
In WooCommerce go to WooCommerce > Settings > Payments and open your gateway (for example Stripe).
Match mode and keys
Tick the test mode option and paste the test publishable and secret keys. Save.
Rule out conflicts
Temporarily disable caching and other checkout plugins, then retest.
Open payment settings
Go to Settings > Payments and find your provider.
Enable test mode properly
For Shopify Payments, use Manage > Test mode. Shopify Payments test mode only accepts Shopify's documented test cards. The Bogus Gateway works only on development stores.
Check markets and currencies
Make sure the currency and country you are testing are enabled.
Check the server keys
Confirm the secret key in your environment variables is the test key, and the front end uses the matching test publishable key.
Log the API response
Log the gateway error returned on the payment call and fix the cause it names.
How to confirm it's fixed
- A test card completes payment in test mode
- The order appears in the store admin and the gateway test dashboard
- The confirmation email arrives
- The purchase event fires in your analytics
- Live mode is restored with live keys when testing is done
How to prevent it happening again
Keep a short note of which keys belong to which mode, and re-test after every key rotation, plugin update or gateway change. Run a test purchase on a schedule so you learn about a break from an alert, not from a customer.
How FunnelGuard handles this
FunnelGuard detects this today. It runs a test purchase in test mode on a schedule, using the store's test mode setup, and stops before payment unless that test mode is configured. If the payment step fails, it re-checks from a second region and then sends one alert with a screenshot and a likely cause. The Free plan covers 1 site and 2 journeys with daily checks, and paid plans have a 3-day free trial.
Questions people ask
Why is my Stripe test card being declined?
Most often the store is in live mode or the keys do not match. Test cards only work in test mode with test keys from the same account. Check the decline code in the Stripe dashboard logs for the exact reason.
Why does my test card work in the dashboard but not at checkout?
The checkout probably uses different keys or a different mode than the one you tested in. Confirm the plugin or theme holds the test publishable and secret keys. Clear caches and retest in a private window.
Can I use a real card to test my checkout?
It is better not to. Use the gateway's test cards in test mode, which move no money. Real card tests risk charges, refunds and fraud flags.
Does a declined test card mean real customers are declined too?
Not always, but often the cause is shared, such as bad keys, unsupported currency or a blocking rule. Always check a live-mode payment path separately once test mode works.
How do I find out why a payment was declined?
Open the failed payment in your gateway dashboard and read the decline or error code. It usually names the cause, such as an invalid key, an unsupported currency or a fraud rule.
Why does the Shopify Bogus Gateway decline my card?
The Bogus Gateway only works on development stores and with its own documented test numbers. Live stores cannot use it. Use Shopify Payments test mode instead.
How can I monitor checkout payments automatically?
A synthetic monitor can run a test purchase in test mode on a schedule and alert you if payment fails. FunnelGuard does this and sends one alert with a screenshot and likely cause.
Related issues
- CNV-205Payment gateway in test mode on live siteFix guide
- CNV-206Payment gateway keys expired, all payments declinedFix guide
- CNV-2083-D Secure challenge never completesFix guide
- CNV-209Payment succeeds but order not createdFix guide
- CNV-210Order created but payment fails silentlyFix guide
- CNV-211Currency at gateway differs from storeFix guide