diff options
author | jessib <jessib@riseup.net> | 2013-08-08 11:56:12 -0700 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2013-08-08 11:56:12 -0700 |
commit | 8d9d7b369d99b40d709ac49b124f8c3f67579202 (patch) | |
tree | f1ad7d635fbe4baf1b3ac70f839c2e60a2441392 /billing/config | |
parent | d4283be8b1e33d30d2a1c0f638a713c5e81cc916 (diff) | |
parent | 19c825d3074784228c6cace41dfb595d715686ec (diff) |
Merge pull request #1 from azul/braintree_conf_from_file
Read Braintree config from file
Diffstat (limited to 'billing/config')
-rw-r--r-- | billing/config/initializers/braintree.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/billing/config/initializers/braintree.rb b/billing/config/initializers/braintree.rb index 523dbce..d6ae565 100644 --- a/billing/config/initializers/braintree.rb +++ b/billing/config/initializers/braintree.rb @@ -1,11 +1,16 @@ require 'braintree_test_app' Braintree::Configuration.logger = Logger.new('log/braintree.log') -Braintree::Configuration.environment = :sandbox -Braintree::Configuration.merchant_id = "bwrdyczvjspmxjhb" -Braintree::Configuration.public_key = "jmw58nbmjg84prbp" -Braintree::Configuration.private_key = "SET_ME" +# we use fake braintree in tests if Rails.env.test? Rails.application.config.middleware.use BraintreeTestApp end + +# You can set these per environment in config/config.yml: +if braintree_conf = APP_CONFIG[:braintree] + Braintree::Configuration.environment = braintree_conf[:environment] + Braintree::Configuration.merchant_id = braintree_conf[:merchant_id] + Braintree::Configuration.public_key = braintree_conf[:public_key] + Braintree::Configuration.private_key = braintree_conf[:private_key] +end |