Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(billing): narrow Stripe customer id before BAA purchase

Richie McIlroy4cfc5423d756
diff --git a/apps/web/actions/organization/signed-baa.ts b/apps/web/actions/organization/signed-baa.ts
index 50b0dc9e4..e25faa6c2 100644
--- a/apps/web/actions/organization/signed-baa.ts
+++ b/apps/web/actions/organization/signed-baa.ts
@@ -292,12 +292,12 @@ export async function purchaseSignedBaa(
const { user } = await getOwnerContext(organizationId);
const priceId = getBaaPriceId();
- if (!ownerCanPurchaseSignedBaa(user)) {
+ const customerId = user.stripeCustomerId;
+ if (!customerId || !ownerCanPurchaseSignedBaa(user)) {
throw new Error(
"Your organization needs an active Cap Pro subscription before adding the Signed BAA add-on.",
);
}
- const customerId = user.stripeCustomerId;
const [existing] = await db()
.select()