This is my engine.rb file. I am able to access Figaro variable in the middleware. But the Stripe.api_key=Figaro.env.stripe_secret
is not working. Stripe api_key not set error is being shown .
module Stripo
require 'figaro'
class Engine < ::Rails::Engine
isolate_namespace Stripo
Stripe.api_key=Figaro.env.stripe_secret
middleware.use OmniAuth::Builder do
provider :stripe_connect, Figaro.env.client_id,Figaro.env.stripe_secret,:scope => 'read_write'
end
end
end
How can I set Stripe api_key from Figaro variable in my engine?