Class: ArmorPayments::API

Inherits:
Object
  • Object
show all
Defined in:
lib/armor_payments/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, api_secret, sandbox = false) ⇒ API

Returns a new instance of API.



27
28
29
30
# File 'lib/armor_payments/api.rb', line 27

def initialize api_key, api_secret, sandbox = false
  self.authenticator = ArmorPayments::Authenticator.new(api_key, api_secret)
  self.sandbox = sandbox
end

Instance Attribute Details

#authenticatorObject

Returns the value of attribute authenticator.



25
26
27
# File 'lib/armor_payments/api.rb', line 25

def authenticator
  @authenticator
end

#sandboxObject

Returns the value of attribute sandbox.



25
26
27
# File 'lib/armor_payments/api.rb', line 25

def sandbox
  @sandbox
end

Instance Method Details

#accountsObject



36
37
38
# File 'lib/armor_payments/api.rb', line 36

def accounts
  @accounts ||= ArmorPayments::Accounts.new(armor_host, authenticator, '')
end

#armor_hostObject



32
33
34
# File 'lib/armor_payments/api.rb', line 32

def armor_host
  "https://#{sandbox ? 'sandbox' : 'api'}.armorpayments.com"
end

#orders(account_id) ⇒ Object



40
41
42
# File 'lib/armor_payments/api.rb', line 40

def orders 
  ArmorPayments::Orders.new(armor_host, authenticator, accounts.uri())
end

#partnerObject



44
45
46
# File 'lib/armor_payments/api.rb', line 44

def partner
  @partner ||= ArmorPayments::Partner.new(armor_host, authenticator, '')
end

#shipmentcarriersObject



48
49
50
# File 'lib/armor_payments/api.rb', line 48

def shipmentcarriers
  @shipmentcarriers ||= ArmorPayments::ShipmentCarriers.new(armor_host, authenticator, '')
end

#users(account_id) ⇒ Object



52
53
54
# File 'lib/armor_payments/api.rb', line 52

def users 
  ArmorPayments::Users.new(armor_host, authenticator, accounts.uri())
end