fix(billing): cancel a pending provider refund when a chargeback lands #141

Stängd
öppnade 2026-10-12 13:14:58 +00:00 av supernaut · 0 kommentarer
Ägare

applyChargeback (src/billing.ts:1247-1257) cancels only refunds with no providerRefundRef. A refund already created at Mollie but not yet executed is only flagged for review (:1262-1270).

Mollie:

Refunds will be executed with a delay of two hours. Until that time, refunds may be canceled manually via the Mollie Dashboard, or by using this endpoint.

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. In applyChargeback, for a sent refund whose Mollie status is queued or pending, cancel it, mark it failed and add it to cancelledRefundIds. Keep the review flag as the fallback when the cancel fails.

`applyChargeback` (`src/billing.ts:1247-1257`) cancels only refunds with no `providerRefundRef`. A refund already created at Mollie but not yet executed is only flagged for review (`:1262-1270`). Mollie: > Refunds will be executed with a delay of two hours. Until that time, refunds may be canceled manually via the Mollie Dashboard, or by using this endpoint. 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`. In `applyChargeback`, for a sent refund whose Mollie status is `queued` or `pending`, cancel it, mark it failed and add it to `cancelledRefundIds`. Keep the review flag as the fallback when the cancel fails.
supernaut lade till detta till projektet Bitborg Payment 2026-10-12 13:16:10 +00:00
Logga in för att delta i denna konversation.
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-payment#141
Ingen beskrivning angiven.