#tonyp
1 messages · Page 1 of 1 (latest)
well the redirect isn't performed
Can you share the code that is causing the issue, and the exact error message you see?
exact same code as in the doc, but after the 302 I'm getting a CORS header « Access-Control-Allow-Origin » is missing
from https://billing.stripe.com/p/session/test_<sessionID>
May it be that I'm running on localhost ?
Can you copy-paste your code here?
`const portalSession = await stripe.billingPortal.sessions.create({
customer: customerId,
return_url: STRIPE_BILLING_PORTAL_SESSION_RETURN_URL
});
return res.redirect(portalSession.url)`
This is your backend code. And how to you call that code from the frontend?
through an axios post :
await axios.post(CREATE_PORTAL_ENPOINT, { userId })