feat(checkout): pass locale and cancelUrl, expose the latest charge status #100

Sammanfogat
supernaut sammanfogade 2 incheckningar från feat/88-locale-cancel-status in i main 2026-10-06 08:43:36 +00:00
Ägare

The portal can now tell the checkout outcome apart and send the customer to Mollie in their language.

  • startCheckout input: locale?: "sv_SE" | "en_GB" and cancelUrl?. cancelUrl must be https with the same scheme and host as returnUrl, so it cannot become an open redirect. Both pass to Mollie payments.create on the auto and the one-time path, and are omitted when not given.
  • subscriptionStatus adds latestCharge: { status: "pending" | "paid" | "failed" | "canceled" | "expired"; at } | null for the newest charge.
  • The webhook stores the provider's final status in the new nullable charge.failure_reason (enum charge_failure, migration 0008). A null reason reads as failed. Money logic is unchanged.
  • Behaviour change: a first checkout that failed, was canceled or expired now returns status: "incomplete" with latestCharge set, where it returned null before. currentPeriodEnd, paidUntil and withdrawalDeadline are null in that state, and currentPeriodEnd is nullable in the contract. An open or refunded first payment still returns null.

Contract 0.7.0, service 0.6.0. Tests: 366 passed with Postgres.

Closes #88.

The portal can now tell the checkout outcome apart and send the customer to Mollie in their language. - `startCheckout` input: `locale?: "sv_SE" | "en_GB"` and `cancelUrl?`. `cancelUrl` must be https with the same scheme and host as `returnUrl`, so it cannot become an open redirect. Both pass to Mollie `payments.create` on the auto and the one-time path, and are omitted when not given. - `subscriptionStatus` adds `latestCharge: { status: "pending" | "paid" | "failed" | "canceled" | "expired"; at } | null` for the newest charge. - The webhook stores the provider's final status in the new nullable `charge.failure_reason` (enum `charge_failure`, migration `0008`). A null reason reads as `failed`. Money logic is unchanged. - Behaviour change: a first checkout that failed, was canceled or expired now returns `status: "incomplete"` with `latestCharge` set, where it returned null before. `currentPeriodEnd`, `paidUntil` and `withdrawalDeadline` are null in that state, and `currentPeriodEnd` is nullable in the contract. An open or refunded first payment still returns null. Contract 0.7.0, service 0.6.0. Tests: 366 passed with Postgres. Closes #88.
supernaut lade till 2 incheckningar 2026-10-06 08:41:01 +00:00
supernaut sammanfogade incheckning 7cd38d4e4a till main 2026-10-06 08:43:36 +00:00
Logga in för att delta i denna konversation.
Inga granskare
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!100
Ingen beskrivning angiven.