If your WooCommerce store is still processing payments in test mode, the most common cause is that the gateway’s test credentials have not been replaced with live ones, or the gateway’s “Enable test mode” checkbox remains ticked.
Why test‑mode mistakes happen
Payment gateways such as Stripe, PayPal, Braintree and Worldpay each ship a sandbox environment. During development it is normal to toggle the test‑mode switch and paste sandbox API keys. Problems arise when:
- The live keys are entered but the test‑mode checkbox is left enabled.
- Multiple gateways are active and only one is switched to live.
- A caching plugin serves an old checkout page that still references the sandbox JavaScript.
- Webhook URLs in the gateway dashboard still point to a staging endpoint.
Step‑by‑step fixes
- Verify gateway settings. Go to
WooCommerce → Settings → Payments. For each enabled gateway open the configuration panel and confirm that “Enable test mode” is unchecked. - Replace sandbox credentials. Paste the live publishable and secret keys (or client ID / secret) exactly as provided by the payment provider. Remove any trailing spaces.
- Clear all caches. Purge server‑side cache (e.g. Varnish, Nginx fastcgi), any WordPress caching plugin, and CDN edge cache. Then test the checkout in an incognito browser window.
- Update webhook endpoints. In the provider’s dashboard change the webhook URL from
https://staging.example.comto the production URL. Ensure the endpoint uses HTTPS and responds with 2xx within 10 seconds. - Run a test transaction. Use a real card (or a low‑value live transaction) and confirm the order status changes to “Processing” and the payment appears in the gateway’s live dashboard.
- Check email notifications. Verify that the “New order” and “Payment completed” emails are sent to the correct addresses and contain the live order ID.
Troubleshooting quick‑reference table
| Symptom | Likely cause | Immediate check |
|---|---|---|
| Order stays “Pending payment” | Test mode still enabled | Uncheck “Enable test mode” in gateway settings |
| Payment succeeds in sandbox but not live | Live API keys missing or malformed | Re‑enter live keys, ensure no extra whitespace |
| Webhook failures logged in gateway dashboard | Staging webhook URL still configured | Update webhook to production URL, test delivery |
| Checkout page shows sandbox branding | Cached checkout assets | Purge all caches, reload in incognito |
Preventing future errors
Adopt a deployment checklist that includes a “Payments go‑live” step. Store live credentials in a secure password manager rather than in the site’s wp-config.php. Use a staging‑to‑production deployment script that automatically flips the test‑mode flag via the WooCommerce REST API (e.g. PUT /wp-json/wc/v3/payment_gateways/stripe with {"enabled":true,"testmode":false}). Schedule a monthly audit of gateway settings and webhook health. Finally, keep the official WooCommerce and gateway documentation bookmarked; interfaces change and the latest screenshots will always be the authoritative reference.
FAQ
Can I run both test and live modes simultaneously?
Most gateways allow only one mode per account. If you need a sandbox for development, keep a separate staging site with its own gateway account.
Why does the order status remain “On hold” after a live payment?
“On hold” usually means the payment gateway returned a pending state (e.g. 3D Secure challenge). Check the gateway’s transaction log and ensure the webhook that finalises the order is reachable.
Do I need to regenerate API keys after switching to live?
Only if the keys were compromised or the provider requires rotation. Otherwise the same live keys remain valid.
Where can I find the current WooCommerce payment gateway documentation?
Visit the official WooCommerce docs site and the specific gateway’s developer portal. Both are updated whenever the UI changes.
Audience: United Kingdom. Always verify platform-specific settings against current vendor documentation.
Editorial note: AI tools assisted with drafting. Please verify information against relevant official sources.