Skip to content

Commit

Permalink
fix: detect stripe envs correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark committed Oct 6, 2024
1 parent 07d5b86 commit 10749fe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/billing/src/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ export function defaultProSubscriptions(): Subscriptions | null {
STRIPE_PRODUCT_ID_RATELIMITS: z.string(),
STRIPE_PRODUCT_ID_SUPPORT: z.string(),
});
const env = stripeEnv.parse(process.env);
if (!env) {
const env = stripeEnv.safeParse(process.env);
if (!env.success) {
return null;
}
return {
plan: {
productId: env.STRIPE_PRODUCT_ID_PRO_PLAN,
productId: env.data.STRIPE_PRODUCT_ID_PRO_PLAN,
cents: "2500", // $25
},
verifications: {
productId: env.STRIPE_PRODUCT_ID_KEY_VERIFICATIONS,
productId: env.data.STRIPE_PRODUCT_ID_KEY_VERIFICATIONS,
tiers: [
{
firstUnit: 1,
Expand All @@ -55,7 +55,7 @@ export function defaultProSubscriptions(): Subscriptions | null {
],
},
ratelimits: {
productId: env.STRIPE_PRODUCT_ID_KEY_VERIFICATIONS,
productId: env.data.STRIPE_PRODUCT_ID_KEY_VERIFICATIONS,
tiers: [
{
firstUnit: 1,
Expand Down

0 comments on commit 10749fe

Please sign in to comment.