fix(guest): make Swish QR scannable on guest payment page (#22) #25
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/guest-qr-scannability"
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?
Why
Issue #22: GuestPaymentRedirect.vue still used the old non-compliant QR settings (margin 2, #111827, width 224) that fail the Swish app's scanner on desktop. PaymentRedirect.vue was already fixed in commit
573153b, but the guest payment page was not updated.Changes
Test plan
npx vitest run src/__tests__/GuestPaymentRedirect.spec.ts— 16/16 passnpm run lint— cleanCloses #22
Looks good - solid fix. Two minor suggestions.
The PR correctly mirrors the Swish QR fix from
PaymentRedirect.vueintoGuestPaymentRedirect.vue. The QR generation options, explanatory comment, and CSS dimensions all match the reference implementation exactly.Critical
None.
Warnings
None.
Suggestions
The test asserts
margin,width, andcolorbut noterrorCorrectionLevel: 'M'. Since this is a new parameter that was absent in the old code, consider addingexpect(options.errorCorrectionLevel).toBe('M')to the spec to guard against silent regression if someone removes it.The QR options object is now duplicated verbatim between
GuestPaymentRedirect.vueandPaymentRedirect.vue. This exact duplication is how the original bug happened -PaymentRedirectwas fixed in commit573153bbutGuestPaymentRedirectwas missed. Extracting these options into a shared constant (e.g.,QR_OPTIONSin@/api/payment.ts) would prevent this class of drift from recurring.Looks Good
PaymentRedirect.vue(margin 4, width 288,errorCorrectionLevel: 'M', pure black on white)..payment__qr-imgdimensions updated from 224px to 288px in sync with the QR generation change.💡 Suggestion: The test asserts
margin,width, andcolorbut noterrorCorrectionLevel: 'M'. Consider addingexpect(options.errorCorrectionLevel).toBe('M')toGuestPaymentRedirect.spec.tsto guard against silent regression on this parameter.💡 Suggestion (DRY): The QR options object (
width,margin,errorCorrectionLevel,color) is now duplicated verbatim between this file andPaymentRedirect.vue. This duplication is how the original bug happened. Consider extracting a sharedQR_OPTIONSconstant (e.g., in@/api/payment.ts) so both payment pages use the same source of truth.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.