[Bug] amountPaid never persisted on guest or authenticated payment confirmation #20
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Identified during advisory review of #17 (guest checkout).
Problem
confirmGuestPayment(and the existingconfirmPayment) set the order status toPROCESSINGbut never callorder.setAmountPaid(...). As a resultGuestOrderResponse.amountPaidalways readsnull, even after "payment". The frontend test mock (GuestPaymentRedirect.spec.ts) expectsamountPaid: 49but the real backend returnsnull.This blocks finance reconciliation against the Swish payout report - there is no record of the expected paid amount at confirmation time.
Severity
Warning (payment integrity / data gap)
Suggested fix
On confirm, set
order.setAmountPaid(BigDecimal.valueOf(app.payment.letter-price))(pull the value fromSwishInfo) before save, on both the guest and authenticated paths.References