checkout: restrict the first payment to mandate-creating methods #82

Stängd
öppnade 2026-10-05 12:32:37 +00:00 av supernaut · 1 kommentar
Ägare

Problem

The first payment sets sequenceType: first but no method (src/provider/mollie.ts:309-319). Mollie only creates a mandate for cards (including Apple Pay and Google Pay), PayPal and SEPA direct debit. If the website profile has any other method enabled, a customer can pay with it.

The payment is then paid with no mandate. paymentMethodFrom returns mandateId: "" (mollie.ts:85) and createSubscription sends that empty mandate to Mollie. The activation step then fails, so the customer has paid but gets no tier_pro, and reconciliation keeps replaying it.

Mollie docs

Fix

  • Send method: ["creditcard"] on the first payment (or the exact recurring-capable set we decide to offer).
  • In completeCheckout, treat a paid payment with no mandateId as a failed checkout: refund it and log it. Never call createSubscription with an empty mandate.
  • Check which methods the Mollie profile has enabled for SEK.

Done when

  • A unit test proves a paid first payment without a mandate is refunded and never activated.
  • Staging checkout offers only the allowed methods.

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

## Problem The first payment sets `sequenceType: first` but no `method` (`src/provider/mollie.ts:309-319`). Mollie only creates a mandate for cards (including Apple Pay and Google Pay), PayPal and SEPA direct debit. If the website profile has any other method enabled, a customer can pay with it. The payment is then `paid` with no mandate. `paymentMethodFrom` returns `mandateId: ""` (`mollie.ts:85`) and `createSubscription` sends that empty mandate to Mollie. The activation step then fails, so the customer has paid but gets no `tier_pro`, and reconciliation keeps replaying it. ## Mollie docs - Create payment: `method` can "limit customer choices" (https://docs.mollie.com/reference/create-payment). - Recurring: only cards, PayPal and SEPA direct debit methods create mandates (https://docs.mollie.com/docs/recurring-payments). ## Fix - Send `method: ["creditcard"]` on the first payment (or the exact recurring-capable set we decide to offer). - In `completeCheckout`, treat a paid payment with no `mandateId` as a failed checkout: refund it and log it. Never call `createSubscription` with an empty mandate. - Check which methods the Mollie profile has enabled for SEK. ## Done when - A unit test proves a paid first payment without a mandate is refunded and never activated. - Staging checkout offers only the allowed methods. Found in the Mollie docs audit of 2026-10-05. Go-live blocker.
supernaut lade till detta till projektet Bitborg Payment 2026-10-05 12:34:42 +00:00
Upphovsperson
Ägare

Profile methods as of 2026-10-05: Swish and Pay by Bank are active. Cards, Apple Pay and Google Pay are being validated.

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

  • Cards, including Apple Pay and Google Pay, create a creditcard mandate. This is the only mandate type usable for SEK renewals.
  • Pay by Bank creates a directdebit mandate. SEPA Direct Debit charges EUR only, so it cannot carry SEK renewals. It also needs SEPA Direct Debit enabled on the profile.
  • Swish creates no mandate.

So the allowed set for the first payment is cards plus Apple Pay and Google Pay. Confirm the exact method values against the create-payment reference: creditcard, applepay, and whether Google Pay has its own value or runs inside creditcard.

Until this lands and cards are active, a checkout shows only Swish and Pay by Bank. Every paid checkout would then hit the no-mandate path. Prod is safe while billing_payments_enabled is false. The staging test run needs this issue fixed first.

Profile methods as of 2026-10-05: Swish and Pay by Bank are active. Cards, Apple Pay and Google Pay are being validated. Per https://docs.mollie.com/docs/recurring-payments: - Cards, including Apple Pay and Google Pay, create a `creditcard` mandate. This is the only mandate type usable for SEK renewals. - Pay by Bank creates a `directdebit` mandate. SEPA Direct Debit charges EUR only, so it cannot carry SEK renewals. It also needs SEPA Direct Debit enabled on the profile. - Swish creates no mandate. So the allowed set for the first payment is cards plus Apple Pay and Google Pay. Confirm the exact `method` values against the create-payment reference: `creditcard`, `applepay`, and whether Google Pay has its own value or runs inside `creditcard`. Until this lands and cards are active, a checkout shows only Swish and Pay by Bank. Every paid checkout would then hit the no-mandate path. Prod is safe while `billing_payments_enabled` is false. The staging test run needs this issue fixed first.
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#82
Ingen beskrivning angiven.