Files
pos-system/apps
Ho Ngoc Hai b81c6ac176 fix(pos): prevent duplicate orders by checking payment API result
ConfirmPayment() previously ignored PayOrderAsync return value and
always showed success screen, even when payment API returned 500.
This caused users to unknowingly create duplicate orders — one unpaid
(Validated) and one paid (Completed).

Root causes fixed:
- Pass amountTendered to PayOrderWithDetailsAsync (required by
  PayOrderCommandValidator for cash payments)
- Check payment API response before showing success screen
- Show error message with retry option when payment fails
- Add loading state to prevent double-clicks during processing

Affects: CafeDesktop, CafeMobile, CafeTablet, RestaurantDesktop

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 02:12:57 +07:00
..