fix: fail-closed 0pt Stripe payment and order transitions #66

Merged
siax-bot merged 0 commits from fix/stripe-webhook-no-ack-without-secret-wave47 into main 2026-09-16 22:00:28 +00:00
Owner

P0 live-payment preparation on fresh canonical main. This PR: (1) does not 200-ack unverified/unmatched Stripe webhooks; (2) binds deposit Checkout metadata to order_id/kind; (3) advances orders only after signed, paid, amount/currency-matching events; (4) never marks balance delivered merely on session creation; (5) removes UI demo fallback that PATCHed in_production after a failed Checkout; (6) requires verified auth on client status PATCH and balance Checkout, blocks client writes to payment-confirmed states, validates transitions, and uses compare-and-set updates. Verified locally: 1041 tests passed / 184 infra tests skipped, typecheck and production build passed; lint remains advisory with pre-existing unrelated errors. No live keys or customer payment state changed. STILL BLOCKED for live enablement: anonymous drafts are not bound to a verified buyer/tenant at checkout; a verified identity alone does not authorize a particular order, and current UI does not carry a production Zitadel session into these APIs. Track remaining owner-binding/SSO and staging paid/unpaid/cancelled E2E in issue #67. Requires independent review and green CI before merge. Stripe refs: https://docs.stripe.com/webhooks?lang=node and https://docs.stripe.com/api/checkout/sessions/create.

P0 live-payment preparation on fresh canonical main. This PR: (1) does not 200-ack unverified/unmatched Stripe webhooks; (2) binds deposit Checkout metadata to order_id/kind; (3) advances orders only after signed, paid, amount/currency-matching events; (4) never marks balance delivered merely on session creation; (5) removes UI demo fallback that PATCHed in_production after a failed Checkout; (6) requires verified auth on client status PATCH and balance Checkout, blocks client writes to payment-confirmed states, validates transitions, and uses compare-and-set updates. Verified locally: 1041 tests passed / 184 infra tests skipped, typecheck and production build passed; lint remains advisory with pre-existing unrelated errors. No live keys or customer payment state changed. STILL BLOCKED for live enablement: anonymous drafts are not bound to a verified buyer/tenant at checkout; a verified identity alone does not authorize a particular order, and current UI does not carry a production Zitadel session into these APIs. Track remaining owner-binding/SSO and staging paid/unpaid/cancelled E2E in issue #67. Requires independent review and green CI before merge. Stripe refs: https://docs.stripe.com/webhooks?lang=node and https://docs.stripe.com/api/checkout/sessions/create.
CODEOWNERS rules requested review from sax3l 2026-09-15 16:08:24 +00:00
admin changed title from fix: do not acknowledge unverified Stripe webhooks to fix: require matching paid Stripe events before order advancement 2026-09-15 16:15:54 +00:00
admin changed title from fix: require matching paid Stripe events before order advancement to fix: fail-closed 0pt Stripe payment and order transitions 2026-09-15 16:52:41 +00:00
siax-bot approved these changes 2026-09-15 19:18:26 +00:00
Dismissed
siax-bot left a comment
Collaborator

siax-bot: grön CI.

siax-bot: grön CI.
siax-bot approved these changes 2026-09-15 19:23:53 +00:00
Dismissed
siax-bot left a comment
Collaborator

siax-bot

siax-bot
siax-bot approved these changes 2026-09-16 21:43:33 +00:00
siax-bot left a comment
Collaborator

CI grön. Godkänner.

CI grön. Godkänner.
admin referenced this issue from a commit 2026-09-16 22:00:26 +00:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/0pt#66