Module: Workarea::Braintree

Defined in:
lib/workarea/braintree.rb,
lib/workarea/braintree/engine.rb,
lib/workarea/braintree/version.rb

Defined Under Namespace

Classes: Engine

Constant Summary collapse

VERSION =
"1.1.1"

Class Method Summary collapse

Class Method Details

.auto_configure_gatewayObject



13
14
15
16
17
18
19
20
21
# File 'lib/workarea/braintree.rb', line 13

def self.auto_configure_gateway
  if Rails.application.secrets.braintree.present?
    self.gateway = ActiveMerchant::Billing::BraintreeGateway.new(
      Rails.application.secrets.braintree.deep_symbolize_keys
    )
  else
    self.gateway = ActiveMerchant::Billing::BogusBraintreeGateway.new
  end
end

.gatewayObject



23
24
25
# File 'lib/workarea/braintree.rb', line 23

def self.gateway
  Workarea.config.gateways.credit_card
end

.gateway=(gateway) ⇒ Object



27
28
29
# File 'lib/workarea/braintree.rb', line 27

def self.gateway=(gateway)
  Workarea.config.gateways.credit_card = gateway
end