#faz919-portal-sessions

1 messages · Page 1 of 1 (latest)

heavy lintel
#

What version of stripe-node are you using?

round holly
#

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

heavy lintel
#

billingPortal was added in 8.45.0

round holly
#

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?

heavy lintel
#

Your code is right

#

Just the version of stripe-node you had installed/imported didn't have those methods

round holly
#

ah ok

heavy lintel
#

Should work now

round holly
#

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.

heavy lintel
#

Yep, you can't really use res.redirect() with fetch (or similar)

round holly
#

using axios.post, is that similar

#

what's the replacement for res redirect in that case

heavy lintel
#

Return some JSON to your frontend and use window.location.assign()

round holly
#

ok thanks