This commit is contained in:
greeneclipse committed 2026-08-16 11:37:42 +02:00
1 parent dc9ea628c1
commit 52f27e30fc
26 files changed
+1137 -56

No files matched your search

+11
View File
@@ -19,6 +19,17 @@ export type StripeStatus = {
subscription_status?: string;
};
/** Live Stripe for all company admins; mock checkout only for platform admins. */
export function canSelfServePurchase(
stripe: StripeStatus | null | undefined,
opts?: { isPlatformAdmin?: boolean }
): boolean {
if (!stripe) return false;
if (stripe.configured && !stripe.mock) return true;
if (stripe.mock && opts?.isPlatformAdmin) return true;
return false;
}
export type CheckoutResult = {
url: string;
mock?: boolean;