Pular para o conteúdo principal

Contingency polling

Webhooks are the primary notification channel. Polling is the mandatory fallback.

Webhook delivery depends on your endpoint being reachable at the moment the event fires. A deploy, a certificate renewal, a five-minute outage in your ingress — any of these silently drops events. Without a polling job, those transactions stay in a transitional state forever, and the player never gets credited.

What to implement​

A sweeping job. Query every transaction that has been sitting in a transitional state (PENDING, INITIATED, PROCESSING) for more than 30 seconds, and resolve it with a GET. Run it on a short interval — once per minute is a reasonable default.

Alerting on aging. Any transaction still transitional after 5 minutes should raise an internal alert. That is no longer normal latency; something needs a human.

Daily reconciliation. Independently of the sweep, compare your ledger against LB Pay's records once per day. See Reconciliation.

Choosing an interval​

Poll proportionally to how long the operation has been open — not on a fixed timer for everything. A charge created two seconds ago does not need querying; one open for ten minutes does.

Age of the transactionSuggested check
< 30 sDo not poll — wait for the webhook
30 s – 5 minEvery 30–60 s
5 min – 1 hEvery 5 min, plus an alert
> 1 hHourly, plus escalation to a human queue

The rule that prevents losses​

Never act on a transitional status

PENDING, INITIATED and PROCESSING mean the outcome is not yet known. Polling tells you the current state — it does not authorise a decision until that state is terminal.

Do not cancel a withdrawal, do not return balance to a player, and do not block a new deposit attempt while the status is transitional.

Terminal states are listed per operation in the Status Machine.

Query endpoints​

OperationEndpoint
DepositGET /v1/pix/deposit/immediate-charge/{chargeId}
WithdrawalGET /v1/pix/withdraw/{externalId}
RefundGET /v1/pix/refund/{endToEndId}
Internal transferGET /v1/transfer/{externalId}
BalanceGET /v1/balance/realtime