Final
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
import Stripe from 'stripe';
|
||||
|
||||
if (!process.env.STRIPE_SECRET_KEY) {
|
||||
throw new Error('STRIPE_SECRET_KEY is not set');
|
||||
}
|
||||
// Use a placeholder during build time, real key at runtime
|
||||
const stripeKey = process.env.STRIPE_SECRET_KEY || 'sk_test_placeholder_for_build';
|
||||
|
||||
export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
|
||||
apiVersion: '2025-09-30.clover',
|
||||
export const stripe = new Stripe(stripeKey, {
|
||||
apiVersion: '2025-10-29.clover',
|
||||
typescript: true,
|
||||
});
|
||||
|
||||
// Runtime validation (will throw when actually used in production if not set)
|
||||
export function validateStripeKey() {
|
||||
if (!process.env.STRIPE_SECRET_KEY) {
|
||||
throw new Error('STRIPE_SECRET_KEY is not set');
|
||||
}
|
||||
}
|
||||
|
||||
export const STRIPE_PLANS = {
|
||||
FREE: {
|
||||
name: 'Free / Starter',
|
||||
|
||||
Reference in New Issue
Block a user