fix(billing): cancel a pending provider refund when a chargeback lands #141
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#141
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?
applyChargeback(src/billing.ts:1247-1257) cancels only refunds with noproviderRefundRef. A refund already created at Mollie but not yet executed is only flagged for review (:1262-1270).Mollie:
https://docs.mollie.com/reference/cancel-refund
Failing case: a withdrawal refund is created at T. A chargeback lands at T+30 min. Unless someone cancels the refund by hand within the next 90 minutes, the customer is paid twice.
Fix: add
provider.cancelRefund. InapplyChargeback, for a sent refund whose Mollie status isqueuedorpending, cancel it, mark it failed and add it tocancelledRefundIds. Keep the review flag as the fallback when the cancel fails.