Class: Io::Flow::V0::Models::PaymentProcessorReference

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

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 = {}) ⇒ PaymentProcessorReference

Returns a new instance of PaymentProcessorReference.



58452
58453
58454
58455
58456
58457
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58452

def initialize(incoming={})
  super(:discriminator => ExpandablePaymentProcessor::Types::PAYMENT_PROCESSOR_REFERENCE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:processor], 'PaymentProcessorReference')
  @processor = HttpClient::Preconditions.assert_class('processor', opts.delete(:processor), String)
end

Instance Attribute Details

#processorObject (readonly)

Returns the value of attribute processor.



58450
58451
58452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58450

def processor
  @processor
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



58463
58464
58465
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58463

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

#subtype_to_hashObject



58467
58468
58469
58470
58471
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58467

def subtype_to_hash
  {
    :processor => processor
  }
end

#to_jsonObject



58459
58460
58461
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58459

def to_json
  JSON.dump(to_hash)
end