const response = await fetch('https://api.stripe.com/v1/billing_portal/sessions', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.STRIPE_SECRET_KEY}`,
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
customer: stripeId,
return_url: returnUrl
})
});
const response = await fetch('https://api.stripe.com/v1/billing_portal/sessions', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.STRIPE_SECRET_KEY}`,
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
customer: stripeId,
return_url: returnUrl
})
});