Class: CyberSourceMergedSpec::PersonalIdentification

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

Overview

PersonalIdentification Model.

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(type: SKIP, id: SKIP, issued_by: SKIP, verification_results: SKIP, additional_properties: nil) ⇒ PersonalIdentification

Returns a new instance of PersonalIdentification.



109
110
111
112
113
114
115
116
117
118
119
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 109

def initialize(type: SKIP, id: SKIP, issued_by: SKIP,
               verification_results: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @type = type unless type == SKIP
  @id = id unless id == SKIP
  @issued_by = issued_by unless issued_by == SKIP
  @verification_results = verification_results unless verification_results == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#idString

The value of the identification type. This field is supported only on the following processors.

ComercioLatino

Set this field to the Cadastro de Pessoas Fisicas (CPF).

CyberSource Latin American Processing

Supported for Redecard in Brazil. Set this field to the Cadastro de Pessoas Fisicas (CPF), which is required for AVS for Redecard in Brazil. Note CyberSource Latin American Processing is the name of a specific processing connection that CyberSource supports. In the CyberSource API documentation, CyberSource Latin American Processing does not refer to the general topic of processing in Latin America. The information in this field description is for the specific processing connection called CyberSource Latin American Processing. It is not for any other Latin American processors that CyberSource supports.
If type = PASSPORT, this is the cardholder's passport number. Recommended for Discover ProtectBuy.

Returns:

  • (String)


60
61
62
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 60

def id
  @id
end

#issued_byString

The government agency that issued the driver's license or passport. If type = DRIVER_LICENSE, this is the State or province where the customer’s driver’s license was issued. If type = PASSPORT, this is the Issuing country for the cardholder’s passport. Recommended for Discover ProtectBuy. Use the two-character [State, Province, and Territory Codes for the United States and Canada](https://developer.cybersource.com/library/documentation/sbc/quickr ef/states_and_provinces.pdf).

TeleCheck

Contact your TeleCheck representative to find out whether this field is required or optional.

All Other Processors

Not used.

Returns:

  • (String)


77
78
79
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 77

def issued_by
  @issued_by
end

#typeString

The type of the identification. Possible values:

- `NATIONAL`
- `CPF`
- `CPNJ`
- `CURP`
- `SSN`
- `DRIVER_LICENSE`
- `PASSPORT_NUMBER`
- `PERSONAL_ID`
- `TAX_ID`
-	`BR_CPF`     The individual tax ID type, typically is 11 characters

long

  • BR_CNPJ The business tax ID type, typically is 14 characters long. This field is supported only on the following processors.

ComercioLatino

Set this field to the Cadastro de Pessoas Fisicas (CPF).

CyberSource Latin American Processing

Supported for Redecard in Brazil. Set this field to the Cadastro de Pessoas Fisicas (CPF), which is required for AVS for Redecard in Brazil. Note CyberSource Latin American Processing is the name of a specific processing connection that CyberSource supports. In the CyberSource API documentation, CyberSource Latin American Processing does not refer to the general topic of processing in Latin America. The information in this field description is for the specific processing connection called CyberSource Latin American Processing. It is not for any other Latin American processors that CyberSource supports.

Returns:

  • (String)


41
42
43
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 41

def type
  @type
end

#verification_resultsString

Verification results received from Issuer or Card Network for verification transactions. Response Only Field.

Returns:

  • (String)


82
83
84
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 82

def verification_results
  @verification_results
end

Class Method Details

.from_element(root) ⇒ Object



147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 147

def self.from_element(root)
  type = XmlUtilities.from_element(root, 'type', String)
  id = XmlUtilities.from_element(root, 'id', String)
  issued_by = XmlUtilities.from_element(root, 'issuedBy', String)
  verification_results = XmlUtilities.from_element(root,
                                                   'verificationResults',
                                                   String)

  new(type: type,
      id: id,
      issued_by: issued_by,
      verification_results: verification_results,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 122

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  type = hash.key?('type') ? hash['type'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  issued_by = hash.key?('issuedBy') ? hash['issuedBy'] : SKIP
  verification_results =
    hash.key?('verificationResults') ? hash['verificationResults'] : 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.
  PersonalIdentification.new(type: type,
                             id: id,
                             issued_by: issued_by,
                             verification_results: verification_results,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



85
86
87
88
89
90
91
92
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 85

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['type'] = 'type'
  @_hash['id'] = 'id'
  @_hash['issued_by'] = 'issuedBy'
  @_hash['verification_results'] = 'verificationResults'
  @_hash
end

.nullablesObject

An array for nullable fields



105
106
107
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 105

def self.nullables
  []
end

.optionalsObject

An array for optional fields



95
96
97
98
99
100
101
102
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 95

def self.optionals
  %w[
    type
    id
    issued_by
    verification_results
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



184
185
186
187
188
189
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 184

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

#to_sObject

Provides a human-readable string representation of the object.



177
178
179
180
181
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 177

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

#to_xml_element(doc, root_name) ⇒ Object



162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/cyber_source_merged_spec/models/personal_identification.rb', line 162

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

  XmlUtilities.add_as_subelement(doc, root, 'type', type)
  XmlUtilities.add_as_subelement(doc, root, 'id', id)
  XmlUtilities.add_as_subelement(doc, root, 'issuedBy', issued_by)
  XmlUtilities.add_as_subelement(doc, root, 'verificationResults',
                                 verification_results)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end