fix(billing): follow Mollie's next charge date after a retried renewal #138

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

Our period end and next charge date come from a fixed anchor (src/billing.ts:210-265, "The anchor never moves"; README lines 61-62). Mollie moves its schedule after a retried renewal:

In case of a successful retry, the next charge date will be updated according to the latest successful payment and the normal interval set by you.

https://docs.mollie.com/docs/recurring-payments

Failing case, monthly, anchor day 2:

  1. The Nov 2 renewal fails. The retry is paid on Nov 5. Our period ends Dec 1, Mollie charges next on Dec 5.
  2. nextCharge.on says Dec 2, so the 7-day reminder gives the wrong date.
  3. Dec 2 to 5 the subscription is past its period end but still active.
  4. Once Mollie's charge day sits 8 or more days past our anchor, the sweep ends access (8-day grace) before Mollie charges a working card.

Fix: after applying a renewal, read the Mollie subscription and set periodEnd from nextPaymentDate (Amsterdam midnight minus 1 ms). Use the same value for nextCharge.on. Keep the local calculation as the fallback. Correct the README.

Not verified: test mode cannot force a failed renewal, so the retry path is untested end to end.

Our period end and next charge date come from a fixed anchor (`src/billing.ts:210-265`, "The anchor never moves"; README lines 61-62). Mollie moves its schedule after a retried renewal: > In case of a successful retry, the next charge date will be updated according to the latest successful payment and the normal interval set by you. https://docs.mollie.com/docs/recurring-payments Failing case, monthly, anchor day 2: 1. The Nov 2 renewal fails. The retry is paid on Nov 5. Our period ends Dec 1, Mollie charges next on Dec 5. 2. `nextCharge.on` says Dec 2, so the 7-day reminder gives the wrong date. 3. Dec 2 to 5 the subscription is past its period end but still `active`. 4. Once Mollie's charge day sits 8 or more days past our anchor, the sweep ends access (8-day grace) before Mollie charges a working card. Fix: after applying a renewal, read the Mollie subscription and set `periodEnd` from `nextPaymentDate` (Amsterdam midnight minus 1 ms). Use the same value for `nextCharge.on`. Keep the local calculation as the fallback. Correct the README. Not verified: test mode cannot force a failed renewal, so the retry path is untested end to end.
supernaut lade till detta till projektet Bitborg Payment 2026-10-12 13:16:08 +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#138
Ingen beskrivning angiven.