fix(billing): cancel a pending provider refund when a chargeback lands #153
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!153
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/141-cancel-pending-refund"
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?
fix(billing): cancel a pending provider refund when a chargeback lands
A withdrawal refund created at Mollie is held for about two hours. A chargeback in that window left the refund to execute, so the customer was paid twice.
applyChargebacknow checks each sent refund on the charge. If the provider reports it as pending, it calls the newcancelRefund, marks the refund failed and adds it tocancelledRefundIds. If the status isfailed(a replay after a rollback, when the provider already cancelled it), the refund is marked failed without a second cancel. If the status issucceeded, or the cancel throws, the existing "charged back after a refund" review flag stays as the fallback.PaymentProvider.cancelRefundadded, with the Mollie adapter (DELETE /v2/payments/{paymentId}/refunds/{refundId}) and the refuse stub.cancelSubscriptionalready does there.processingmaps topending. The cancel is refused there, so it falls back to the review flag.Closes #141
37a7ac22f65241d39329