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.



53043
53044
53045
53046
53047
53048
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53043

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.



53041
53042
53043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53041

def action_result
  @action_result
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53054
53055
53056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53054

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

#subtype_to_hashObject



53058
53059
53060
53061
53062
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53058

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

#to_jsonObject



53050
53051
53052
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53050

def to_json
  JSON.dump(to_hash)
end