fix(billing): flag a refund that fails at the provider #154
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!154
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/140-refund-failed-flag"
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
A refund that reaches
failedat Mollie now logs[reconcile] refund <id> failed at the provider; customer still owed; needs manual review.Why
Nothing flagged it. The refund cannot be issued again:
claimRefundkeys on charge and amount, and the adapter returns the failed Mollie refund for that key. The customer stayed owed with no signal.How
flagIfReowedbecomesflagFailedRefund. It logs, then flags a re-owed chargeback as before.failedcall it:issueRefundand the sweep. Both move frompending, so it logs once per refund.BillingReconcileManualReviewmatcher (\[reconcile\].*needs manual review).status = pendingand logs only when a row moved. A refund another writer already moved does not log, and concurrent sweeps cannot log twice.Tests
Four new tests: failure on issue, failure seen by the sweep (logged once over two sweeps), a refund already moved by another writer, and an open chargeback. The last two fail without the guards.
Test harness
The test pool also gets an
errorlistener. pg-pool re-emits an idle client's error on the pool, so the57P01fromDROP DATABASE ... WITH (FORCE)could still fail a run after every test passed.Closes #140
97b3100702dbd0232a23