#Joziel-checkout
1 messages ยท Page 1 of 1 (latest)
@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?
๐
Yes. Thank you.
1: Go to https://jodimnotes.com/
2: Log in: Email: stripetest@jodimnotes.com Password: 123456
3: Menu > Subscription > Subscribe
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.
Found some people with the same problem apparently: https://wordpress.org/support/topic/stripe-payment-error-4/
@stuck owl Taking a look now -- sorry, missed your reply earlier
No problem. Thanks.
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?
I am using Firebase cloud functions. The code is Node.js
Ah OK, thought you were in WP based on that link with the same problem earlier. Got it.
Highly likely. A 401 error is usually what you get if there are CORS issues.
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
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...
So the problem would be with my internet provider? Since you were able to go to the checkout hosted page...
It's something outside of Stripe -- first place I'd check is Firebase like in https://stackoverflow.com/questions/42755131/enabling-cors-in-cloud-functions-for-firebase (that's just an example of how CORS setup in Firebase can be done)
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
Good find!
pkI163413570584951Jgs... is not a valid Stripe API key, it should look like pk_[test|live]_xxx
Oh, that's it, lol, sorry guys.๐
so probably your minification is changing the string for some reason
I will fix it and see if it works, then I will let you know. Thank you.