class Io::Flow::V0::Models::CardAuthorizationActionResult
Attributes
type[R]
Public Class Methods
from_json(hash)
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 10123 def CardAuthorizationActionResult.from_json(hash) HttpClient::Preconditions.assert_class('hash', hash, Hash) discriminator = HttpClient::Helper.symbolize_keys(hash)[:type].to_s.strip if discriminator.empty? raise "Union type[card_authorization_action_result] requires a field named 'type'" end case discriminator when Types::AUTHORIZATION_ACTION_RESULT_ADYEN_V3; AuthorizationActionResultAdyenV3.new(hash) when Types::AUTHORIZATION_ACTION_RESULT_ADYEN_V4; AuthorizationActionResultAdyenV4.new(hash) else CardAuthorizationActionResultUndefinedType.new(:type => discriminator) end end
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 10109 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:type], 'CardAuthorizationActionResult') @type = HttpClient::Preconditions.assert_class('type', opts.delete(:type), String) end
Public Instance Methods
subtype_to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 10115 def subtype_to_hash raise 'Cannot serialize an instance of card_authorization_action_result directly - must use one of the specific types: authorization_action_result_adyen_v3, authorization_action_result_adyen_v4' end
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 10119 def to_hash subtype_to_hash.merge(:type => @type) end