Recommended polling interval
The optimal interval depends on the type of transaction:Timeouts — when to stop polling
Set a maximum number of attempts rather than an absolute delay: this gives you precise control over the number of API calls generated.
After the timeout, the transaction technically remains
pending on the LigdiCash side — it is not cancelled. The callback may still arrive. Apply the following logic:
- Mark the transaction as
expiredin your database (application-level status, not LigdiCash). - Inform the user that the processing is in progress and that they will be notified.
- Keep listening for the callback — if it arrives, re-verify with
confirmand update.
Hybrid strategy — primary callback + fallback polling
Handling pending transactions
A transaction stays pending until the operator has made its final decision. Several situations explain a prolonged pending:
- Approval mode (Moov Africa) — the customer must confirm on their mobile app, which can take several minutes.
- Expired OTP — the customer did not enter the OTP in time. The transaction will stay
pendingthen move tonotcompletedafter expiration. - Operator network congestion — rare but possible during traffic spikes.
- Payout awaiting funds — if the merchant account balance is insufficient at the moment of initiation.
pending after your polling timeout, keep the token in the database and schedule a deferred re-verification (e.g. +30 min, +2h, +24h) before considering it definitively lost.
JavaScript — deferred re-verification
Related pages
- Polling vs callback — choosing the right strategy
- Callback — security — re-verification with
confirm - Callback — idempotency — deduplicating the two requests
- Validation modes — USSD OTP, SMS OTP, approval
- Response codes and statuses — full reference
