Order lifecycle
Every transition an order can make, the money movement and the event that goes with each, and what ends it.
An order starts processing and moves on its own. Every change raises its event and increases version by one. These pages promise no time for any of them: estimated_completion_at, when present, is an estimate.
Transitions
| From | To | Money | Event |
|---|---|---|---|
| Accepted | processing | order_reserve: moved from available to held. | order.accepted, order.processing |
processing | succeeded | order_capture: the held amount is taken. | order.succeeded |
processing | failed | order_release: the held amount returns to available. | order.failed, order.refunded |
processing | under_review | Stays held. | order.under_review |
under_review | succeeded | order_capture, once. | order.succeeded |
under_review | failed | order_release, once. | order.failed, order.refunded |
succeeded and failed are final. One reservation is captured once or released once, never both.
Unknown outcomes
- A timeout means unknown. An order that cannot be confirmed stays held and goes
under_review, with astatus_reasonsuch asoutcome_unconfirmedorprovider_conflict. - Money is never returned because time has passed. It moves only on a confirmed outcome.
- Never order again to find out: a second order is a second payment.
- Never treat a broadcast as delivered. Only
succeededmeans delivered.
Testing each transition
A nasfam_test_ username chooses the path, for either product:
| Username | What it does |
|---|---|
nasfam_test_ok | Succeeds. Any ordinary username behaves the same. |
nasfam_test_slow | Processing for about 2 minutes, then succeeds. |
nasfam_test_slow_rejected | Processing for about 2 minutes, then a verified failure; the hold is released once. |
nasfam_test_rejected | A verified failure at once; the hold is released once. |
nasfam_test_lost_ack | The provider's answer is lost; a lookup finds the delivery, which is captured once. Never sent twice. |
nasfam_test_timeout | The request never reaches the provider (UNKNOWN). Under review after 30 minutes, money held until two staff decide. |
nasfam_test_unknown | Under review after 30 minutes, then a late success at about 35 minutes, captured once. |
nasfam_test_conflict | Every provider answer names another recipient. Under review at once, money held until two staff decide. |
nasfam_test_missing | The recipient check finds nobody. The quote, or a direct order, is refused and nothing is reserved. |
Those timings belong to the sandbox's simulation. They say nothing about delivery on Live.
Related guides
- Orders and statuses: how to create and find an order.
- Webhooks: receiving the events.
- Recovering from failures: what to do in each case.
