Sha256: 06dbddd58901ce4cbc58b738aa7f129557902c2d29a572473f1c432c58ecd7a8

Contents?: true

Size: 666 Bytes

Versions: 11

Compression:

Stored size: 666 Bytes

Contents

module Finix
  class Identity
    include Finix::Resource
    include Finix::HypermediaRegistry
    include Finix::Verifiable

    define_hypermedia_types [:identities]

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

    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

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

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
finix-1.0.1 lib/finix/resources/identity.rb
finix-1.0.0 lib/finix/resources/identity.rb
finix-0.16 lib/finix/resources/identity.rb
finix-0.15 lib/finix/resources/identity.rb
finix-0.14 lib/finix/resources/identity.rb
finix-0.13 lib/finix/resources/identity.rb
finix-0.12 lib/finix/resources/identity.rb
finix-0.11 lib/finix/resources/identity.rb
finix-0.10 lib/finix/resources/identity.rb
finix-0.9 lib/finix/resources/identity.rb
finix-0.8 lib/finix/resources/identity.rb