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.



50859
50860
50861
50862
50863
50864
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50859

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.



50857
50858
50859
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50857

def action_result
  @action_result
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50870
50871
50872
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50870

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

#subtype_to_hashObject



50874
50875
50876
50877
50878
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50874

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

#to_jsonObject



50866
50867
50868
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50866

def to_json
  JSON.dump(to_hash)
end