Class: Io::Flow::V0::Models::AuthorizationResultAction

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

Overview

Provides details for how to acquire additional information from the customer when needed (e.g. redirecting to the issuer for online payment method or 3D Secure).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ AuthorizationResultAction

Returns a new instance of AuthorizationResultAction.



17946
17947
17948
17949
17950
17951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17946

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:type], 'AuthorizationResultAction')
  @type = (x = opts.delete(:type); x.is_a?(::Io::Flow::V0::Models::AuthorizationResultActionType) ? x : ::Io::Flow::V0::Models::AuthorizationResultActionType.apply(x))
  @url = (x = opts.delete(:url); x.nil? ? nil : HttpClient::Preconditions.assert_class('url', x, String))
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



17944
17945
17946
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17944

def type
  @type
end

#urlObject (readonly)

Returns the value of attribute url.



17944
17945
17946
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17944

def url
  @url
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



17957
17958
17959
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17957

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

#to_hashObject



17961
17962
17963
17964
17965
17966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17961

def to_hash
  {
    :type => type.value,
    :url => url
  }
end

#to_jsonObject



17953
17954
17955
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17953

def to_json
  JSON.dump(to_hash)
end