check file exists

This commit is contained in:
Rimian Perkins 2017-02-16 18:13:57 +11:00
parent 0e0b452626
commit d88b473af7
1 changed files with 6 additions and 6 deletions

View File

@ -1,14 +1,14 @@
if ENV['STRIPE_SECRET_KEY'].present?
Rails.configuration.stripe = {
:publishable_key => ENV['STRIPE_PUBLISHABLE_KEY'],
:secret_key => ENV['STRIPE_SECRET_KEY']
}
else
if File.exist?('config/stripe.yml')
Rails.configuration.stripe = {
:publishable_key => Rails.application.config_for(:stripe)['publishable_key'],
:secret_key => Rails.application.config_for(:stripe)['secret_key']
}
else
Rails.configuration.stripe = {
:publishable_key => ENV['STRIPE_PUBLISHABLE_KEY'],
:secret_key => ENV['STRIPE_SECRET_KEY']
}
end
Stripe.api_key = Rails.configuration.stripe[:secret_key]