feat(billing): keep chargeback evidence for every payment #107
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!107
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/chargeback-evidence"
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?
Refs #101
What
Keeps the evidence needed to answer a card chargeback, per payment.
charge: consent text version, time shown and page language (checkout charges), thenpaid_at,mandate_refandcard_security(Molliedetails.cardSecurity, so the first payment's 3-D Secure result) once paid. Renewals record paid time and mandate too.cancellation(new): each cancel and each withdrawal, with requested and effective time.chargebackEvidence(db, paymentRef)returns consent, renewal choice, interval, first payment, cancellations and charge history for one payment.consentonstartCheckout(text,shownAt,languagesv or en). Contract 0.8.0, service 0.7.0. Migration 0009 is additive.Not done
consent. Until it does, new charges have no consent and the issue stays open.Tests
Unit tests cover consent at checkout, cancel and withdrawal rows, renewal charge fields, the Mollie adapter fields and the assembled evidence for a renewal chargeback. Full suite runs against Postgres 17.
Follow-up commit
paid_at,mandate_refandcard_securityunchanged; a repeated withdraw adds no row; cancel then withdraw gives two rows; the refund path without a reusable method records evidence.Follow-up commits
Store the consent text as shown, keyed by its hash
consent.textVersionbecomesconsent.text(1 to 2000 characters), withlanguageandshownAtunchanged. The contract stays at 0.8.0.consent_text.charge.consent_text_hashpoints at it, andchargebackEvidencereturns the full text.Snapshot the evidence on each chargeback
chargebackEvidencefor the payment is stored in the newchargeback.evidencecolumn (jsonb), in the same transaction. This also covers a reversal that arrives first.evidence not storedreview. The chargeback is still applied.needs manual reviewline says when the evidence is on the row.SELECT evidence FROM chargeback WHERE provider_ref = '<id>';. Evidence is kept seven years with the invoice records.