checkout: fetch the mandate, check its status and store the card expiry #84

Stängd
öppnade 2026-10-05 12:32:40 +00:00 av supernaut · 0 kommentarer
Ägare

Problem

completeCheckout never fetches the mandate. The payment_method row is written with status: "valid" hard-coded (src/billing.ts:619) and exp: "" (src/provider/mollie.ts:77-99, the comment there notes the expiry lives on the mandate).

So we neither confirm the mandate can be charged nor know when the card expires. The card-expiry warning and card replacement both need that date.

Mollie docs

Fix

In completeCheckout, call customerMandates.get(mandateId). Require valid or pending, otherwise fail the checkout the way the missing-mandate case does. Store the real mandate status and cardExpiryDate.

Done when

  • Unit tests: an invalid mandate fails the checkout; a valid card mandate stores its expiry.

Found in the Mollie docs audit of 2026-10-05.

## Problem `completeCheckout` never fetches the mandate. The `payment_method` row is written with `status: "valid"` hard-coded (`src/billing.ts:619`) and `exp: ""` (`src/provider/mollie.ts:77-99`, the comment there notes the expiry lives on the mandate). So we neither confirm the mandate can be charged nor know when the card expires. The card-expiry warning and card replacement both need that date. ## Mollie docs - Recurring: continue only if a mandate has `status` `valid` (cards) or `pending` (direct debit) (https://docs.mollie.com/docs/recurring-payments). - Get mandate: card details carry the expiry date in `YYYY-MM-DD` and the last four digits (https://docs.mollie.com/reference/get-mandate). ## Fix In `completeCheckout`, call `customerMandates.get(mandateId)`. Require `valid` or `pending`, otherwise fail the checkout the way the missing-mandate case does. Store the real mandate status and `cardExpiryDate`. ## Done when - Unit tests: an `invalid` mandate fails the checkout; a valid card mandate stores its expiry. Found in the Mollie docs audit of 2026-10-05.
supernaut lade till detta till projektet Bitborg Payment 2026-10-05 12:34:44 +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#84
Ingen beskrivning angiven.