• Joined on 2026-06-16
hermes pushed to pr-17 at jocke/bilhej 2026-06-19 19:33:35 +00:00
a0cefb2646 test(guest): add backend unit tests for guest checkout to fix CI
hermes commented on pull request jocke/bilhej#17 2026-06-19 19:19:16 +00:00
feat(guest): guest checkout without login (Swish + QR)

🔴 Critical — honor-system payment on a public route. confirmGuestPayment transitions PENDING_PAYMENT → PROCESSING purely on the client's button click, with no Swish payment verification. Pre-existing on the authed confirmPayment, but this guest endpoint is JWT-less, so the only barrier is knowing the guest token. At minimum set amountPaid (and a paid_at) here so finance can reconcile against the Swish payout report; ideally gate the transition on a Swish Commerce payment request + callback.

hermes commented on pull request jocke/bilhej#17 2026-06-19 19:19:16 +00:00
feat(guest): guest checkout without login (Swish + QR)

🟢 No tests for the new guest methods. OrderServiceTest already covers createOrder/confirmPayment/cancelOrder/updatePendingOrder with the existing Mockito pattern. Please mirror that for createGuestOrder (plate uppercased, email lowercased, guestToken set via onCreate), getOrderByGuestToken (404 when userId is non-null — the defensive guard deserves a regression test of its own), and confirmGuestPayment (transition + notifyOrderProcessing invocation).

hermes commented on pull request jocke/bilhej#17 2026-06-19 19:19:16 +00:00
feat(guest): guest checkout without login (Swish + QR)

🟡 Missing DB-level orphan guard. The Order Javadoc asserts "Either userId or guestToken is set; never both, never neither" — but only onCreate() enforces this in Java. A stray INSERT (admin tooling, future script) can violate it. Suggest adding after the column additions:

hermes commented on pull request jocke/bilhej#17 2026-06-19 19:19:16 +00:00
feat(guest): guest checkout without login (Swish + QR)

Verdict: Well-structured guest-checkout scaffold — validation parity with the authed flow, defensive token lifecycle (only guest orders get a token, lookups refuse to serve user-owned orders), and a partial-unique-index migration that is backfill-safe. Frontend type-checks pass per the PR. Two blockers worth resolving before merge: the payment-confirmation path is honor-system (carried over from the authed path, but now on a public, JWT-less route), and the three new OrderService methods have no tests.

hermes created pull request jocke/bilhej#17 2026-06-19 19:15:15 +00:00
feat(guest): guest checkout without login (Swish + QR)
hermes created branch feature/guest-checkout in jocke/bilhej 2026-06-19 19:15:09 +00:00
hermes pushed to feature/guest-checkout at jocke/bilhej 2026-06-19 19:15:09 +00:00
08fcbba580 feat(guest): guest checkout without login (Swish + QR)
hermes commented on pull request jocke/bilhej#16 2026-06-19 16:24:02 +00:00
fix(payment): make Swish QR code scannable by the Swish app

💡 Suggestion: Good resilience pattern — the silent catch degrades gracefully. Consider adding a test for this path: mockToDataURL.mockRejectedValue(...) → assert the Swish payment link and manual fallback still render.

hermes commented on pull request jocke/bilhej#16 2026-06-19 16:24:02 +00:00
fix(payment): make Swish QR code scannable by the Swish app

💡 Suggestion: The comment says "a leading +" but /[\s+]/g strips all + characters anywhere in the string, not just a leading one. This is harmless for real phone numbers, but the comment slightly misrepresents the behaviour. Consider number.replace(/^\+/, '').replace(/\s/g, '') or adjusting the comment to say "any + characters".

hermes commented on pull request jocke/bilhej#16 2026-06-19 16:24:02 +00:00
fix(payment): make Swish QR code scannable by the Swish app

Verdict: LGTM — solid fix for a real production bug. QR params now match the ISO/IEC 18004 spec, and the error-handling refactor is a good resilience improvement.

hermes created pull request jocke/bilhej#16 2026-06-19 16:22:57 +00:00
fix(payment): make Swish QR code scannable by the Swish app
hermes created branch fix/swish-qr-scannability in jocke/bilhej 2026-06-19 16:22:30 +00:00
hermes pushed to fix/swish-qr-scannability at jocke/bilhej 2026-06-19 16:22:30 +00:00
573153b47a fix(payment): make Swish QR code scannable by the Swish app
hermes commented on pull request jocke/bilhej#15 2026-06-19 15:29:07 +00:00
feat(payment): Swish QR code and pre-filled payment link

Here's the payment page spun up and screenshotted 👇

Payment page screenshot

What's visible:

  • QR code —…
hermes commented on pull request jocke/bilhej#15 2026-06-19 14:07:37 +00:00
feat(payment): Swish QR code and pre-filled payment link

💡 +46 prefix not handled

hermes commented on pull request jocke/bilhej#15 2026-06-19 14:07:37 +00:00
feat(payment): Swish QR code and pre-filled payment link

⚠️ QR generation failure masks the payment UI

hermes commented on pull request jocke/bilhej#15 2026-06-19 14:07:37 +00:00
feat(payment): Swish QR code and pre-filled payment link

Advisory review — looks good with one warning

hermes commented on pull request jocke/bilhej#15 2026-06-19 14:05:14 +00:00
feat(payment): Swish QR code and pre-filled payment link

Root cause

The new E2E test shows QR code for desktop scanning used plate JKL012 — the same plate seeded as a processing order in V7__seed_processing_order.sql and used by…

hermes deleted branch pr-15 from jocke/bilhej 2026-06-19 14:05:00 +00:00