We're facing a problem with Stripe API keys. What I've done so far is:
config/initializers/stripe.rb with the line Stripe.api_key = STRIPE_SECRETSTRIPE_PUBLIC and STRIPE_SECRET constants are set and visible. STRIPE_PUBLIC => "pk_test_xxxxxxxxx"However, once these things are in place, making a call to Stripe's API using the browser results in:
Stripe::AuthenticationError in some_controller#some_action
No API key provided. Set your API key using "Stripe.api_key = <API-KEY>". You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email [email protected] if you have any questions.
Using the web-console gem, we can tell that STRIPE_SECRET and STRIPE_PUBLIC are nil in the website. But every time we run rails console we get our keys from our constants.
I fixed my issue. The terminal running rails server had been opened since before the environment variables had been set.
Therefore, running source ~/.bashrc (for me) or using a new terminal worked for me.
Thank you, sincerely, to everyone who tried to help!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With