Repository navigation
fix(billing): refuse Stripe checkout for AWS Marketplace-billed customers - #9748
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Medium impact] The PR appears safe to merge; no actionable new issues were found. SummaryBlocks Stripe checkout for accounts and organizations with pending or active AWS Marketplace licenses.
|
…mers AWS bills a Marketplace customer, and AWS's SaaS guidelines require a listed product to be billed entirely through its Marketplace dimensions. A Marketplace-billed organization or account looks Free to Stripe, so a Stripe checkout would start a second, real subscription. Until now only a client gate stood in the way, and it failed open: a failed license lookup reported "not Marketplace-billed" and showed Stripe plans, with no retry short of a reload. Server: authorizeSubscriptionReference (organization references) and assertPersonalCheckoutAllowed (personal references) now refuse an upgrade with 409 when the reference holds a Marketplace license that is not inactive, only where AWS_MARKETPLACE_PRODUCT_CODE is set. The personal check lives in assertPersonalCheckoutAllowed because the Better Auth Stripe plugin never calls authorizeReference for a personal reference, so a check there would never run for one. Other actions, and staff Enterprise provisioning, are unaffected. Client: useAwsMarketplaceBilling exposes isResolved, isError, isRetrying and retry, and an unknown billing state now gates plan changes. The billing page hides "Explore plans" until the lookup resolves; the upgrade page shows "Workspace plans unavailable" with a "Try again" chip when the lookup fails.
waleedlatif1
force-pushed
the
fix/marketplace-billing-gate
branch
from
November 6, 2026 20:00
49fd889 to
7e8f519
Compare
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
authorizeSubscriptionReference.assertPersonalCheckoutAllowed, because the Stripe plugin skipsauthorizeReferencefor personal checkouts.upgrade-subscriptionis affected: billing portal, cancel and list still work, and staff Enterprise provisioning uses a separate path.AWS_MARKETPLACE_PRODUCT_CODEis unset, so self-hosted and non-prod are unchanged.Type of Change
Testing
checkout-guard.integration.ts(real Postgres), 9 pass:hooks/queries/aws-marketplace.test.tsx, 2 pass: a rejected lookup leaves billing unresolved, and[]resolves it as not Marketplace-billed. The existingauthorization.test.tsstill passes.tsc --noEmit -p apps/sim,bun run lint, plus source-conventions, api-validation:strict, boundaries, react-query, client-boundary, comment-hygiene, test-patterns, explicit-any and utils.Checklist
test-auditauthoring gate)