Class: Cardflex::Gateway

Inherits:
Object
  • Object
show all
Defined in:
lib/cardflex/gateway.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Gateway

Returns a new instance of Gateway.



5
6
7
8
9
10
11
12
13
# File 'lib/cardflex/gateway.rb', line 5

def initialize(config)
  if config.is_a? Hash
    @config = Configuration.new(config)
  elsif config.is_a? Configuration
    @config = config
  else
    raise ArgumentError, "config is an invalid type"
  end
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/cardflex/gateway.rb', line 3

def config
  @config
end

Instance Method Details

#customer_vaultObject



27
28
29
# File 'lib/cardflex/gateway.rb', line 27

def customer_vault
  CustomerVaultGateway.new(self)
end

#planObject



19
20
21
# File 'lib/cardflex/gateway.rb', line 19

def plan
  PlanGateway.new(self)
end

#subscriptionObject



31
32
33
# File 'lib/cardflex/gateway.rb', line 31

def subscription
  SubscriptionGateway.new(self)
end

#three_stepObject



23
24
25
# File 'lib/cardflex/gateway.rb', line 23

def three_step
  ThreeStepGateway.new(self)
end

#transactionObject



15
16
17
# File 'lib/cardflex/gateway.rb', line 15

def transaction
  TransactionGateway.new(self)
end