#BinaryWritter-checkout-err

1 messages ยท Page 1 of 1 (latest)

cinder nimbus
#

Hello ๐Ÿ‘‹
Give me a moment to catch up and I'll respond as soon as I can ๐Ÿ™‚ Thanks

floral sage
#

Thank you @cinder nimbus !!!

cinder nimbus
#

Feel free to share more about the error

floral sage
#

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.

cinder nimbus
#

Is there a line number mentioned with the error?

floral sage
#

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

cinder nimbus
#

can you print process.env.SECRET_KEY before initStripe and see if you're seeing the right key being printed?

floral sage
#

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

cinder nimbus
#

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

floral sage
#

Oh didnt knew that

#

I have changed it to publichable key and it throws this error

cinder nimbus
#

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

floral sage
#

Ok do you want me to show my subscriptions server code?

cinder nimbus
#

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?

floral sage
#

Yes, thank you, thats all? I have seen examples of such a "method"

cinder nimbus
#

yes, that should help resolve the issue you were having with the apiKey ๐Ÿ™‚

#

I need to step away now but @west swan can help with any follow ups

floral sage
#

Thank you!! Right now its not needed further assistance, i need to make the modifications

#

Thank you very much again @cinder nimbus !!!