[Bug] amountPaid never persisted on guest or authenticated payment confirmation #20

Open
opened 2026-06-22 11:11:51 +00:00 by hermes · 0 comments
Collaborator

Context

Identified during advisory review of #17 (guest checkout).

Problem

confirmGuestPayment (and the existing confirmPayment) set the order status to PROCESSING but never call order.setAmountPaid(...). As a result GuestOrderResponse.amountPaid always reads null, even after "payment". The frontend test mock (GuestPaymentRedirect.spec.ts) expects amountPaid: 49 but the real backend returns null.

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 from SwishInfo) before save, on both the guest and authenticated paths.

References

## Context Identified during advisory review of #17 (guest checkout). ## Problem `confirmGuestPayment` (and the existing `confirmPayment`) set the order status to `PROCESSING` but never call `order.setAmountPaid(...)`. As a result `GuestOrderResponse.amountPaid` always reads `null`, even after "payment". The frontend test mock (`GuestPaymentRedirect.spec.ts`) expects `amountPaid: 49` but the real backend returns `null`. 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 from `SwishInfo`) before save, on both the guest and authenticated paths. ## References - PR: https://srvr.nu/git/jocke/bilhej/pulls/17
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jocke/bilhej#20
No description provided.