I work in a development environment.
I have a stripe.rb file in / config / initializers whose contents are:
Rails.configuration.stripe = {
:publishable_key => ENV['PUBLISHABLE_KEY'],
:secret_key => ENV['SECRET_KEY']
}
Stripe.api_key = Rails.configuration.stripe[:secret_key]
I tried to place them there (in ENV ['key-here']), but Stripe does not recognize them and returns an error.
To make it work, I pass them before starting my rails server:
PUBLISHABLE_KEY=pk_test_XXXXXXXXXXXXX SECRET_KEY=sk_test_XXXXXXXXXXXX rails s
Where to place these values in a Rails application? (since I will start production soon)
thank
source
share