WordPress 3 min read

When the live store is still using Stripe test keys

Live WooCommerce store still on Stripe test keys and real cards getting declined? How I confirm pk_test vs pk_live, match failed orders to the Stripe logs, fix webhooks, and stop staging overwriting live keys.

When the live store is still using Stripe test keys

The store is live and the ads are running, but sales have gone quiet. Real customers get to checkout, enter their card and get declined. The orders sit in Failed or Pending payment, and no money arrives. The live site is still talking to Stripe in test mode.

I see this a lot on inherited WooCommerce stores. Someone switched the site live but left the gateway on test keys, so real customers can't pay at all. Or a database push from staging to live overwrote the live keys with the test ones.

Confirm which keys the live site is using

In WooCommerce, open the Stripe settings and look at the publishable and secret keys. Test keys start with pk_test_ and sk_test_. Live keys start with pk_live_ and sk_live_. Don't rely on an "Enable test mode" checkbox alone. Sometimes test keys have simply been pasted into the live key fields.

Also check whether keys live in wp-admin, in an environment file, or in a secrets manager your host injects. If staging and production share a database dump, the wrong keys travel with it.

Match the failed orders to the Stripe logs

Pick a recent WooCommerce order sitting in Failed or Pending payment. Open Stripe and switch the Dashboard between Test and Live, then check the payment logs for that attempt. A decline with a test-mode error (the request was in test mode but used a real card) confirms the live store is on test keys. If the attempt shows under Live and still failed, you've got a different problem, such as webhooks, status mapping or a second gateway.

While you're in there, look at how many failed payments there have been since the switch. A run of test-mode declines tells you how long real customers have been turned away.

Webhooks and the thank-you path

Live keys without a working live webhook endpoint leave orders stuck or emails late. After you correct the keys, confirm the webhook signing secret matches the live endpoint, and place one real low-value test order with a real card (then refund). Watch the order status, the customer email, and the Stripe event log on the same charge.

If checkout "succeeds" in the browser but Woo never leaves Pending payment, treat that as webhook or return-URL plumbing.

Stop the config drift

Once live keys are correct, lock the process so staging can't quietly overwrite them. Keep staging and live keys in separate places, so a database push can't carry one over the other. If you push a staging database to live, exclude the payment settings. Document who is allowed to rotate keys. If an agency or previous developer still has Dashboard access, tidy that at the same time.

If you inherited the store and nobody is sure what is hooked where, that's a support job, not a five-minute settings tweak.

If payments are failing for another reason, I've covered the wider checks in WooCommerce Stripe payments not working. Awkward payment, webhook and inherited-store rescues sit under my WordPress and WooCommerce support work.

Want a straight read? Use the form on dawsony.com and tell me whether the failed payments show under Stripe Test or Live, what status Woo shows for those orders, and whether staging shares the same keys. No passwords in the form.

Need a hand with this?

Get direct help with a WordPress fault, a custom feature or the regular upkeep of your website.

A related project

A custom price history feature for WooCommerce

Bespoke plugin work to record product price changes and present the history by date, delivered through an agency.

Talk directly to Adam

Share this article

Back to Blog