diff --git a/config/initializers/stripe.rb b/config/initializers/stripe.rb new file mode 100644 index 00000000..22ff8359 --- /dev/null +++ b/config/initializers/stripe.rb @@ -0,0 +1,6 @@ +Rails.configuration.stripe = { + :publishable_key => ENV['STRIPE_PUBLISHABLE_KEY'] || Rails.application.secrets.stripe_publishable_key, + :secret_key => ENV['STRIPE_SECRET_KEY'] || Rails.application.secrets.stripe_secret_key +} + +Stripe.api_key = Rails.configuration.stripe[:secret_key] diff --git a/config/secrets.yml.example b/config/secrets.yml.example index 308bc858..8603a189 100644 --- a/config/secrets.yml.example +++ b/config/secrets.yml.example @@ -13,6 +13,11 @@ development: suse_key: 'sample' suse_secret: 'sample' + # Register on stripe and add TEST keys here + # https://dashboard.stripe.com/account/apikeys + stripe_publishable_key: '' + stripe_secret_key: '' + test: # Generate your own with rake secret # secret_key_base: '12345' @@ -56,3 +61,8 @@ production: # https://github.com/settings/applications github_key: '' github_secret: '' + + # Register on stripe and add LIVE keys here + # https://dashboard.stripe.com/account/apikeys + stripe_publishable_key: '' + stripe_secret_key: '' diff --git a/dotenv.example b/dotenv.example index 921020d1..ec2715ea 100644 --- a/dotenv.example +++ b/dotenv.example @@ -37,6 +37,11 @@ OSEM_FACEBOOK_SECRET='' OSEM_GITHUB_KEY='' OSEM_GITHUB_SECRET='' +# STRIPE Publishable/Secret keys +# test keys for development mode, live for production mode +STRIPE_PUBLISHABLE_KEY='' +STRIPE_SECRET_KEY='' + # Disable linting of factories in the test suite. # Speeds up turn around times of tests OSEM_FACTORY_LINT="false"