fix(payment): persist amountPaid on payment confirmation (#20) #27
Open
hermes
wants to merge 1 commit from
fix/persist-amount-paid into master
pull from: fix/persist-amount-paid
merge into: jocke:master
jocke:master
jocke:fix/guest-payment-pending-review
jocke:fix/guest-order-rate-limiting
jocke:fix/guest-token-session-storage
jocke:fix/order-user-guest-check-constraint
jocke:fix/guest-qr-scannability
jocke:feature/guest-checkout
jocke:fix/swish-qr-scannability
jocke:feature/swish-qr-payment
jocke:develop
jocke:feature/auto-version-from-tag
jocke:fix/admin-table-styling
jocke:feature/expired-token-logout
jocke:chore/dockerfile-self-contained
jocke:chore/pre-commit-coverage-thresholds
jocke:feature/umami-analytics
jocke:refactor/admin-fulfillment
jocke:feature/admin-fulfillment-tracking
jocke:feature/account-settings-dropdown
jocke:feature/cancel-edit-pending-orders
1 commit
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
7d6d541354 |
fix(payment): persist amountPaid on payment confirmation
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
|