#BinaryWritter-checkout-err
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Give me a moment to catch up and I'll respond as soon as I can ๐ Thanks
Thank you @cinder nimbus !!!
Feel free to share more about the error
Could it be that in Stripe product/subscriptions i have a currency of pesos and i got everything setup for us dollars? Right now im thinking about this
At subscriptions page i get this error, but i have looked at all my code and i have placed all keys of stripe v3:1 Uncaught (in promise) IntegrationError: Missing value for Stripe(): apiKey should be a string.
This is the subscription code
Is there a line number mentioned with the error?
Sorry i think the error is in the initStripe function of the pricing/subscription code, thats wheat the error says
Also i have a error in Subscriptions Stripe Dashboard that subscriptions are in mexican currency and i have all configured for us dollars
can you print process.env.SECRET_KEY before initStripe and see if you're seeing the right key being printed?
ok i will
The key is not displayed in console, i have all this new errors but i dont know how to fix them
The Hydration one repeats several times
I have googled for the error but havent found a solution
This error is also highlighted in pricing.js <button
className="py-4 bg-green-200 text-center"
onClick={() => processSubscription(plan.id)}
>
Subscribe
</button>
on the button onclick processSubscriptions(plan.id)
Sorry didnt sent as code
hold on, there's a lot going on here
First, You're trying to use your secret key on your front-end (which you really shouldn't as it can easily leak)
Second, initStripe would only work with publishable key
You can't fetch prices with publishable key, yes ๐
You'd want to move this method to your server-side code and then access its response by making a fetch from client-side code
Ok do you want me to show my subscriptions server code?
Not sure what that means but here's what needs to happen
- Subscription prices from Stripe can only be fetched using Secret key
- This request needs to come from your server-side code as using Secret key on client-side isn't recommended (due to security risk)
So
1/ You can move the code that's retrieving prices to your server-side logic
2/ Once it retrieves the prices, you return that as JSON
3/ Your client-side code makes a request to this route, takes that JSON and renders the list of subscriptions
does that help clarify?
Yes, thank you, thats all? I have seen examples of such a "method"