Class: Io::Flow::V0::Models::PaymentProcessorAccount

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Information about an account with a payment processor

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PaymentProcessorAccount

Returns a new instance of PaymentProcessorAccount.



53975
53976
53977
53978
53979
53980
53981
53982
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53975

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:organization, :key, :identifier], 'PaymentProcessorAccount')
  @organization = HttpClient::Preconditions.assert_class('organization', opts.delete(:organization), String)
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
  @identifier = (x = opts.delete(:identifier); x.is_a?(::Io::Flow::V0::Models::PaymentProcessorIdentifier) ? x : ::Io::Flow::V0::Models::PaymentProcessorIdentifier.new(x))
  @parent_account = (x = opts.delete(:parent_account); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PaymentProcessorAccountReference) ? x : ::Io::Flow::V0::Models::PaymentProcessorAccountReference.new(x)))
end

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier.



53973
53974
53975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53973

def identifier
  @identifier
end

#keyObject (readonly)

Returns the value of attribute key.



53973
53974
53975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53973

def key
  @key
end

#organizationObject (readonly)

Returns the value of attribute organization.



53973
53974
53975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53973

def organization
  @organization
end

#parent_accountObject (readonly)

Returns the value of attribute parent_account.



53973
53974
53975
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53973

def 
  @parent_account
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53988
53989
53990
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53988

def copy(incoming={})
  PaymentProcessorAccount.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



53992
53993
53994
53995
53996
53997
53998
53999
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53992

def to_hash
  {
    :organization => organization,
    :key => key,
    :identifier => identifier.to_hash,
    :parent_account => .nil? ? nil : .to_hash
  }
end

#to_jsonObject



53984
53985
53986
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53984

def to_json
  JSON.dump(to_hash)
end