File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
app/api/billing/webhooks/stripe Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export async function POST(request: NextRequest) {
2424 return NextResponse.json({ error: 'Missing Stripe signature' }, { status: 400 })
2525 }
2626
27- if (!env.STRIPE_WEBHOOK_SECRET ) {
27+ if (!env.STRIPE_BILLING_WEBHOOK_SECRET ) {
2828 logger.error('Missing Stripe webhook secret configuration')
2929 return NextResponse.json({ error: 'Webhook secret not configured' }, { status: 500 })
3030 }
@@ -43,7 +43,7 @@ export async function POST(request: NextRequest) {
4343 // Verify webhook signature
4444 let event: Stripe.Event
4545 try {
46- event = stripe.webhooks.constructEvent(body, signature, env.STRIPE_WEBHOOK_SECRET )
46+ event = stripe.webhooks.constructEvent(body, signature, env.STRIPE_BILLING_WEBHOOK_SECRET )
4747 } catch (signatureError) {
4848 logger.error('Invalid Stripe webhook signature', {
4949 error: signatureError,
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export const env = createEnv({
1717
1818 POSTGRES_URL: z.string().url().optional(),
1919 STRIPE_SECRET_KEY: z.string().min(1).optional(),
20+ STRIPE_BILLING_WEBHOOK_SECRET: z.string().min(1).optional(),
2021 STRIPE_WEBHOOK_SECRET: z.string().min(1).optional(),
2122 STRIPE_FREE_PRICE_ID: z.string().min(1).optional(),
2223 FREE_TIER_COST_LIMIT: z.number().optional(),
You can’t perform that action at this time.
0 commit comments