Class: Io::Flow::V0::Models::ThreeDSecure

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

Overview

Represents the results from 3D Secure, if applied to an authorization

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ThreeDSecure

Returns a new instance of ThreeDSecure.



53661
53662
53663
53664
53665
53666
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53661

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

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



53659
53660
53661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53659

def code
  @code
end

#descriptionObject (readonly)

Returns the value of attribute description.



53659
53660
53661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53659

def description
  @description
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53672
53673
53674
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53672

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

#to_hashObject



53676
53677
53678
53679
53680
53681
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53676

def to_hash
  {
    :code => code.value,
    :description => description
  }
end

#to_jsonObject



53668
53669
53670
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53668

def to_json
  JSON.dump(to_hash)
end