fix(billing): reuse one Mollie customer per customer #144
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#144
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?
customers.createruns on everybeginCheckoutwith idempotency key${chargeId}_c, andchargeIdis a new UUID per checkout (src/provider/mollie.ts:343-354,src/billing.ts:568,:630). The comment atmollie.ts:350says a retried checkout reuses the customer. It cannot. No Mollie customer id is stored on ourcustomerrow.Mollie:
https://docs.mollie.com/docs/recurring-payments
Seen on staging: two Mollie customers with the same
metadata.customerIdand no payments. Whenpayments.createis refused after the customer was created, that customer is orphaned too.Failing case: every abandoned or repeated checkout leaves another Mollie customer with name and email. An erasure request has to find each one by metadata.
Fix: add a nullable
provider_customer_reftocustomer. Create the Mollie customer only when it is null, then store and reuse it. Fix the comment.Also (folded in from #118). Related: #85, #112, #113.
provider_customer_reffrompayment_method.provider_data.customerIdwhere present.Done when: