#faz919-portal-sessions
1 messages · Page 1 of 1 (latest)
My package.json has a stripe version 8.32.0, I don't have stripe-node imported though
is that a requirement
for reference i have already run npm install stripe --save
Well, that is stripe-node: https://github.com/stripe/stripe-node
I think you just need to upgrade: https://github.com/stripe/stripe-node/blob/master/CHANGELOG.md#8450---2020-04-22
billingPortal was added in 8.45.0
sooo npm install stripe@latest --save?
just did that i'm now on 8.208.0
how do i import a billingportal in the new format?
Your code is right
Just the version of stripe-node you had installed/imported didn't have those methods
ah ok
Should work now
just tried and i'm getting the following error in console:
Failed to load resource: net::ERR_CONNECTION_REFUSED createError.js:16 Uncaught (in promise) Error: Network Error at createError (createError.js:16:1) at XMLHttpRequest.handleError (xhr.js:117:1)
ah nevermind it was some other package blocking it
Access to XMLHttpRequest at 'https://billing.stripe.com/session/test_xxxxx' (redirected from 'http://localhost:3000/portal') from origin 'http://localhost:4242' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Yep, you can't really use res.redirect() with fetch (or similar)
using axios.post, is that similar
what's the replacement for res redirect in that case
Return some JSON to your frontend and use window.location.assign()
ok thanks