You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(payments): harden Comgate first-checkout and renumber migration
Extract resolveComgateCheckoutIdentity so first-purchase webhooks resolve
the user from payment_checkout_sessions (migration 0010). Fail closed if
the pending session cannot be persisted at checkout. Align docs/tests for
past_due on payment.failed and renumber settings migration to 0056 to
avoid colliding with 0045_native_clients.
Co-authored-by: Jakub Doboš <kubo6472@users.noreply.github.com>
Copy file name to clipboardExpand all lines: packages/payments/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ This draft therefore never promises native Apple/Google Pay; checkout always red
68
68
69
69
## Comgate draft behaviour
70
70
71
-
1.**Checkout** — `POST /api/payments/payment` creates a Comgate payment with `initRecurring=true` and returns a `redirect` URL. A pending row in `payment_checkout_sessions` (keyed by `refId` / `transId`) stores the user and plan until the webhook fires.
71
+
1.**Checkout** — `POST /api/payments/payment` creates a Comgate payment with `initRecurring=true` and returns a `redirect` URL. A pending row in `payment_checkout_sessions` (table from migration `0010_gocardless_payments.sql`; keyed by `refId` / `transId`) stores the user and plan until the webhook fires. Checkout fails closed if that row cannot be written.
72
72
2.**Webhook** — Comgate sends **POST** callbacks with a `secret` field. The Worker verifies the secret, re-fetches status via `/v1.0/status`, and resolves the paying user from the pending checkout session (first purchase) or an existing subscription row (renewals).
73
73
3.**Cancel** — `POST /v1.0/cancel` on the stored `provider_subscription_id` (Comgate `transId`).
74
74
4.**Failed renewal** — maps to `past_due` (same grace-period policy as GoPay), not immediate cancellation.
0 commit comments