MageSentinel

Magento 2 orders stuck in pending payment: causes and fixes

Pending payment is the state Magento gives an order while it waits for an external payment page to answer. A few such orders are normal: customers close the bank page. A sudden pile of them means the answer is not getting back to the store.

All posts2 min read

An hourglass standing on pebbles

What pending payment means

Redirect and hosted payment methods create the order first, then send the customer to the provider’s page or a 3-D Secure check. The order sits in the `pending_payment` state until the provider reports the result, either through the customer returning to the store or through a server-to-server notification (a callback or webhook).

When the notification arrives, the payment module invoices the order and moves it to processing, or cancels it. If nothing arrives, the order stays in pending payment.

Magento cancels them after a while

A cron job cancels pending payment orders older than the Pending Payment Order Lifetime, set under Stores → Configuration → Sales → Sales → Orders Cron Settings (480 minutes by default). Cancelling releases the reserved stock. If cron is not running, they are never cleaned up, so check cron first when old ones pile up.

Abandoned or lost?

Compare with the provider’s dashboard. If the provider shows the payment as authorised or captured but the order is still pending, the store missed the notification: that is a real fault and customers have paid for orders you may not ship. If the provider shows no payment, the customer gave up on the payment page; a rising share of those after a change points to a broken payment page or 3-D Secure step.

Common causes of missed notifications

The callback URL is blocked by a firewall, a bot rule, basic auth on staging copied to production, or a maintenance mode allowlist. The store’s base URL or the callback URL in the provider’s settings still points to an old domain. The signing key or merchant credentials changed on one side only. The payment module throws an exception on the callback, which shows in `var/log/exception.log`. Message queue consumers that the module relies on are not running.

On the customer side, the return to the store can lose the session when cookies are set with SameSite rules that drop them on the provider’s cross-site POST back, so the customer lands on an empty cart even though the payment went through. See also payment webhooks in Magento.

Catch it the day it starts

Watch the count of pending payment orders per hour against the usual level, and the share of orders that move to processing. A checkout check that places a real order confirms the whole path, including the return to the store. The free Magento checkout test walks the checkout in a real browser and shows the step where it stops.

Common questions

What does pending payment mean in Magento 2?

The order was created and Magento is waiting for the payment provider to report the result, usually after a redirect to a hosted payment page or 3-D Secure.

How long do orders stay in pending payment?

Until the provider reports, or until cron cancels them after the Pending Payment Order Lifetime (480 minutes by default) under Sales → Orders Cron Settings.

The customer paid but the order is still pending payment. Why?

The provider’s notification did not reach the store or failed there: a blocked callback URL, wrong credentials or URL in the provider settings, or an exception in the payment module.