Fix WooCommerce Payment Failures CloudyWP
Luke Anderson WordPress

WooCommerce Payments Failing? Causes and Fixes for AU Stores

When WooCommerce payments fail, start with the gateway’s own log (WooCommerce > Status > Logs) and the gateway dashboard, not the checkout page. Most failures come down to an expired or swapped API key, a webhook that never arrives, a cached checkout, or a plugin conflict, in roughly that order. Work through them one at a time and change one thing per test order.

First, work out which kind of failure you have, because the fixes are different. A card decline is the bank saying no: the order exists, the gateway has a record, and the customer sees a message from the card network. A broken payment is different: the order is never created, sits on “Pending payment”, or the checkout spins and returns an unhelpful error. Everything below is about the second kind. If the gateway dashboard shows declined payments with a clear reason (insufficient funds, card not supported), your store is probably fine.

Step 1: Read the logs before you change anything

It is tempting to start deactivating plugins. Do not. Open WooCommerce > Status > Logs and look at the entries from the time of a failed attempt. Gateway plugins usually write to their own log file, named after the gateway, so use the dropdown at the top right to pick the right one. Also check the fatal-errors log and the PHP error log if your host gives you one.

Most gateway plugins have a debug setting that is off by default. In the gateway’s settings (WooCommerce > Settings > Payments, then the gateway), switch on the debug or “log debug messages” option, place one test order, then read what was written. Turn it off again afterwards, because these logs can hold more customer detail than you want to keep around.

Then open the gateway’s own dashboard and look at the same time window. Stripe, PayPal and the other gateways all keep their own record of every API request and webhook they sent. If the gateway shows nothing at all for your test, the request never left your site. If it shows an error, you now have the reason in plain words.

Step 2: Check the API keys and webhook secret

This is the most common cause on the stores we see, and the easiest to miss. Keys expire, get rolled after a security scare, or someone regenerates them in the gateway dashboard without updating the site.

  • Confirm the store is in live mode with live keys. Test keys left on a live store, or live keys pasted into the test fields, both produce failures that look random.
  • Compare the publishable and secret keys in the plugin with those in the gateway dashboard, character for character. A stray space from copy and paste is enough to break it.
  • If you rolled or regenerated a key, the old one stops working. Check whether the webhook signing secret also changed, since many gateways issue a separate secret per webhook endpoint.
  • If the gateway account was recently verified, restricted or had a business detail changed, look for a notice in its dashboard. Some payment methods are switched off until the account is complete.

Step 3: Orders stuck on “Pending payment” usually mean a missed webhook

WooCommerce creates the order as “Pending payment” when the customer clicks pay. The gateway then tells your site, by webhook, that the money arrived, and only then does the order move to Processing. If the customer was charged but the order stays on Pending payment, the webhook did not reach your site or your site did not accept it.

  1. In the gateway dashboard, open the webhook or event log and look at the delivery attempts for the payment. A response of 403, 404, 500 or a timeout tells you where to look next.
  2. Check the endpoint URL is correct and uses https and your current domain. Sites that moved domain, or from a staging address to live, often still point at the old one.
  3. A 403 usually means a firewall is blocking the gateway. That can be a security plugin, your host’s firewall, or a Cloudflare rule or bot protection setting. Allow the gateway’s requests to the webhook URL, or skip the challenge for that path.
  4. A 404 on a pretty-permalink site can mean permalinks need re-saving (Settings > Permalinks > Save), or a redirect or caching rule is catching the webhook URL.
  5. Once fixed, most gateways let you resend the failed event from their dashboard so the stuck orders update.

Do not mark stuck orders as Processing by hand until you have confirmed in the gateway dashboard that the money was actually received.

Step 4: Make sure checkout is not being cached

Cart, checkout and My Account pages must never be served from a page cache. A cached checkout can carry an expired security token, an old cart or a stale nonce, and the payment fails when it is submitted. Caching plugins such as WP Rocket normally exclude these pages by default, but custom setups, host-level caches and CDN rules often do not.

  • Check your caching plugin’s exclusion list includes the cart, checkout and account pages.
  • Check any CDN or host cache. On Cloudflare, make sure no “cache everything” rule covers those URLs, and that the WooCommerce cookies are respected.
  • Clear every cache layer after changing a rule, then test in a private browser window.
  • Be wary of JavaScript minify, delay and combine options. Delaying scripts on the checkout can stop the gateway’s card fields from loading at all.

Step 5: Plugin or theme conflicts

If the keys and webhooks look right, something on your site is interfering. Do not test this on the live store with customers on it. The free Health Check and Troubleshooting plugin has a troubleshooting mode that disables plugins and switches to a default theme only for your logged-in session, so visitors see no change. Turn on the gateway plugin and WooCommerce, then re-enable the rest one at a time, retrying a test order after each. When the failure comes back, you have your culprit.

If you can, run the same test on a staging copy. Take a backup first either way.

A real example: the cause was in a plugin that had nothing to do with payments

We were called to a WooCommerce store where every checkout attempt failed at the payment step. The first suspect was the payment gateway, and wrong sale prices on the site pointed the first look in the wrong direction. Reading the logs and then isolating plugins one at a time found the actual fault: a Salesforce integration whose API access token had expired. With the token dead, the plugin failed in a way that showed up as pricing and payment errors. Removing it restored trading, and it was reinstated properly afterwards so the CRM sync was not lost. The full account is in the WooCommerce payment outage case study.

The lesson applies to your store: any plugin that talks to an outside service (CRM, accounting, shipping, email) holds credentials, and credentials expire. When one lapses, the error can surface somewhere unrelated, including checkout.

Australian settings worth checking

  • Currency. Under WooCommerce > Settings > General, confirm the store currency is Australian dollar. The gateway account must be able to accept it. A mismatch between the store currency and what the gateway account supports causes failures that do not make sense on the surface.
  • GST. Check the tax settings under WooCommerce > Settings > Tax, in particular whether prices are entered including or excluding tax. If the total WooCommerce sends to the gateway differs from the total the customer saw, some gateways reject it or the customer abandons.
  • Buy now, pay later. Afterpay and Zip apply their own limits to the order amount and approve customers on their own terms. If only those methods fail, check the amount limits and the gateway plugin’s log before assuming the store is broken.
  • Local gateways. If you use a gateway such as eWAY or Tyro, the same order applies: its plugin log, then its merchant portal, then the keys or credentials, then the connection between your site and its servers.
  • PayPal. Check that the PayPal account is connected in live mode and that no PayPal notice is waiting in your dashboard. Webhook delivery is checked the same way as in step 3.

If it is costing you sales right now

If the store is open but not earning, stop guessing and get another pair of eyes on it. Our WooCommerce emergency support works logs first, trading restored, then the root cause, and you can get a developer on it today when your checkout is down. If the symptom is the checkout page itself failing to load or submit, rather than the payment step, see our guide to fixing a broken WooCommerce checkout.

Frequently asked questions

Why is my WooCommerce order stuck on “Pending payment”?

The order was created, but the gateway’s confirmation never reached your site. Check the webhook delivery log in the gateway dashboard for errors, make sure the endpoint URL is correct, and look for a firewall or Cloudflare rule blocking it. Confirm in the gateway that the money was received before you change the order status.

How can I tell a card decline from a broken checkout?

A decline appears in the gateway dashboard with a reason from the bank, and the customer is told the card was refused. A broken checkout leaves no payment record at all, or leaves an order on Pending payment or Failed with an error in the WooCommerce logs and no matching decline.

Can I test payments without charging a real card?

Yes. Most gateways have a test mode with test keys and test card numbers listed in their documentation. Switch back to live keys when you finish, and remember that webhooks in test mode use a separate secret from live mode.

Where are the WooCommerce payment logs?

Go to WooCommerce > Status > Logs and choose the gateway’s log file from the dropdown. If it is empty, the gateway’s debug logging is probably off, so enable it in the gateway settings and place a test order.

Discussion

Be the first to comment

Leave a comment

Get in touch