2
0

feat: ️ Add docs and connect Stripe

This commit is contained in:
Baptiste Arnaud
2022-02-14 16:41:39 +01:00
parent aeb3e4caa7
commit 56bd5fafc3
50 changed files with 6332 additions and 685 deletions

View File

@ -20,9 +20,10 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
})
const session = await stripe.billingPortal.sessions.create({
customer: user.stripeId,
return_url: `${req.headers.origin}/account`,
return_url: req.headers.referer,
})
res.status(201).redirect(session.url)
res.redirect(session.url)
return
}
return methodNotAllowed(res)
}