Withdrawal — Test Cases
Feature version: v1.0
Reference doc: Finance System — Withdrawal Flow
Result notation: ✅ Pass | ❌ Fail | ⏭ Skip | 🐛 Fail + bug report
Changelog
| Date | Version | Change | Author |
|---|---|---|---|
| 2026-05-10 | v1.0 | Initial creation | — |
TC-WD-001 — Core withdrawal flow 🆕 NEW
Precondition: Player is active. Master wallet has sufficient credits.
| # | Description | Steps | Expected Result | Actual Result |
|---|---|---|---|---|
| 1 | Withdrawal request created successfully | Player submits withdrawal with amount and withdrawalType | PaymentTransaction created with status = 'pending' | |
| 2 | Credits are locked immediately on submission | Check master wallet right after submission | reservedBalance += amount; balance is unchanged | |
| 3 | Admin approve → status progresses correctly | Admin approves withdrawal in Admin panel | Sync: pending → approved; after gateway webhook: approved → processing → completed | |
| 4 | Payout adapter is called after approval | Monitor logs after admin approves | Payout adapter (LinkMePay / BTCPay / 0x) receives the payout instruction | |
| 5 | Successful payout → wallet debited, status completed | Payout adapter returns success | status → completed; balance −= amount; reservedBalance −= amount | |
| 6 | Admin reject → reserved balance released | Admin rejects the withdrawal | status → rejected; reservedBalance −= amount (credits returned to available balance) | |
| 7 | Withdrawal fee calculated correctly | Withdraw $100 with platformFeeRate = 2% | platformFeeAmount = $2; netPayoutUsd = $98 | |
| 8 | Pending timeout → auto-reject | Leave transaction pending past the configured timeout | System auto-transitions to rejected; credits released |
TC-WD-002 — Withdrawal methods 🆕 NEW
Precondition: Payout adapters are configured for each provider.
| # | Description | Steps | Expected Result | Actual Result |
|---|---|---|---|---|
| 1 | ECash transfer via LinkMePay | Submit with withdrawalType = 'ecash_transfer' → Admin approves | LinkMePay payout adapter is called | |
| 2 | Bitcoin via BTCPay | Submit with withdrawalType = 'bitcoin_transfer' → Admin approves | BTCPay withdrawal adapter is called | |
| 3 | USDT via 0x Processing | Submit with withdrawalType = 'zerox_usdt' → Admin approves | 0xProcessing withdrawal adapter is called |