18 lines
447 B
JavaScript
18 lines
447 B
JavaScript
|
|
import Stripe from 'stripe';
|
||
|
|
|
||
|
|
if (!process.env.STRIPE_SECRET_KEY) {
|
||
|
|
throw new Error('STRIPE_SECRET_KEY environment variable is required');
|
||
|
|
}
|
||
|
|
|
||
|
|
// Initialize Stripe with secret key
|
||
|
|
export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY, {
|
||
|
|
apiVersion: '2024-12-18.acacia',
|
||
|
|
});
|
||
|
|
|
||
|
|
// Webhook configuration
|
||
|
|
export const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET;
|
||
|
|
|
||
|
|
console.log('✅ Stripe client initialized');
|
||
|
|
|
||
|
|
export default stripe;
|