I want to create a checkout form with stripe using api and nextjs.
Documentation https://stripe.com/docs/api/checkout/sessions/create?lang=node
const stripe = require('stripe')('');
const session = await stripe.checkout.sessions.create({
success_url: 'https://example.com/success',
cancel_url: 'https://example.com/cancel',
line_items: [
{price: 'price_H5ggYwtDq4fbrJ', quantity: 2},
],
mode: 'payment',
});
when i run the code I get the following :
I also tried https://stackoverflow.com/a/74095665/18355976