Class: CyberSourceMergedSpec::PersonalIdentification6

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

Overview

PersonalIdentification6 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, additional_properties: nil) ⇒ PersonalIdentification6

Returns a new instance of PersonalIdentification6.



83
84
85
86
87
88
89
90
# File 'lib/cyber_source_merged_spec/models/personal_identification6.rb', line 83

def initialize(type: SKIP, id: 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
  @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_identification6.rb', line 60

def id
  @id
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_identification6.rb', line 41

def type
  @type
end

Class Method Details

.from_element(root) ⇒ Object



113
114
115
116
117
118
119
120
# File 'lib/cyber_source_merged_spec/models/personal_identification6.rb', line 113

def self.from_element(root)
  type = XmlUtilities.from_element(root, 'type', String)
  id = XmlUtilities.from_element(root, 'id', String)

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

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/cyber_source_merged_spec/models/personal_identification6.rb', line 93

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

  # 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.
  PersonalIdentification6.new(type: type,
                              id: id,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



63
64
65
66
67
68
# File 'lib/cyber_source_merged_spec/models/personal_identification6.rb', line 63

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

.nullablesObject

An array for nullable fields



79
80
81
# File 'lib/cyber_source_merged_spec/models/personal_identification6.rb', line 79

def self.nullables
  []
end

.optionalsObject

An array for optional fields



71
72
73
74
75
76
# File 'lib/cyber_source_merged_spec/models/personal_identification6.rb', line 71

def self.optionals
  %w[
    type
    id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



141
142
143
144
145
# File 'lib/cyber_source_merged_spec/models/personal_identification6.rb', line 141

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

#to_sObject

Provides a human-readable string representation of the object.



134
135
136
137
138
# File 'lib/cyber_source_merged_spec/models/personal_identification6.rb', line 134

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

#to_xml_element(doc, root_name) ⇒ Object



122
123
124
125
126
127
128
129
130
131
# File 'lib/cyber_source_merged_spec/models/personal_identification6.rb', line 122

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, 'additional_properties',
                                 additional_properties)

  root
end