checkout: reuse the provider customer across attempts #118
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#118
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
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?
What
Every
startCheckoutcreates a new Mollie customer. Related: #85, #112, #113.Why
beginCheckoutsays the idempotency key lets a retry reuse the customer. The key ischargeId, a newrandomUUID()per call, so it never does. There is no erasure path for these customers yet. #85 also needs a stable customer.Failing case
Three checkout attempts leave three Mollie customers with the same name and email.
Fix
Store the provider customer ref on
customer. Reuse it. Create only when null. Update name and email at the provider when they change.Done when
Plan outline
customer.provider_customer_ref, coordinated with #113 and #112.ensureCustomer(ref | null, name, email)creates or updates.startCheckoutpasses the stored ref and persists a new one.payment_method.provider_data.customerIdwhere present.Folded into #144, which now also covers updating name and email at the provider, the backfill from
payment_method.provider_data.customerId, and unique subscription descriptions. Closing this one. Follow #144.