Hosted checkout
Hosted checkout is the integration most stores want: your backend creates the payment, the
customer pays on checkout.lango.co.zw, and Lango handles the prompt, the polling, the
timeouts and the copy — including the states that protect you from double charges.
The flow
-
Create the payment without a customer number:
Terminal window curl https://api.lango.co.zw/v1/payments \-H "Authorization: Bearer sk_test_YOUR_KEY" \-H "Idempotency-Key: order-4417" \-H "Content-Type: application/json" \-d '{"amount": 10000,"currency": "USD","method": "ecocash","reference": "ORD-4417","return_url": "https://yourstore.co.zw/orders/4417/thanks"}'Omitting
customer.msisdnis what makes it hosted: the customer enters their own number on the checkout page, and the charge happens there. -
Redirect the customer to the
checkout_urlin the response (https://checkout.lango.co.zw/c/tok_...). -
The customer pays: they see your name, the amount, any customer-borne fee as its own line; they enter their EcoCash number; the PIN prompt lands on their phone with a visible countdown.
-
You hear the outcome on your webhook (
payment.succeeded/payment.failed), and the customer is offered thereturn_urlback to you.
Rules worth knowing
- Fulfil on the webhook, not the redirect. A customer can close the browser after paying; the webhook always arrives.
- The checkout page expires unpaid payments after their window; the payment ends
expired, with an event. - The page shows your trading name — set it in Dashboard → Settings before going live.
- The checkout token in
checkout_urlgrants access to that payment’s checkout view and nothing else. It cannot read your account.
What checkout does that you don’t have to
- Zimbabwean number formatting and validation (
263 7x ...). - The waiting screen with countdown, “check your phone”, and the masked number.
- Timeout handling that distinguishes “declined” from “no answer yet” —
the
unknowndiscipline — with copy that stops customers paying twice. - Works with JavaScript disabled; under 50KB; no third-party scripts for a strict CSP.