fix(payment): persist amountPaid on payment confirmation (#20) #27

Open
hermes wants to merge 1 commit from fix/persist-amount-paid into master

1 commit

Author SHA1 Message Date
Hermes Agent
7d6d541354 fix(payment): persist amountPaid on payment confirmation
Some checks failed
CI / Lint, type check, unit tests, coverage (pull_request) Successful in 3m26s
CI / E2E browser tests (pull_request) Failing after 1m53s
confirmGuestPayment and confirmPayment set the order status to
PROCESSING but never called order.setAmountPaid(...). As a result
amountPaid always read null even after payment, blocking finance
reconciliation against the Swish payout report.

The frontend test mock (GuestPaymentRedirect.spec.ts) expected
amountPaid: 49 but the real backend returned null.

Changes:
  - OrderService: inject app.payment.letter-price (default 49) via
    @Value and set order.setAmountPaid(BigDecimal.valueOf(letterPrice))
    before save in both confirmGuestPayment and confirmPayment
  - OrderServiceTest: assert amountPaid == 49 after both confirm paths

Verified: ./gradlew :backend:test — BUILD SUCCESSFUL

Closes #20
2026-07-18 11:38:10 +00:00