Test Generation

Test Cases

Comprehensive test cases generated for WS-1463Direct Discount Handling for Denomination-based Payment Methods

Generated: March 22, 2026 · Source: Jira WS Board 124

User Story Context

Understanding the problem this test suite validates

Problem

The system lacks promotion logic for fixed-denomination payment methods (ZingCard, VNGGames Card). When a user applies a promotion and pays with a fixed-denomination card, the actual deducted amount doesn't match the reconciliation amount, causing the game to reject the transaction.

Example

200K package - 30K discount = 170K needed
ZingCard only has 200K denomination
Billing adds 30K promo = 230K sent to game
Game expects 200K → rejects → user loses money

Use Cases Covered

US01 Block invalid config between Game type & Paying Amount Type
US02-04 Recalculate Final Paying Amount = Base - Promotion - Point
US05 Display popup + inline message on auto-remove promotion
Tracking Event tracking for promotion-related UI actions

Game Type Rules

No Wallet (Valorant)

Card must match final amount. Mismatch → auto-remove promo

Has Wallet (GunPow)

Overpay → surplus to wallet. Underpay → all to wallet, no item

26
Total Cases
3
Config Validation
8
Calculation
6
UI/UX
3
Event Tracking
6
Edge Cases
Filter:
US01

Config Validation

TC-01 High Block invalid config: Game without wallet + STATIC_DENOM + promotion

Steps

1Admin configures promotion for a game without wallet (e.g., Valorant) using STATIC_DENOM paying type
2Set discount that results in non-matching denomination

Expected Result

System blocks the invalid config and shows error message preventing save

TC-02 Medium Allow valid config: Game with wallet + STATIC paying type + promotion

Steps

1Admin configures promotion for a game with wallet (e.g., GunPow) using STATIC paying type
2Set valid discount amount

Expected Result

System allows config to be saved successfully

TC-03 High Block invalid config: Game without wallet + STATIC + discount not matching any denomination

Steps

1Admin configures promotion for non-wallet game with STATIC type
2Discount results in amount not matching any card denomination

Expected Result

System blocks config and shows validation error

US02-04

Final Paying Amount Recalculation

TC-04 High Correct calculation: Base Price - Promotion amount

Steps

1Select a 200K package
2Apply a 30K direct discount promotion
3Pay with ZingCard

Expected Result

Final Paying Amount = 170K displayed correctly in checkout

TC-05 High Correct calculation: Base Price - Promotion - Point

Steps

1Select a 200K package on a game that allows point usage
2Apply 30K discount
3Use 20K points

Expected Result

Final Paying Amount = 150K (200K - 30K - 20K) displayed correctly

TC-06 High Game WITHOUT wallet: Card denomination matches final amount

Steps

1Select 200K package on Valorant (no wallet)
2Apply 100K discount → final = 100K
3Enter ZingCard with 100K denomination

Expected Result

Promotion applied successfully. Payment proceeds. User receives item

TC-07 High Game WITHOUT wallet: Card denomination does NOT match final amount

Steps

1Select 200K package on Valorant (no wallet)
2Apply 30K discount → final = 170K
3No ZingCard has 170K denomination

Expected Result

System auto-removes promotion. User prompted to pay original 200K. Notification shown

TC-08 High Game WITH wallet: Card denomination = final paying amount

Steps

1Select 200K package on GunPow (has wallet)
2Apply 50K discount → final = 150K
3Enter ZingCard with 150K denomination

Expected Result

Promotion applied. Payment proceeds. User receives item. No wallet surplus

TC-09 High Game WITH wallet: Card denomination > final amount (overpay)

Steps

1Select 200K package on GunPow
2Apply 100K discount → final = 100K
3Enter ZingCard with 200K denomination

Expected Result

Item delivered. Surplus 100K (200K - 100K) credited to user's wallet

TC-10 High Game WITH wallet: Card denomination < final amount (underpay)

Steps

1Select 200K package on GunPow
2Apply 10K discount → final = 190K
3Enter ZingCard with 100K denomination

Expected Result

Item NOT delivered. Full 100K amount credited to user's wallet

TC-11 Medium Point usage disabled: Final amount = Base - Promotion only

Steps

1Select package on game that does NOT allow point usage
2Apply promotion
3Verify point usage section is hidden

Expected Result

Final Paying Amount = Base Price - Promotion. No point deduction option shown

US05

UI/UX: Auto-remove Promotion & Notifications

TC-12 High Popup displayed when promotion is auto-removed (no wallet game)

Steps

1On Valorant, apply a discount that results in non-matching denomination
2Select ZingCard as payment method

Expected Result

Popup notification displayed explaining promotion was removed due to incompatible payment method

TC-13 High Inline message shown at payment method section

Steps

1Apply promotion on non-wallet game
2Enter card with non-matching denomination

Expected Result

Inline error message displayed near card input field. CTA (submit) button is disabled

TC-14 Medium CTA button state after auto-remove

Steps

1Apply promotion that gets auto-removed
2Observe checkout CTA button

Expected Result

CTA re-enables after promotion is removed and user returns to original price

TC-15 Medium Payment method state after auto-remove

Steps

1Apply promotion
2Promotion is auto-removed
3Check ZingCard payment section

Expected Result

ZingCard payment method remains selected. Price reverts to original package price

TC-16 Medium User can re-apply different promotion after auto-remove

Steps

1First promotion is auto-removed
2User applies a different promotion that results in a matching denomination

Expected Result

New promotion applied successfully. No error message. CTA enabled

TC-17 Low Popup dismissal and user flow

Steps

1Trigger auto-remove popup
2User dismisses popup

Expected Result

User returns to checkout with original price. Payment flow continues normally

Tracking

Event Tracking

TC-18 Medium Track promotion apply event on denomination payment

Steps

1Apply promotion when ZingCard is selected
2Check event logs

Expected Result

Event fired with: promotion_id, game_id, payment_method=ZingCard, amount, denomination

TC-19 Medium Track auto-remove promotion event

Steps

1Trigger auto-remove of promotion
2Check event logs

Expected Result

Event fired with: reason=denomination_mismatch, original_amount, discount_amount, card_denomination

TC-20 Medium Track successful payment with promotion on denomination card

Steps

1Complete payment with matching denomination after discount
2Check event logs

Expected Result

Event fired with: transaction_status=success, final_amount, promotion_applied=true

Edge

Edge Cases & Negative Tests

TC-21 High Multiple promotions applied then switch to ZingCard

Steps

1Apply promotion with non-ZingCard payment method
2Switch payment method to ZingCard with non-matching denomination

Expected Result

System auto-removes promotion and notifies user

TC-22 Medium Apply promotion → Enter card → Remove card → Re-enter different card

Steps

1Apply 100K discount on 200K package
2Enter 100K ZingCard (matches)
3Remove card
4Enter 200K ZingCard

Expected Result

Step 2: Promotion stays. Step 4: Promotion stays (200K > 100K, overpay handled per game type)

TC-23 Low Zero discount amount edge case

Steps

1Apply promotion with 0 VND discount
2Pay with any ZingCard denomination

Expected Result

Final amount = original price. Card denomination matching follows normal logic

TC-24 High Discount equals full package price (100% off)

Steps

1Apply promotion that discounts 100% of 200K package (= 200K)
2Attempt ZingCard payment

Expected Result

Final amount = 0 VND. System handles zero-amount payment (free order or block ZingCard selection)

TC-25 Medium Network timeout during promotion validation with ZingCard

Steps

1Apply promotion
2Enter ZingCard
3Simulate network timeout during validation

Expected Result

Graceful error handling. User informed to retry. No partial state left

TC-26 High Concurrent session: Promotion expires while user is at checkout

Steps

1Apply promotion at checkout
2Promotion expires server-side before user submits
3User submits order

Expected Result

System rejects with clear error. No charge applied. User prompted to proceed without promotion