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.



65353
65354
65355
65356
65357
65358
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65353

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.



65351
65352
65353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65351

def code
  @code
end

#descriptionObject (readonly)

Returns the value of attribute description.



65351
65352
65353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65351

def description
  @description
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



65364
65365
65366
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65364

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

#to_hashObject



65368
65369
65370
65371
65372
65373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65368

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

#to_jsonObject



65360
65361
65362
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65360

def to_json
  JSON.dump(to_hash)
end