On this page
What this issue is
Every payment gateway gives you two sets of credentials: test (also called sandbox) and live. Test keys talk to a simulator. They accept fake cards such as Stripe's 4242 4242 4242 4242 and never charge anyone.
This issue happens when the test keys stay in place after launch, or when they come back after a migration, a plugin update or a staging-to-live copy. The site looks normal. The checkout works. But the money never arrives.
It is different from a gateway outage (OPS-208) and from live keys sitting on a staging site (OPS-210). Here the live site has the wrong keys.
Why it costs you leads or sales
Real customers who enter real cards are usually declined, because a test environment rejects real card numbers. They see an error, think the shop is broken and leave. Some gateways also show a visible banner such as 'Test mode' that makes buyers distrust the page.
If a customer does use a test card or the gateway accepts the order, you get an order in your dashboard with no payment behind it. You may ship goods, grant course access or confirm a booking for free. Conversion tracking can also fire a purchase event for a sale that never paid, which pollutes your ad platform data.
- Product pageVisitor adds item to cart
- Checkout formDetails entered
- Payment with test keysReal card declined or no money moved
- Order confirmedNo real payment received
- Purchase trackingRevenue reported without cash
The customer reaches the payment step, but the gateway is a simulator, so the sale is lost.
Example: a store that normally takes 40 paid orders a week sees almost none while test keys are live.
How to check if your site has it
Start with what a customer sees, then check the settings.
- Open your checkout in a private window and look for words like 'Test mode', 'Sandbox' or 'Test card' on the payment form.
- In your payment settings, check whether the mode is set to Test, Sandbox or Development.
- Look at the publishable key: Stripe test keys start with
pk_test_andsk_test_, live keys withpk_live_andsk_live_. - In the gateway dashboard, switch the view between Test and Live and see which one shows your recent orders.
- Compare your shop's order list with your gateway's live payments list. Orders with no matching payment are a warning sign.
- Search your page source for
pk_test_(right-click, View page source, Ctrl+F).
const html = document.documentElement.outerHTML;
console.log('Stripe test key found:', /pk_test_[A-Za-z0-9]+/.test(html));
console.log('Stripe live key found:', /pk_live_[A-Za-z0-9]+/.test(html));How to fix it
Confirm your gateway account is activated for live payments
Stripe, PayPal and Square only issue live keys after you finish business verification. Complete any pending steps in the gateway dashboard first.
Copy the live credentials
In the gateway dashboard, switch off Test mode and open the API keys page (Stripe: Developers, API keys). Copy the live publishable and secret keys, or the live client ID and secret for PayPal.
Paste them into your platform
Use the tab below that matches your site. Replace test keys in every place they appear, including webhook secrets.
Recreate the live webhook
Webhooks are separate for test and live. Add your live endpoint in the gateway dashboard and paste the new signing secret into your platform.
Clear caches
Purge your site cache, CDN cache and any page-builder cache so the old publishable key is not served from a cached page.
WooCommerce Stripe
Go to WooCommerce, Settings, Payments, Stripe, then Settings. Untick Test mode and enter the live publishable key, secret key and webhook secret. Menu names vary by plugin version.
WooCommerce PayPal
In the PayPal Payments settings, untick Sandbox and reconnect your live PayPal account.
Check wp-config.php and plugins
Some setups define keys in code or in a separate payments plugin. Search for
pk_test_andsk_test_there too.
Turn off Bogus Gateway or test mode
In Settings, Payments, open Shopify Payments (or your provider) and, if Test mode is on, deactivate it. Remove the Bogus Gateway if it is active.
Third-party gateways
Open the provider under Settings, Payments, Manage and replace sandbox credentials with live ones.
Stripe in Webflow Ecommerce
Go to Site settings, Ecommerce, Payments. Make sure Stripe is connected to your live account, not in test mode, and reconnect if needed.
Payment providers
In Settings, Accept Payments, open each provider and make sure it is connected to the live account. Remove any test or sandbox method.
Disable Stripe test mode
Go to Commerce, Payments (menu names can vary). Turn off Stripe Test Mode and confirm the connected account is live.
Payment integrations
Go to Payments, Integrations and open Stripe or your gateway. Switch the mode from Test to Live and reconnect the live account. Check order forms and funnels use the live mode.
Use environment variables
Store keys in environment variables per environment, not in code. Set live values in production and restart the app.
Replace hard-coded keys
Search your repo and templates for
pk_test_,sk_test_and sandbox URLs such asapi-m.sandbox.paypal.com.
grep -rn --exclude-dir=node_modules --exclude-dir=.git -E "pk_test_|sk_test_|sandbox\.paypal\.com" .How to confirm it's fixed
Reload checkout in a private window
Confirm the test banner is gone and the page source no longer contains
pk_test_.Place a small real order
Use your own card on the cheapest product or a temporary low-price item.
Check the gateway's live dashboard
The payment should appear under Live, not Test.
Check the order and webhook
Make sure the order is marked paid, the confirmation email arrives and the webhook shows as delivered.
Refund the payment
Refund the test order from the gateway dashboard or your store admin.
Check tracking
Confirm one purchase event reaches GA4 and your ad platforms with the right value.
How to prevent it happening again
- Add 'switch payment keys to live' to your launch checklist, with a named owner.
- Keep test and live keys in environment settings per environment instead of editing them by hand.
- After every migration, staging push, theme change or payment plugin update, re-check the payment mode.
- Review the gateway's Live and Test dashboards weekly for orders that do not match.
- Limit who can change payment settings, and log who did.
- Run an automated checkout check on a schedule so a mode change is noticed in hours, not weeks.
Day 0
Site is cloned from staging and test keys come along.
Day 1
Real cards are declined; orders drop (Example).
Day 4
Someone notices revenue is flat and support emails arrive.
Day 5
Live keys are added and a real payment is confirmed.
How FunnelGuard handles this
FunnelGuard detects this issue only partly. It runs your checkout journey on a schedule and checks the page for a visible test-mode banner, using a text_absent check: the step fails if words that signal test mode, such as 'Test mode', appear on the page where they should not. If one does, you get a single alert with a screenshot and a likely cause, after a re-check from a second region.
What it does not do: it does not read your gateway dashboard, inspect your API keys, or confirm that a payment reached your live account. If your gateway is in test mode but shows no banner on the page, the text check will not catch it. FunnelGuard also never enters real card details and stops before payment unless your store's test mode is set up, so it cannot prove a real charge works.
The Free plan covers 1 site and 2 journeys with daily checks and no card. Paid plans start at $39/month with a 3-day free trial. A free read-only website audit is also available.
Questions people ask
Why is my Stripe checkout still in test mode on my live site?
Usually the test keys were never replaced, or they returned after a migration, a staging copy or a plugin update. Check your payment settings for a Test mode toggle and look for pk_test_ in your checkout page source.
How do I switch Stripe from test mode to live mode?
Activate your Stripe account, turn off Test mode in the dashboard, copy the live publishable and secret keys from Developers, API keys, and paste them into your store's payment settings. Then add the live webhook and clear your caches.
How can I tell if my payment gateway is in test mode?
Look for a Test or Sandbox banner on checkout, keys starting with pk_test_ or sk_test_, or orders that appear only in the gateway's Test view. A quick check is to view page source and search for pk_test_.
What happens if customers pay while the gateway is in test mode?
Real cards are usually declined, and any order that does go through collects no money. You may create orders you cannot collect on, and your tracking may report revenue that never arrived.
Why do I have orders but no money in Stripe or PayPal?
The orders may have been paid in test or sandbox mode, so the payments live in the Test view of the gateway. Switch the dashboard to Test mode to see them, then fix your keys so future orders use live mode.
Do I need a new webhook when I go live?
Yes. Test and live webhooks are separate in most gateways, each with its own signing secret. Create the live endpoint and update the secret in your platform, or orders may not be marked as paid.
Can FunnelGuard detect test mode on my live site?
Only partly. It checks for a visible test-mode banner on your checkout with a text_absent check. It does not check your keys or gateway account, so also verify them by hand and place a small real order.
How do I test a live checkout safely?
Buy the cheapest item with your own card, confirm the payment shows under Live in the gateway and that the order and email arrive, then refund it. Do not use customers' cards.
Related issues
- OPS-208Payment gateway outage (Stripe, PayPal, Square)Fix guide
- OPS-210Live keys on staging taking real moneyFix guide
- OPS-211PayPal button not renderingFix guide
- OPS-212Apple Pay domain verification file missingFix guide
- OPS-226Tax/shipping rate API failing at checkoutFix guide
- OPS-231Analytics/GTM endpoint blocked or downFix guide