Skip to main content

Withdrawal — Test Cases

Feature version: v1.0
Reference doc: Finance System — Withdrawal Flow
Result notation: ✅ Pass | ❌ Fail | ⏭ Skip | 🐛 Fail + bug report


Changelog

DateVersionChangeAuthor
2026-05-10v1.0Initial creation

TC-WD-001 — Core withdrawal flow 🆕 NEW

Precondition: Player is active. Master wallet has sufficient credits.

#DescriptionStepsExpected ResultActual Result
1Withdrawal request created successfullyPlayer submits withdrawal with amount and withdrawalTypePaymentTransaction created with status = 'pending'
2Credits are locked immediately on submissionCheck master wallet right after submissionreservedBalance += amount; balance is unchanged
3Admin approve → status progresses correctlyAdmin approves withdrawal in Admin panelSync: pending → approved; after gateway webhook: approved → processing → completed
4Payout adapter is called after approvalMonitor logs after admin approvesPayout adapter (LinkMePay / BTCPay / 0x) receives the payout instruction
5Successful payout → wallet debited, status completedPayout adapter returns successstatus → completed; balance −= amount; reservedBalance −= amount
6Admin reject → reserved balance releasedAdmin rejects the withdrawalstatus → rejected; reservedBalance −= amount (credits returned to available balance)
7Withdrawal fee calculated correctlyWithdraw $100 with platformFeeRate = 2%platformFeeAmount = $2; netPayoutUsd = $98
8Pending timeout → auto-rejectLeave transaction pending past the configured timeoutSystem auto-transitions to rejected; credits released

TC-WD-002 — Withdrawal methods 🆕 NEW

Precondition: Payout adapters are configured for each provider.

#DescriptionStepsExpected ResultActual Result
1ECash transfer via LinkMePaySubmit with withdrawalType = 'ecash_transfer' → Admin approvesLinkMePay payout adapter is called
2Bitcoin via BTCPaySubmit with withdrawalType = 'bitcoin_transfer' → Admin approvesBTCPay withdrawal adapter is called
3USDT via 0x ProcessingSubmit with withdrawalType = 'zerox_usdt' → Admin approves0xProcessing withdrawal adapter is called