Skip to main content

Shop USD Wallet — Test Cases

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


Changelog

DateVersionChangeAuthor
2026-05-10v1.0Initial creation

TC-SHOP-001 — Buy credits with USD wallet 🆕 NEW

Precondition: Shop has a USD wallet with sufficient balance. costRate is configured.

#DescriptionStepsExpected ResultActual Result
1Shop buys 100 credits with costRate=0.80Shop USD wallet = $100; buy 100 creditsUSD wallet: −$80; Credit wallet: +100
2Remaining USD balance is correct after purchaseAfter buying 100 credits ($80) from $100USD wallet balance = $20
3Credits computed correctly from costRatecostRate=0.80; grossUsd=$80credits = 80 / 0.80 = 100
4Different costRate produces different credit countcostRate=0.90; grossUsd=$90credits = 90 / 0.90 = 100
5Insufficient USD is rejectedUSD wallet = $50; attempt to buy 100 credits (costs $80)Insufficient balance error

TC-SHOP-002 — Shop withdraws USD 🆕 NEW

Precondition: Shop USD wallet has sufficient balance.

#DescriptionStepsExpected ResultActual Result
1Shop creates a USD withdrawal requestShop submits withdrawal from USD walletPaymentTransaction { type: 'withdrawal' } created with status = 'pending'
2Approval flow mirrors player withdrawalAdmin approves → payout adapter calledFlow: pending → approved → processing → completed