Module: Workarea::Paypal

Defined in:
lib/workarea/paypal.rb,
lib/workarea/paypal/engine.rb,
lib/workarea/paypal/version.rb,
app/services/workarea/paypal/setup.rb,
app/services/workarea/paypal/update.rb

Defined Under Namespace

Classes: Engine, Setup, Update

Constant Summary collapse

VERSION =
'2.0.8'.freeze

Class Method Summary collapse

Class Method Details

.auto_configure_gatewayObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/workarea/paypal.rb', line 15

def self.auto_configure_gateway
  if Rails.application.secrets.paypal.present?
    self.gateway = ActiveMerchant::Billing::PaypalExpressGateway.new(
      Rails.application.secrets.paypal.deep_symbolize_keys
    )
  elsif gateway.blank?
    self.gateway = ActiveMerchant::Billing::BogusGateway.new
  end

  if ENV['HTTP_PROXY'].present? && gateway.present?
    parsed = URI.parse(ENV['HTTP_PROXY'])
    gateway.proxy_address = parsed.host
    gateway.proxy_port = parsed.port
  end
end

.gatewayObject



7
8
9
# File 'lib/workarea/paypal.rb', line 7

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

.gateway=(gateway) ⇒ Object



11
12
13
# File 'lib/workarea/paypal.rb', line 11

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