Contents
A checkout error is the costliest error a store can have, because it loses an order that was ready to go. The best-known message shows in red above the checkout form after the customer clicks Place order; you may also see We were unable to process your order, please try again., Invalid payment method. or Sorry, your session has expired.
What the error means
When the order button is clicked, the browser sends a request to ?wc-ajax=checkout. WooCommerce validates the fields, creates the order, talks to the payment gateway and returns JSON. If any step fails, or the response is corrupted by a PHP error, the generic message appears and asks the customer to check for charges before trying again.
Common causes
- A PHP error in a plugin or theme while the order is created, or two plugins conflicting.
- Cart or checkout pages served from cache, so the security nonce or session is stale.
- Wrong API keys in the gateway, or test and live modes mixed up.
- The gateway’s webhook/callback URL is wrong or blocked.
- A gateway that doesn’t support the store currency, or an old gateway plugin that doesn’t support the Checkout block.
- A security rule blocking the checkout request with a 403.
- Mixed content on the checkout page, so the browser refuses the gateway’s script.
Advice for customers
If you see this message, check your bank or wallet notifications before retrying so you don’t pay twice. Then try a private window or another browser, or contact the store with the time of your attempt.
Fixing it as the store owner
- Reproduce it as a customer: open a private window, add a product and check out with the same details.
- Read the real response: open developer tools (F12) › Network, click Place order and open the
wc-ajax=checkoutrequest. The status code and body tell you a lot: 403 points to security, 500 to a PHP error. - Check the logs: under WooCommerce › Status › Logs, open the
fatal-errorslog and the gateway’s log, and enable the gateway’s debug log in its settings. Also check Metrics › Errors in cPanel. - Separate gateway from site: enable Cash on Delivery temporarily and test. If that order goes through, the problem is in the gateway settings: keys, mode, currency and callback URL.
- Test for conflicts: the Health Check plugin’s Troubleshooting mode disables plugins and the theme for your session only; enable just WooCommerce and the gateway and test.
- Exclude pages from cache: make sure cart, checkout and my-account are not cached by LiteSpeed Cache or by a CDN “Cache Everything” rule.
- Try the classic checkout: if the gateway doesn’t support the new block, edit the checkout page and replace the Checkout block with the shortcode:
[woocommerce_checkout]
- If the response is a 403, see ModSecurity 403 and send support the time and URL.
Prevention
- Test a full checkout after every WooCommerce, gateway or theme update.
- Keep the gateway in test mode until the setup works, then switch to live.
- Set up local gateways step by step, as in payment gateways in Egypt and payment gateways in Saudi Arabia.
On ArabyHost
WooCommerce plans include one-click install and LiteSpeed Cache, plus a free SSL certificate issued automatically so checkout runs over HTTPS. Imunify360 protects the store from malicious requests; if a legitimate checkout request is blocked, send support the time and URL so they can check the rule. The Araby AI assistant reads the error log and names the plugin responsible, and JetBackup keeps a daily backup you can return to if an update breaks checkout. See our WooCommerce hosting.
FAQ
Was the customer charged if this error appeared?
Possibly, because the error can happen after the gateway approved the payment. That's why the message tells customers to check their account and order history before trying again; store owners should match the gateway dashboard against WooCommerce orders.
Why does a payment method disappear from checkout?
Usually the checkout page uses the newer Checkout block and the gateway doesn't support it, or the gateway doesn't support the store currency or the customer's country. Try the classic checkout with the [woocommerce_checkout] shortcode.
What causes "Sorry, your session has expired"?
The customer's session ended or the cart cookie wasn't saved, often because the cart or checkout page is cached, or the customer switched between www and non-www. Exclude cart and checkout from caching and use one site address.