Class: CyberSourceMergedSpec::VerificationResults

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/verification_results.rb

Overview

Verification results returned by the issuer during the provisioning when Security Code or Billing Address data is provided on the request. Supported only for VTS tokens.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(security_code: SKIP, address: SKIP, additional_properties: nil) ⇒ VerificationResults

Returns a new instance of VerificationResults.



62
63
64
65
66
67
68
69
70
# File 'lib/cyber_source_merged_spec/models/verification_results.rb', line 62

def initialize(security_code: SKIP, address: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @security_code = security_code unless security_code == SKIP
  @address = address unless address == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressString

Indicates whether the billing address was verified by the issuer during the provisioning request. Supported only for VTS tokens. Possible Values:

  • MATCH: Verified, address and postal code data matched.
  • PARTIAL_MATCH: Verified, either address data matched or postal code data matched.
  • PARTIAL_MATCH_FORMAT_UNSUPPORTED: Verified, either address data matched or postal code data matched, but the other could not be verified due to format issues.
  • NO_MATCH: Verified, address and postal code data did not match.
  • NOT_SUPPORTED: Verification not supported by card issuer.
  • SKIPPED: Verification was not performed.

Returns:

  • (String)


39
40
41
# File 'lib/cyber_source_merged_spec/models/verification_results.rb', line 39

def address
  @address
end

#security_codeString

Indicates whether the security code (CVV/CVC) was verified by the issuer during the provisioning request. Supported only for VTS tokens. Possible Values:

  • MATCH: Verified, CVV2 data matched.
  • NO_MATCH: Verified, CVV2 data did not match.
  • NOT_SUPPORTED: Verification not supported by card issuer.
  • SKIPPED: Verification was not performed.

Returns:

  • (String)


23
24
25
# File 'lib/cyber_source_merged_spec/models/verification_results.rb', line 23

def security_code
  @security_code
end

Class Method Details

.from_element(root) ⇒ Object



93
94
95
96
97
98
99
100
# File 'lib/cyber_source_merged_spec/models/verification_results.rb', line 93

def self.from_element(root)
  security_code = XmlUtilities.from_element(root, 'securityCode', String)
  address = XmlUtilities.from_element(root, 'address', String)

  new(security_code: security_code,
      address: address,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/cyber_source_merged_spec/models/verification_results.rb', line 73

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  security_code = hash.key?('securityCode') ? hash['securityCode'] : SKIP
  address = hash.key?('address') ? hash['address'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  VerificationResults.new(security_code: security_code,
                          address: address,
                          additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



42
43
44
45
46
47
# File 'lib/cyber_source_merged_spec/models/verification_results.rb', line 42

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['security_code'] = 'securityCode'
  @_hash['address'] = 'address'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
# File 'lib/cyber_source_merged_spec/models/verification_results.rb', line 58

def self.nullables
  []
end

.optionalsObject

An array for optional fields



50
51
52
53
54
55
# File 'lib/cyber_source_merged_spec/models/verification_results.rb', line 50

def self.optionals
  %w[
    security_code
    address
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



121
122
123
124
125
# File 'lib/cyber_source_merged_spec/models/verification_results.rb', line 121

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} security_code: #{@security_code.inspect}, address: #{@address.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



114
115
116
117
118
# File 'lib/cyber_source_merged_spec/models/verification_results.rb', line 114

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} security_code: #{@security_code}, address: #{@address},"\
  " additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



102
103
104
105
106
107
108
109
110
111
# File 'lib/cyber_source_merged_spec/models/verification_results.rb', line 102

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'securityCode', security_code)
  XmlUtilities.add_as_subelement(doc, root, 'address', address)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end