The worst support ticket in ecommerce
A customer emails to say their card was charged but they never got an order confirmation. You check the admin and there is no order.
You check the gateway and there is the charge, sitting right there. That is the ticket that keeps store owners up at night, and I see it more often than anyone would like.
Declined-but-charged, missing orders after a successful payment, and duplicate charges all trace back to the same root problem: the moment of payment and the moment of order creation are two separate events, and Magento does not always keep them in sync.
This article covers how that gap opens, why webhooks and IPN callbacks are where the money quietly goes missing, and how to close the loop so every real payment becomes a real order.
Payment and order are not the same event
When a customer pays, two things have to happen: the gateway has to authorize or capture the money, and Magento has to convert the quote into an order. These are separate steps, often on separate systems, connected by a network call that can fail.
If the payment succeeds and the order creation fails, you get a charge with no order. If the order is created but the payment confirmation never arrives, you get an order stuck in limbo that may never ship or may ship without real money behind it.
Every one of these failures lives in the seam between the two events. The gateway is usually fine, and Magento is usually fine. The handoff is what breaks.
Where the charge happens without the order
The classic declined-but-charged case is not really a decline. The gateway authorized the card, then something between the authorization and the order timed out, threw, or lost the response.
The bank shows a pending authorization, which looks like a charge to the customer. Magento never received a clean success, so it created no order, or it rolled the quote back and left the shopper on an error page.
Webhooks and IPN are the safety net that is often torn
Modern gateways do not trust the browser to be the source of truth. They send a server-to-server callback, a webhook or IPN, that tells your store what actually happened to the payment, independent of whether the customer's browser made it back.
That callback is your safety net for exactly the case where the shopper closed the tab, lost signal, or hit a timeout. If the webhook fires and Magento handles it correctly, the order still gets created or updated even though the browser never returned.
The failures I find are almost always in that callback path: the endpoint is unreachable, the handler throws, the verification fails, or nobody is watching whether the callbacks arrive at all.
Why the callback silently fails
Webhook endpoints break in a small number of predictable ways, and each one is invisible until you go looking.
- A firewall, WAF, or IP allowlist blocks the gateway's servers from reaching the endpoint.
- The callback URL still points at staging, or at an old domain, after a migration.
- Signature or hash verification fails, so a valid callback is rejected as untrusted.
- The handler throws mid-processing and the gateway records a failed delivery.
- Maintenance mode or a deploy window returns an error to a callback that never retries.
The gateway usually retries for a while and then gives up. Once it gives up, that payment has no path left to become an order, and the money is stranded.
Orders stuck in payment review or pending
Sometimes the order does exist, but in a state that never resolves. An order sitting in Payment Review or Pending Payment long after the customer paid is a sign the confirming callback never landed.
These are dangerous because they can go both directions. The store may never ship a paid order, or a warehouse may ship an order whose payment was actually declined after the fact.
A store that accumulates a pile of stale pending orders does not have a payment problem in the gateway. It has a callback that is not closing the loop.
Find the gap in your own data
You can measure this directly. Reconcile the gateway's list of successful transactions against Magento's orders for the same window, and every transaction without a matching order is a real leak.
# Orders stuck waiting on a payment confirmation
SELECT entity_id, increment_id, state, status, created_at
FROM sales_order
WHERE state IN ('pending_payment','payment_review')
AND created_at < NOW() - INTERVAL 1 HOUR
ORDER BY created_at DESC;
# Then compare gateway settlement/transaction reports
# for the same window against these increment IDs.
Do this reconciliation on a schedule, not just when a customer complains. The customers who email you are a fraction of the ones this happens to.
Idempotency is the fix, not luck
The durable solution is to make payment handling idempotent, so the same payment event processed twice produces one order, not two, and a missed event can be safely replayed.
Every gateway callback carries a unique transaction identifier. Your handler should look up that identifier first, act only if it has not already been processed, and record that it handled it, so a retry is harmless.
Make the failures loud
The reason these bugs survive is that they are silent. A dropped callback does not page anyone, and a stranded authorization does not appear in any dashboard by default.
Add monitoring that turns silence into a signal: alert when an order sits in pending payment past a threshold, when webhook delivery failures rise, or when the gateway's success count and Magento's order count diverge for a period.
Log every inbound callback with its transaction id and outcome, so when a customer does email, you can trace exactly what the gateway sent and what your store did with it.
Give the customer a clear path when it fails
Even with the callback path healthy, some payments will fail in the browser, and what the customer sees at that moment decides whether you keep them. A naked error page with a stack trace or a generic failure sends them straight to a competitor.
The better failure is a calm message that tells them what to do next: their card may not have been charged, to wait a moment before retrying, and to contact you with their email if anything looks wrong. Capture that email so you can reach them even if the order never formed.
A shopper who hits an error but is told exactly what happened often comes back and completes the order. A shopper who hits a wall of red text almost never does.
Duplicate charges are the same bug in a mirror
The opposite of a missing order is a doubled one. A customer clicks Place Order, the response is slow, they click again, and now two authorizations exist for one cart. Or a webhook is delivered twice and the handler creates two orders from one payment.
The cause is the same missing idempotency that produces stranded charges. A handler that does not check whether it has already processed a transaction will happily process it twice.
Guarding order creation against repeat submissions, and keying every gateway callback on its unique transaction id, closes both the missing-order and the duplicate-order cases with one fix.
3D Secure and the redirect that drops the order
Many cards now require a 3D Secure step, which sends the shopper to their bank's page and back. That redirect is another handoff, and handoffs are where orders fall out of the flow.
If the customer completes the bank challenge but the return trip to your store fails, the bank sees an approved payment while your store never finished the order. This looks exactly like declined-but-charged from the customer's side.
The gateway's callback is what saves this case, because it reports the approved payment independently of whether the browser made it home. If that callback path is healthy, the order still lands even when the redirect does not.
The strays need a recovery workflow
Finding a stranded payment is only half the job. Somebody has to do something about it, and if that something is a person hunting through the gateway dashboard by hand, it will not happen consistently.
Give operations a real workflow: a place where every unmatched transaction lands, with the customer's email, the amount, and the gateway reference, and a clear action for each one. Create the missing order, void the dead authorization, or refund the duplicate.
The queue turns a scramble into a routine. When a stray shows up, the person on duty knows exactly where to look and what to do, instead of reconstructing the situation from scratch every time a customer complains.
Reconcile, do not trust
The healthiest payment setups I audit do not assume the happy path worked. They reconcile every day, catch the strays, and either capture, void, or refund them before a customer has to ask.
That habit turns declined-but-charged from a recurring crisis into a routine cleanup that finishes before anyone notices. The money that used to leak through the seam gets caught, every day, on purpose.
If your store has ever charged a card without creating an order, the gateway is not your problem. The callback path and the reconciliation habit around it are where the fix lives.