#Joziel-checkout

1 messages ยท Page 1 of 1 (latest)

dusky kiln
#

@stuck owl yep, you wrote in to our support team so I saw this error there actually!

#

my guess is you have not set your API key, or the key you set in backend Node.js code and your frontend code are for two different accounts.

#

would you have a link to your website with steps where I can reproduce the problem directly?

stuck owl
#

It's weird because the customer portal opens normally: Menu > Subscription > Manage Subscription

#

Just checked my API keys (pk-live... & sk-live...) and they are set right.

magic nebula
#

@stuck owl Taking a look now -- sorry, missed your reply earlier

magic nebula
#

Looks like an issue related to how the redirect is occurring. The CheckoutSession is created properly and I can go directly to the Checkout hosted page without any issues from our side.

I wonder if there's a CORS error or similar issue being logged server side. Are you using a Wordpress plugin where you set your keys there, or are you doing it all in straight PHP?

stuck owl
#

I am using Firebase cloud functions. The code is Node.js

magic nebula
#

Ah OK, thought you were in WP based on that link with the same problem earlier. Got it.

stuck owl
#

I get no errors server side.

#

@magic nebula Could this be the CORS error?

magic nebula
stuck owl
#

I see. Do you know how I could stop getting this error? I opened the checkout hosted page successfully twice or more, but then I started getting this error after doing some tests with a credit card number provided at https://stripe.com/docs/testing

magic nebula
#

CORS can be tricky as the exact error message in the CORS error specifies what you have to change, and it's all on your server's configuration. https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors is a good starting point

Cross-Origin Resource Sharing (CORS) is a standard that allows a server to relax the same-origin policy. This is used to explicitly allow some cross-origin requests while rejecting others. For example, if a site offers an embeddable service, it may be necessary to relax certain restrictions. Setting up such a CORS configuration isn't necessarily...

stuck owl
#

So the problem would be with my internet provider? Since you were able to go to the checkout hosted page...

magic nebula
dusky kiln
#

it's not CORS

#

looks to me like you minified your code and it broke things since the API key you pass on the frontend is not correct

magic nebula
#

Good find!

dusky kiln
#

pkI163413570584951Jgs... is not a valid Stripe API key, it should look like pk_[test|live]_xxx

stuck owl
dusky kiln
#

so probably your minification is changing the string for some reason

stuck owl
#

I will fix it and see if it works, then I will let you know. Thank you.