Repository navigation
fix(billing): tighten self-serve checkout and Enterprise reconciliation - #10470
Conversation
- checkout refuses Enterprise in any casing, caller-supplied subscription metadata, and seat counts outside 1..1000; the Stripe plugin is no longer offered the Enterprise plan - Enterprise reconciliation skips subscriptions created by self-serve checkout - an organization checkout checks membership before any billing state - the usage callback answers a failed internal auth with a constant message
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
A refused hosted key is the payer's plan, not a fault, and logging it at error hid real key resolution failures among retry loops of expected refusals.
[High impact] The PR appears safe to merge; no actionable issues were found. SummaryTightens self-serve checkout and separates it from Enterprise billing.
No new actionable issues were found in the changes since the previous review. No previous finding threads were supplied. Tests were not run during this review. Reviews (2) · Last reviewed commit: "fix(billing): log a free payer's hosted-..." · Reviewed by Greptile |
There was a problem hiding this comment.
Review completed against the latest diff
This PR changes payment, billing, or quota logic. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
Turn on auto-fix | Re-trigger cubic
Summary
/subscription/upgrade) refuses Enterprise in any casing with a 400 (fix(billing): refuse self-serve Enterprise checkout with a client error #10469 covered the exact name), before taking the checkout admission claim. Enterprise is issued by the team with its own Stripe price and terms, and naming it in checkout used to end in a 500 from the Enterprise metadata constraint/api/billing/update-costanswers a failed internal auth with a constantUnauthorizedType of Change
Testing
enterprise-missing-organization.integration.ts(real Postgres, real Better Auth Stripe webhook): a self-serve checkout subscription whose metadata claims Enterprise terms stays on its checked-out plan. Fails without the reconciliation guardauthorization.test.ts: Enterprise refused in three casings, metadata refused, five bad seat values refused, Pro/Team admitted, non-member refused without any billing-state reads. Each fails with its guard revertedupdate-cost/route.test.ts,enterprise.test.ts,providers/index.test.ts,execute-workflow.test.tscheck:api-validation:strict,check:test-patterns,check:comment-hygiene,check:explicit-any,check:source-conventionsChecklist
test-auditauthoring gate)