Failures are normal traffic
Networks drop, providers deploy, wallets slow down. An integration that handles only the happy path will corrupt balances or drop game rounds in production. Design for the failure modes from the start.
The core failure modes
The cases every integration must define behaviour for.
- Timeout on a wallet call: did the debit happen? Treat unknown as 'check, don't assume'
- Duplicate callback delivery: idempotency makes this harmless
- Rollback for an unknown bet: log, alert, and return the defined response
- Insufficient funds mid-round: defined error, no partial state
- Provider maintenance windows: fail lobby launches gracefully with a clear message
Retries
Retry outbound calls with backoff and only for idempotent operations or with idempotency keys. Never blind-retry a debit.
Observability
Log every transaction with its IDs, alert on error-rate spikes and balance mismatches, and keep dashboards your support team can actually read.