Class: Io::Flow::V0::Models::PaymentMethodDataCompleteAuthorizationCard

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

Instance Attribute Summary collapse

Attributes inherited from PaymentMethodData

#type

Instance Method Summary collapse

Methods inherited from PaymentMethodData

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ PaymentMethodDataCompleteAuthorizationCard

Returns a new instance of PaymentMethodDataCompleteAuthorizationCard.



57368
57369
57370
57371
57372
57373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57368

def initialize(incoming={})
  super(:type => PaymentMethodData::Types::PAYMENT_METHOD_DATA_COMPLETE_AUTHORIZATION_CARD)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:action_result], 'PaymentMethodDataCompleteAuthorizationCard')
  @action_result = (x = opts.delete(:action_result); x.is_a?(::Io::Flow::V0::Models::CardAuthorizationActionResult) ? x : ::Io::Flow::V0::Models::CardAuthorizationActionResult.from_json(x))
end

Instance Attribute Details

#action_resultObject (readonly)

Returns the value of attribute action_result.



57366
57367
57368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57366

def action_result
  @action_result
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57379
57380
57381
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57379

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

#subtype_to_hashObject



57383
57384
57385
57386
57387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57383

def subtype_to_hash
  {
    :action_result => action_result.to_hash
  }
end

#to_jsonObject



57375
57376
57377
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57375

def to_json
  JSON.dump(to_hash)
end