Class: CatarsePaypalExpress::Gateway

Inherits:
Object
  • Object
show all
Includes:
ActiveMerchant::Billing::Integrations
Defined in:
lib/catarse_paypal_express/gateway.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration = PaymentEngines.configuration) ⇒ Gateway

Returns a new instance of Gateway.



5
6
7
# File 'lib/catarse_paypal_express/gateway.rb', line 5

def initialize configuration = PaymentEngines.configuration
  @configuration = configuration
end

Class Method Details

.instanceObject



9
10
11
12
13
# File 'lib/catarse_paypal_express/gateway.rb', line 9

def self.instance
  new.setup_gateway
rescue Exception => e
  puts e.message
end

Instance Method Details

#setup_gatewayObject



15
16
17
18
19
20
21
22
# File 'lib/catarse_paypal_express/gateway.rb', line 15

def setup_gateway
  check_default_configurations!
  ActiveMerchant::Billing::PaypalExpressGateway.new({
    login: @configuration[:paypal_username],
    password: @configuration[:paypal_password],
    signature: @configuration[:paypal_signature]
  })
end