The transaction types
A game round produces a small set of transaction types: bet (debit), win (credit), and rollback (reversal of a previous transaction). Some content adds types such as bonus wins or jackpot contributions; the handling pattern is the same.
Processing rules
Three rules keep wallet processing correct.
- Idempotency: a transaction ID is processed exactly once, however many times it arrives
- Ordering: a rollback references a specific earlier transaction; define behaviour for missing or already-rolled-back references
- Atomicity: balance change and transaction record commit together — never one without the other
Round lifecycle
A round may produce a bet with no win, a bet with one win, or (in multi-stage games) several credits. Rounds left unfinished — a player closing the browser mid-round — are settled by the provider and arrive as later callbacks; your system must accept them.
Reconciliation
Periodic reconciliation compares your transaction log against the API's reporting. Discrepancies are rare in a correct integration but must be detectable the same day, not at month-end.