Skip to content

Commit f6d33fc

Browse files
committed
Adds allow_promotion_codes to checkout session creation.
1 parent 144f29f commit f6d33fc

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • apps/web/app/api/stripe/checkout

apps/web/app/api/stripe/checkout/route.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ export async function POST(request: NextRequest) {
1616

1717
const data = await request.json();
1818
const { priceId } = checkoutSchema.parse(data);
19-
19+
2020
// Create checkout session
2121
const session = await stripe.checkout.sessions.create({
2222
payment_method_types: ['card'],
23+
allow_promotion_codes: true,
2324
line_items: [
2425
{
2526
price: priceId,
@@ -39,8 +40,8 @@ export async function POST(request: NextRequest) {
3940
}
4041
console.error('Stripe checkout error:', error);
4142
return NextResponse.json(
42-
{ error: 'Failed to create checkout session' },
43+
{ error: 'Failed to create checkout session' },
4344
{ status: 500 }
4445
);
4546
}
46-
}
47+
}

0 commit comments

Comments
 (0)