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.0"

Class Method Summary collapse

Class Method Details

.auto_configure_gatewayObject



8
9
10
11
12
13
14
15
16
# File 'lib/workarea/braintree.rb', line 8

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



18
19
20
# File 'lib/workarea/braintree.rb', line 18

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

.gateway=(gateway) ⇒ Object



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

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