Class: VisaAcceptanceMergedSpec::PersonalIdentification

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_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.



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

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).

Visa Acceptance 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 Visa Acceptance Latin American Processing is the name of a specific processing connection that Visa Acceptance supports. In the Visa Acceptance API documentation, Visa Acceptance 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 Visa Acceptance Latin American Processing. It is not for any other Latin American processors that Visa Acceptance supports.

If type = PASSPORT, this is the cardholder's passport number. Recommended for Discover ProtectBuy.

Returns:

  • (String)


61
62
63
# File 'lib/visa_acceptance_merged_spec/models/personal_identification.rb', line 61

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](

TeleCheck

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

All Other Processors

Not used.

Returns:

  • (String)


76
77
78
# File 'lib/visa_acceptance_merged_spec/models/personal_identification.rb', line 76

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).

Visa Acceptance 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 Visa Acceptance Latin American Processing is the name of a specific processing connection that Visa Acceptance supports. In the Visa Acceptance API documentation, Visa Acceptance 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 Visa Acceptance Latin American Processing. It is not for any other Latin American processors that Visa Acceptance supports.

Returns:

  • (String)


41
42
43
# File 'lib/visa_acceptance_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)


81
82
83
# File 'lib/visa_acceptance_merged_spec/models/personal_identification.rb', line 81

def verification_results
  @verification_results
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

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.



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

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



104
105
106
# File 'lib/visa_acceptance_merged_spec/models/personal_identification.rb', line 104

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



154
155
156
157
158
159
# File 'lib/visa_acceptance_merged_spec/models/personal_identification.rb', line 154

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.



147
148
149
150
151
# File 'lib/visa_acceptance_merged_spec/models/personal_identification.rb', line 147

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