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
{{ message }}
Repository navigation
Commit dd2a2cc
Browse filesBrowse the repository at this point in the historyBrowse files
fix(billing): refuse Stripe checkout for AWS Marketplace-billed customers
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.
? `Plans for ${hostContext.workspace.name} are managed by its organization administrators. Contact an organization admin to change this workspace’s plan.`
93
92
: `Only the owner of ${hostContext.workspace.name} can change this workspace’s plan.`
93
+
: state.billedThroughMarketplace
94
+
? 'Your subscription is billed through AWS Marketplace, so plans can’t be changed here.'
95
+
: 'We couldn’t confirm how this workspace is billed.'
0 commit comments