Payment lifecycle
The states an online payment moves through, how the checkout redirect, the webhook and the read fit together, and what to do with each outcome.
An online payment starts pending and ends in one of three states: executed, failed or abandoned. Your backend learns
which one from the read endpoint; the shopper's return and
the webhook only tell you when to read.
Server only
States
state | Trigger | Final | Timeout | What you do |
|---|---|---|---|---|
pending | You create the payment. Not paid yet: the shopper may still be on the checkout, or cancelled it and was sent to your failure URL. | No | Becomes abandoned 24 hours after it was created, if still unpaid. | Never treat it as paid. Poll on return, then let the webhook or a later read settle it. See pending. |
executed | The payment is paid. amount is the amount actually approved. | Yes | — | Compare amount with the order total, then fulfil once. See executed. |
failed | The card was declined or the payment did not go through. | Yes, except for a late ANNA payment | — | Offer a new payment. See failed. |
abandoned | Not paid within 24 hours of being created. The checkout no longer takes a payment for it. | Yes, except for a late ANNA payment | — | Release held stock, or create a new payment. See abandoned. |
executed never changes. failed and abandoned change only when an ANNA bank payment the shopper
started on the checkout completes afterwards: the payment becomes executed and sends
payment.received. See A late ANNA payment. A state you do not recognise is
pending, never paid.
From create to fulfilment
Points the diagram cannot show:
- Nothing is appended to your return URLs. Match the return to its order by your own order id
in the URL, or by the
paymentReferenceyou stored before redirecting. - The return and the webhook arrive in either order, and a shopper who closes the tab never
returns at all. Settle the order on whichever comes first, after reading the payment, and make
the second a no-op: key on
paymentReference. payment.receivedis the only payment webhook. It is sent once a payment has been received and booked — for a test payment, once it isexecuted. Afailed,abandonedor stillpendingpayment sends nothing. Its refunds send their own events once decided (refund.refunded,refund.failed,refund.canceled; see Webhooks). NocallbackUrl, or no signing secret on your key, and nothing is sent either.- Delivery is at least once. A webhook is attempted up to six times over about 8½ hours; see Delivery.
Warning
successUrl is not proof of payment. Verify the webhook signature, read the payment, and check its state, amount, currency, and reference before marking an order paid.Processing a webhook
Verify the webhook, then either read the payment, settle the order and answer 2xx
(process, then answer), or store the webhook,
answer 2xx and settle the order from a worker
(store, answer, process), as the
integration examples do.
Handling each outcome
pending
Never treat it as paid. On the shopper's return, poll the read every 2 seconds for up to about
30 seconds. If it is still pending, show "we are confirming your payment" and let the webhook or
a later read settle the order. Do not poll faster: payment requests are limited to 100 a minute.
A shopper who cancelled on the checkout page lands on your failure URL with the payment still
pending, and can still pay it: send them back to the same checkoutUrl. After five cards that were
neither approved nor declined (see Card attempts) the
checkout refuses more cards and does not send the shopper back; the payment stays pending.
executed
The payment is paid. Compare amount with the order total before you ship: on a partial approval
it is less than you asked for, and this field is the only signal. Fulfil the order once, even
if the webhook and the return both report it.
A partial approval (amount less than the order total) is paid, but not in full. Do not ship it.
Either refund it (Refund a payment, with no amount) and ask the shopper to
pay again with a new payment, or settle the difference with them yourself. Never mark the order paid in
full.
Fulfil once, act once. Marking the order paid with an update that only succeeds once
(… WHERE paid_at IS NULL) makes the record exact. Shipping, an e-mail or a call to another system
can still fail or run twice. Record what must happen in the same database commit that marks the order paid
(an outbox table), and have a worker carry it out, with an idempotency key of its own towards the other
system.
failed
The card was declined or the payment failed. Let the shopper try again with a new payment: create is per checkout attempt, and a failed payment takes no new card. Keep the order open rather than cancelling it on the first decline: see A late ANNA payment.
abandoned
Nothing was paid within 24 hours of the payment being created, so MPS gave up on it and the
checkout stops taking a payment for it. No webhook is sent. Release any stock you held, or create a
new payment if the shopper comes back. Until those 24 hours are up an unpaid payment is pending:
the shopper may still come back to the checkout page and pay.
A late ANNA payment
The checkout also offers ANNA, a bank payment the shopper confirms in their banking app. A
shopper can start one, then let the payment fail on a card or expire, and complete the bank payment
afterwards. The money then arrives: the payment turns executed and payment.received is sent, even
though you already saw failed or abandoned.
Keep handling payment.received for orders you closed. Reopen and fulfil the order, or
refund the payment if you can no longer deliver.
Reconcile what you did not hear about
The webhook is the fast path, not a guarantee: it can be given up after its last retry, and only a
received payment sends one. For any order still waiting, read the payment by its
paymentReference — the read is always authoritative.
A schedule for the orders still open:
- Every 15 minutes, take the orders that have a
paymentReferenceand are neither settled nor closed. - Read each one, spread over the run rather than all at once: it shares the rate limit with your checkout.
- Act on the state.
executed: settle it once, as above.failedorabandoned: close the order or offer a new payment.pending: leave it for a later run, reading it less often as it ages (15 minutes, then hourly). - Stop at 24 hours. An unpaid payment reads
abandoned24 hours after it was created. Only a late ANNA payment changes it after that, and that sendspayment.received. - Escalate what does not resolve: a read that keeps failing, or a payment still
pendingwell after 24 hours. That needs a person, not another retry.
What this schedule does not cover: a late ANNA payment that arrives after
you stopped reading, when every delivery of its payment.received failed. The payment reads executed,
but nothing tells you. Keep the paymentReference of every payment an order had, closed orders
included, so it can always be read. If your business must catch this case, keep reading the
failed and abandoned payments of closed orders once a day, at a low rate, for as long as you would
still fulfil or refund such an order. Money you cannot match to an order: contact MPS with the
paymentReference, the time (UTC) and state of your last read, and the
traceparent header of that read.
A create whose answer you never got has no paymentReference to read. Send the same request with
the same Idempotency-Key within 24 hours: you get the payment it made, or a new one if it made none.
There is no search by your own reference, which is why the key is stored before the call.
Related
- Follow a payment's timeline: every step a payment went through, to explain its state
- Process webhooks reliably
- Accept a payment
- Integration examples
- Production checklist
Need help? Contact MPS at contact@mps-emi.com or +32 55 89 09 77, or the MPS partner you work with. What to include.
Building with an AI assistant? Give it llms.txt, every page in llms-full.txt, this page as Markdown, or the OpenAPI document. See Build with AI.
Last updated on