Class: CyberSourceMergedSpec::PersonalIdentification31

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

Overview

PersonalIdentification31 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(issuing_country: SKIP, id: SKIP, type: SKIP, personal_id_type: SKIP, additional_properties: nil) ⇒ PersonalIdentification31

Returns a new instance of PersonalIdentification31.



73
74
75
76
77
78
79
80
81
82
83
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 73

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

  @issuing_country = issuing_country unless issuing_country == SKIP
  @id = id unless id == SKIP
  @type = type unless type == SKIP
  @personal_id_type = personal_id_type unless personal_id_type == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#idString

This tag will contain an acquirer-populated id value associated with the API.

Returns:

  • (String)


20
21
22
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 20

def id
  @id
end

#issuing_countryString

Issuing country of the identification. The field format should be a 2 character ISO 3166-1 alpha-2 country code.

Returns:

  • (String)


15
16
17
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 15

def issuing_country
  @issuing_country
end

#personal_id_typeString

This field denotes whether the Tax ID is a business or individual's Tax ID when idType contains the value of TXIN (Tax identification). The valid values are: B (Business) I (Individual)

Returns:

  • (String)


46
47
48
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 46

def personal_id_type
  @personal_id_type
end

#typeString

This tag will contain the type of recipient identification. The valid values are:

  • BTHD: (Date of birth)
  • CUID: (Customer identification (unspecified))
  • NTID: (National identification)
  • PASN: (Passport number)
  • DRLN: (Driver license)
  • TXIN: (Tax identification)
  • CPNY: (Company registration number)
  • PRXY: (Proxy identification)
  • SSNB: (Social security number)
  • ARNB: (Alien registration number)
  • LAWE: (Law enforcement identification)
  • MILI: (Military identification)
  • TRVL: (Travel identification (non-passport))
  • EMAL: (Email)
  • PHON: (Phone number)

Returns:

  • (String)


40
41
42
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 40

def type
  @type
end

Class Method Details

.from_element(root) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 112

def self.from_element(root)
  issuing_country = XmlUtilities.from_element(root, 'issuingCountry',
                                              String)
  id = XmlUtilities.from_element(root, 'id', String)
  type = XmlUtilities.from_element(root, 'type', String)
  personal_id_type = XmlUtilities.from_element(root, 'personalIdType',
                                               String)

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

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 86

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  issuing_country =
    hash.key?('issuingCountry') ? hash['issuingCountry'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  personal_id_type =
    hash.key?('personalIdType') ? hash['personalIdType'] : 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.
  PersonalIdentification31.new(issuing_country: issuing_country,
                               id: id,
                               type: type,
                               personal_id_type: personal_id_type,
                               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



69
70
71
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 69

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 59

def self.optionals
  %w[
    issuing_country
    id
    type
    personal_id_type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



150
151
152
153
154
155
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 150

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

#to_sObject

Provides a human-readable string representation of the object.



143
144
145
146
147
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 143

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

#to_xml_element(doc, root_name) ⇒ Object



127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/cyber_source_merged_spec/models/personal_identification31.rb', line 127

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

  XmlUtilities.add_as_subelement(doc, root, 'issuingCountry',
                                 issuing_country)
  XmlUtilities.add_as_subelement(doc, root, 'id', id)
  XmlUtilities.add_as_subelement(doc, root, 'type', type)
  XmlUtilities.add_as_subelement(doc, root, 'personalIdType',
                                 personal_id_type)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end