Class: Finix::Identity

Inherits:
Object
  • Object
show all
Includes:
HypermediaRegistry, Resource, Verifiable
Defined in:
lib/finix/resources/identity.rb

Instance Attribute Summary

Attributes included from HalResource

#attributes, #hyperlinks

Instance Method Summary collapse

Methods included from Verifiable

#verify

Methods included from HypermediaRegistry

included

Methods included from Resource

#copy_from, #fetch, #hydrate, included, #initialize, #refresh, #sanitize, #save, #to_s

Methods included from HalResource

#load_page_from_response!, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Finix::HalResource

Instance Method Details

#create_payment_instrument(attrs = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/finix/resources/identity.rb', line 13

def create_payment_instrument(attrs={})
  if attrs.is_a?(Finix::Resource)
    attrs.identity = self.id
    attrs = attrs.attributes
  else
    attrs['identity'] = self.id
  end

  self.payment_instruments.create(attrs)
end

#create_settlement(attrs = {}) ⇒ Object



24
25
26
27
# File 'lib/finix/resources/identity.rb', line 24

def create_settlement(attrs={})
  attrs = attrs.attributes if attrs.is_a?(Finix::Resource)
  self.settlements.create(attrs)
end

#provision_merchant(attrs = {}) ⇒ Object



9
10
11
# File 'lib/finix/resources/identity.rb', line 9

def provision_merchant(attrs={})
  self.merchants.create(attrs)
end