Skip to content

Commit 8c8b9f6

Browse files
committed
fix: update stripeService with new subscription tier IDs
- Update STRIPE_PRICE_IDS to use new tiers (explorer, member, pro, developer, startup) - Improve getStripePriceId to check plan's stripePriceId property first
1 parent 05ee842 commit 8c8b9f6

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/services/stripeService.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ export const getStripe = () => {
2323
};
2424

2525
// Stripe Price IDs (these should match your Stripe Dashboard)
26+
// Maps to new subscription tiers: explorer, member, pro, developer, startup
2627
export const STRIPE_PRICE_IDS = {
27-
essential: import.meta.env.VITE_STRIPE_PRICE_ESSENTIAL || 'price_essential_monthly',
28-
standard: import.meta.env.VITE_STRIPE_PRICE_STANDARD || 'price_standard_monthly',
29-
premium: import.meta.env.VITE_STRIPE_PRICE_PREMIUM || 'price_premium_monthly',
28+
explorer: import.meta.env.VITE_STRIPE_PRICE_EXPLORER || 'price_explorer_2026',
29+
member: import.meta.env.VITE_STRIPE_PRICE_MEMBER || 'price_member_2026',
30+
pro: import.meta.env.VITE_STRIPE_PRICE_PRO || 'price_pro_2026',
31+
developer: import.meta.env.VITE_STRIPE_PRICE_DEVELOPER || 'price_developer_2026',
32+
startup: import.meta.env.VITE_STRIPE_PRICE_STARTUP || 'price_startup_2026',
3033
} as const;
3134

3235
export interface StripeCustomer {
@@ -229,6 +232,12 @@ export function getPlanByStripePrice(priceId: string) {
229232
}
230233

231234
export function getStripePriceId(planId: string): string | null {
235+
// First check if plan has stripePriceId defined
236+
const plan = subscriptionPlans.find(p => p.id === planId);
237+
if (plan?.stripePriceId) {
238+
return plan.stripePriceId;
239+
}
240+
// Fall back to STRIPE_PRICE_IDS mapping
232241
return STRIPE_PRICE_IDS[planId as keyof typeof STRIPE_PRICE_IDS] || null;
233242
}
234243

0 commit comments

Comments
 (0)