Skip to content

Payments and their lifecycle

A payment is one attempt to collect money from a customer. It moves through a fixed state machine — no transition outside this table ever happens, and every transition is recorded in a timeline you can read back.

The statuses

StatusMeaningTerminal?
createdThe payment exists; no customer number yet (links and hosted checkout start here)no
initiatedWe are contacting the providerno
awaiting_customerThe PIN prompt is on the customer’s phoneno
awaiting_otpThe provider asked for a one-time codeno
awaiting_code_useThe customer received a code to use at a tillno
completedThe provider confirmed the money moved. The only status that credits your balanceyes*
failedThe provider definitively said no (declined, insufficient funds)yes
expiredThe customer never acted and the window closedyes
unknownWe asked, the network didn’t answer. Not a failure. We keep askingno
unresolvedStill unknown after 24 hours of retries; a human takes over. Your balance is not creditedyes*
settledCompleted and paid out to your bank in a settlement batchyes
refundedCompleted, then refunded in fullyes

* completed later becomes settled or refunded; unresolved can be manually resolved.

What you should key on

  • Fulfil on payment.succeeded (the webhook) or on reading completed/settled — never on anything else.
  • Tell the customer “payment failed” only on failed or expired. Treat unknown as “still confirming” — here’s why.
  • A payment’s full history is in the dashboard timeline: every state, when, and what caused it.

Amounts on the wire

All amounts are integers in minor units (cents). USD 100.00 is 10000. There are no floats anywhere in Lango, and there should be none in your integration either.

FieldMeaning
amountThe order amount — what the sale is worth
charged_amountWhat the customer actually pays (order + their fees)
merchant_netWhat lands in your balance
fees[]Every fee, itemised, with its bearer

charged_amount − merchant_net is always exactly the commission. To the cent, every time — the invariant is enforced in our ledger, not just documented here.