Class: Io::Flow::V0::Models::PaymentProcessor

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

Overview

Information about which payment processor performed the transaction and how it can be tracked in their system

Instance Attribute Summary collapse

Attributes inherited from ExpandablePaymentProcessor

#discriminator

Instance Method Summary collapse

Methods inherited from ExpandablePaymentProcessor

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ PaymentProcessor

Returns a new instance of PaymentProcessor.



53943
53944
53945
53946
53947
53948
53949
53950
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53943

def initialize(incoming={})
  super(:discriminator => ExpandablePaymentProcessor::Types::PAYMENT_PROCESSOR)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:processor], 'PaymentProcessor')
  @processor = HttpClient::Preconditions.assert_class('processor', opts.delete(:processor), String)
  @operation_identifier = (x = opts.delete(:operation_identifier); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PaymentProcessorIdentifier) ? x : ::Io::Flow::V0::Models::PaymentProcessorIdentifier.new(x)))
  @account = (x = opts.delete(:account); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::PaymentProcessorAccount) ? x : ::Io::Flow::V0::Models::PaymentProcessorAccount.new(x)))
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



53941
53942
53943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53941

def 
  @account
end

#operation_identifierObject (readonly)

Returns the value of attribute operation_identifier.



53941
53942
53943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53941

def operation_identifier
  @operation_identifier
end

#processorObject (readonly)

Returns the value of attribute processor.



53941
53942
53943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53941

def processor
  @processor
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53956
53957
53958
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53956

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

#subtype_to_hashObject



53960
53961
53962
53963
53964
53965
53966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53960

def subtype_to_hash
  {
    :processor => processor,
    :operation_identifier => operation_identifier.nil? ? nil : operation_identifier.to_hash,
    :account => .nil? ? nil : .to_hash
  }
end

#to_jsonObject



53952
53953
53954
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53952

def to_json
  JSON.dump(to_hash)
end