Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Payment declined with a valid test card: how to find and fix it

CNV-207High impactDetectedBy FunnelGuardPublished Updated
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.

Where the purchase breaks
  1. Product pageAdd to cart works
  2. Checkout formDetails entered
  3. Card paymentValid card declined
  4. Order createdNever happens
  5. Purchase trackingNever fires

The decline happens at the payment step, so everything after it is lost.

Orders completed with and without the faultExample numbers
Orders completed with and without the fault (example)Payments working: 40 orders per week; Payments declining: 6 orders per week01531406Payments workingPayments decliningorders per week

Example: illustrative numbers for a store with steady checkout traffic.

How to check if your site has it

Reproduce and diagnose the decline
  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. Try a second card and browser

    Use a different test card in a private window to rule out cached scripts or autofill.

Common causes and what to look for
CauseSignFix
Live mode with a test cardGeneric card declinedSwitch to test mode or use a real card
Mismatched keysInvalid API key error in logsPaste matching test keys
Unsupported currency or countryCurrency or country errorEnable it in the gateway account
Fraud or radar ruleBlocked by rule in logsReview the rule for test traffic
Plugin or theme conflictScript errors in browser consoleDisable conflicting plugins and retest

How to fix it

Fix by platform
  1. Open the gateway settings

    In WooCommerce go to WooCommerce > Settings > Payments and open your gateway (for example Stripe).

  2. Match mode and keys

    Tick the test mode option and paste the test publishable and secret keys. Save.

  3. Rule out conflicts

    Temporarily disable caching and other checkout plugins, then retest.

How to confirm it's fixed

Confirmation checklist
  • 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: test purchase in test mode.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.