fix(checkout): restrict the first payment to mandate-creating methods #98
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-payment!98
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/82-mandate-methods"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
The first payment set
sequenceType: firstbut nomethod, so a customer could pay with a method that creates no mandate. The payment was thenpaidwith an empty mandate,createSubscriptionfailed, and the customer paid without getting the plan.method: ["creditcard", "applepay"]. Per the Mollie docs, an array limits the hosted checkout to those methods, Google Pay runs insidecreditcard, and cards, Apple Pay and Google Pay all create acreditcardmandate.applyFirstPaymentrefunds such a payment in full through the existingclaimRefundpath and never creates a subscription, grants the tier or writes an invoice. The subscription staysincomplete, so the customer can check out again.succeededcharge returns early on a replayed webhook, the reconcile sweep treats it as settled, and the refund row's idempotency key stops a second refund.Tests: four new, failing before the fix. The billing test forces a webhook replay plus a reconcile pass and asserts exactly one refund. Full suite 315 passed against Postgres 17.
To confirm on staging: Mollie accepts the method array on a
firstpayment, and the hosted checkout shows only card and Apple Pay. Card and Apple Pay must be active on the profile.Version 0.4.1.
Closes #82.