#ericrueter_22046
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ericrueter_22046, 9 hours ago, 41 messages
When you say "checkout.js" do you mean that you are following one of our docs that has a file named "checkout.js" or are you importing checkout.js directly from Stripe (as opposed to stripe.js)
Also typically this is done with environmental variables, so you'lneed to look up how to do that wt
I am following one of your examples - https://stripe.com/docs/checkout/embedded/quickstart ... Alex helped me a lot last night to narrow down my problem. This morning after staying up until 02:00, I figured out that the js was not reloading, and I then figured out how to cause it to reload every time. I tried to use php variables, but that does not seem to work - at least the way I was trying. Is that what you mean by environmental variables?
I more mean something like this https://www.php.net/manual/en/reserved.variables.environment.php
Where you would store the config in a file
It really is up to you but basically you need to figure out some way for your program to look up the right key by user and then pass that to Stripe
My program does look up the correct key, and worked just fine until I changed to the newer APIs. Is it STRIPE's policy to hardcode API keys in the programs? There surely is an easy way to do this, I just am new to JavaScript and I am looking for some guidance.
No, we reccommend against hardcoding API keys, especially secret ones
It all depends on your usecase and what you are trying to do
For frontend, you will want to look in to putting a PHP variable in to your js code. That idea can be called a lot of different things depending on your setup but usually I think it is called a template variable
Like so https://stackoverflow.com/questions/6260902/how-to-pass-variable-from-php-template-to-javascript
But unfortunately we are beyond what I can guide you on here. This server mostly knows about Stripe's APIs and client libraries, implimentation details beyond that, like how to manage your keys, is up to your integration to impliment