Testing
Wallet integration cases to verify before production
Run these cases before enabling production traffic.
Debit Cases
| Case | Expected result |
|---|---|
| Valid debit | Balance decreases once and Phoenix accepts the bet |
Duplicate debit tx_id | Balance is not decreased again |
| Insufficient funds | HTTP 200, type: "ERROR", code: "insufficient_funds" |
| Invalid signature | HTTP 401, no balance change |
| Malformed body | HTTP 400 or safe validation error, no balance change |
Credit Cases
| Case | Expected result |
|---|---|
| Winner credit | Balance increases by settlement amount |
Loser credit with amount: 0 | Settlement is recorded, balance unchanged |
Duplicate credit tx_id | Balance is not increased again |
Temporary 5xx | Phoenix retries and later succeeds |
| Invalid signature | HTTP 401, no balance change |
Rollback Cases
| Case | Expected result |
|---|---|
| Valid rollback | Original debit is refunded |
Duplicate rollback tx_id | Refund is not applied again |
| Rollback without matching debit | Return a clear safe error or no-op according to your ledger policy |
Launch Cases
Test wallet behavior together with iframe launch:
- Visitor can browse but cannot place a bet.
- Player can place a bet after token upgrade.
- Token refresh keeps the session alive.
- Deposit flow returns focus to the iframe.
- Phoenix signature verification passes in staging.