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.



47681
47682
47683
47684
47685
47686
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47681

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.



47679
47680
47681
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47679

def code
  @code
end

#descriptionObject (readonly)

Returns the value of attribute description.



47679
47680
47681
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47679

def description
  @description
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



47692
47693
47694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47692

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

#to_hashObject



47696
47697
47698
47699
47700
47701
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47696

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

#to_jsonObject



47688
47689
47690
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47688

def to_json
  JSON.dump(to_hash)
end