summaryrefslogtreecommitdiff
path: root/engines/billing/config/initializers/braintree.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-04-11 10:03:19 +0200
committerAzul <azul@leap.se>2014-04-11 10:07:23 +0200
commit636692f9921bd695d726695d2d46c91f5a6e56f3 (patch)
treea7cc0b89007bd273ae7719f31c16e052a141fec7 /engines/billing/config/initializers/braintree.rb
parent32136605ddd405a0bf47f3b795b22fd4b49465b5 (diff)
move engines into engines directory
Also renamed help to support so it's harder to confuse it with documentation
Diffstat (limited to 'engines/billing/config/initializers/braintree.rb')
-rw-r--r--engines/billing/config/initializers/braintree.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/engines/billing/config/initializers/braintree.rb b/engines/billing/config/initializers/braintree.rb
new file mode 100644
index 0000000..3d87f4c
--- /dev/null
+++ b/engines/billing/config/initializers/braintree.rb
@@ -0,0 +1,23 @@
+#
+# set logger
+#
+if APP_CONFIG[:logfile].blank?
+ require 'syslog/logger'
+ Braintree::Configuration.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new('webapp'))
+else
+ Braintree::Configuration.logger = Logger.new('log/braintree.log')
+end
+
+#
+# You can set these per environment in config/config.yml:
+#
+# Environment must be one of: :development, :qa, :sandbox, :production
+#
+if billing = APP_CONFIG[:billing]
+ if braintree = billing[:braintree]
+ Braintree::Configuration.environment = braintree[:environment].downcase.to_sym
+ Braintree::Configuration.merchant_id = braintree[:merchant_id]
+ Braintree::Configuration.public_key = braintree[:public_key]
+ Braintree::Configuration.private_key = braintree[:private_key]
+ end
+end