Files
openfoodnetwork/config/initializers/stripe.rb
2018-09-30 16:10:57 -04:00

17 lines
727 B
Ruby

# Add some additional properties, to allow us to access these
# properties from the object, rather than calling from ENV directly.
# This is mostly useful for stubbing when testing, but also feels
# a bit cleaner than accessing keys in different ways.
module Stripe
class << self
# Returns the value of Stripe.publishable_key and Stripe.endpoint_secret.
# Attribute values can also be set by doing Stripe.publishable_key = <your_new_value>
attr_accessor :publishable_key, :endpoint_secret
end
end
Stripe.api_key = ENV['STRIPE_INSTANCE_SECRET_KEY']
Stripe.publishable_key = ENV['STRIPE_INSTANCE_PUBLISHABLE_KEY']
Stripe.client_id = ENV['STRIPE_CLIENT_ID']
Stripe.endpoint_secret = ENV['STRIPE_ENDPOINT_SECRET']