WooCommerce M-Pesa Payment Stuck on Pending in Kenya — Troubleshooting Guide
A WooCommerce order may remain pending when the payment request succeeds but the confirmation callback never reaches the website, when credentials or environments do not match, or when the gateway does not update the order correctly. Verify the actual payment before changing an order status.
Confirm whether money actually moved
Ask the customer for a transaction reference and check the payment provider’s official dashboard or API. A screenshot alone is not enough to prove settlement.
Never mark an order paid merely because an STK prompt appeared. A customer may cancel the prompt, time out or receive an error after entering a PIN.
Inspect the callback or webhook path
Many M-Pesa integrations depend on a server-to-server notification. Check whether the configured callback URL is publicly reachable, uses HTTPS and is not blocked by a firewall or maintenance mode.
Review the gateway’s logs for response codes and timestamps. A callback returning 403 or 500 may prevent WooCommerce from receiving the final status.
Check credentials and environment
Confirm whether the integration uses sandbox or production credentials, the correct business shortcode and the required authentication settings.
Do not paste API keys into public support tickets. Store credentials securely and rotate them if exposed.
Review WooCommerce order logic
Some gateways leave orders pending until they receive a successful confirmation, while others use on-hold or processing states. Check the plugin’s documented behaviour before changing settings.
Look for conflicts with caching, security plugins, custom checkout code or outdated WooCommerce hooks. Test on a staging copy when possible.
Handle duplicate or delayed callbacks
A callback can arrive late or be retried. The integration should identify transactions reliably and avoid marking one payment against multiple orders.
Reconcile transactions daily during an incident. If a customer has paid but the order is pending, confirm settlement through the provider and then use a documented manual correction process.
Test the full payment journey
Create a low-value test order using the permitted test or live method. Confirm STK request, payment result, order status, email notification and stock reduction.
Record the steps and results. A gateway that appears to work once may still fail intermittently under slow networks or callback delivery delays.
A payment that succeeded but the order did not update
A customer pays through an STK prompt and receives a valid transaction reference, but the WooCommerce order stays pending. The store owner confirms the payment in the official provider dashboard and finds that the callback endpoint was blocked by a security rule.
After correcting the endpoint configuration, the developer runs a controlled test and confirms the order reaches the expected status. The original order is reconciled carefully against the verified payment record so the customer is not asked to pay twice.
A quick decision guide
| Area to review | Useful next step |
|---|---|
| Confirm whether money actually moved | Ask the customer for a transaction reference and check the payment provider’s official dashboard or API. |
| Inspect the callback or webhook path | Many M-Pesa integrations depend on a server-to-server notification. |
| Check credentials and environment | Confirm whether the integration uses sandbox or production credentials, the correct business shortcode and the required authentication settings. |
| Review WooCommerce order logic | Some gateways leave orders pending until they receive a successful confirmation, while others use on-hold or processing states. |
Details worth checking before you act
Check whether the payment gateway logs include a transaction identifier that can be matched to a WooCommerce order. A timestamp alone is not a safe way to reconcile payments.
Avoid automatically retrying a payment on behalf of a customer without confirming its status. A delayed callback can arrive after a customer believes the transaction failed.
Test whether caching or a security rule blocks the callback endpoint. The endpoint must be protected appropriately but accessible to the payment provider through the supported authentication method.
Frequently asked questions
Why is an M-Pesa order pending after payment?
Ask the customer for a transaction reference and check the payment provider’s official dashboard or API. A screenshot alone is not enough to prove settlement. Check the specific requirements and your actual business situation before taking action. Keep a record of what you changed and whether the result improved.
Can I manually mark an order as paid?
Review the gateway’s logs for response codes and timestamps. A callback returning 403 or 500 may prevent WooCommerce from receiving the final status. If you are unsure, verify the facts in the official dashboard or with the responsible provider rather than relying on an online shortcut. Avoid making changes that you cannot reverse.
What is a callback URL?
Confirm whether the integration uses sandbox or production credentials, the correct business shortcode and the required authentication settings. The safest decision is the one supported by real evidence from your website or account. Test carefully, and do not promise a result that depends on another platform.
Can a firewall block payment confirmations?
Look for conflicts with caching, security plugins, custom checkout code or outdated WooCommerce hooks. Test on a staging copy when possible. Check the specific requirements and your actual business situation before taking action. Keep a record of what you changed and whether the result improved.
What if the customer paid twice?
A callback can arrive late or be retried. The integration should identify transactions reliably and avoid marking one payment against multiple orders. If you are unsure, verify the facts in the official dashboard or with the responsible provider rather than relying on an online shortcut. Avoid making changes that you cannot reverse.
Should I test in sandbox or live mode?
Record the steps and results. A gateway that appears to work once may still fail intermittently under slow networks or callback delivery delays. The safest decision is the one supported by real evidence from your website or account. Test carefully, and do not promise a result that depends on another platform.
How can I prevent repeat pending orders?
Create a low-value test order using the permitted test or live method. Confirm STK request, payment result, order status, email notification and stock reduction. Record the steps and results. A gateway that appears to work once may still fail intermittently under slow networks or callback delivery delays. Check the specific requirements and your actual business situation before taking action. Keep a record of what you changed and whether the result improved.
Where to go from here
If your business needs help with the issues covered in this guide, review our website development services. You can also website design and development to understand the next practical step.
