Class: CyberSourceMergedSpec::RecipientInformation5

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

Overview

RecipientInformation5 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(administrative_area: SKIP, postal_code: SKIP, country: SKIP, personal_identification: SKIP, first_name: SKIP, middle_initial: SKIP, middle_name: SKIP, last_name: SKIP, address1: SKIP, address2: SKIP, building_number: SKIP, locality: SKIP, identification_number: SKIP, type: SKIP, descriptor: SKIP, account_id: SKIP, account_type: SKIP, alias_name: SKIP, country_of_birth: SKIP, date_of_birth: SKIP, email: SKIP, nationality: SKIP, occupation: SKIP, street_name: SKIP, additional_properties: nil) ⇒ RecipientInformation5

Returns a new instance of RecipientInformation5.



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 211

def initialize(administrative_area: SKIP, postal_code: SKIP, country: SKIP,
               personal_identification: SKIP, first_name: SKIP,
               middle_initial: SKIP, middle_name: SKIP, last_name: SKIP,
               address1: SKIP, address2: SKIP, building_number: SKIP,
               locality: SKIP, identification_number: SKIP, type: SKIP,
               descriptor: SKIP, account_id: SKIP, account_type: SKIP,
               alias_name: SKIP, country_of_birth: SKIP,
               date_of_birth: SKIP, email: SKIP, nationality: SKIP,
               occupation: SKIP, street_name: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @administrative_area = administrative_area unless administrative_area == SKIP
  @postal_code = postal_code unless postal_code == SKIP
  @country = country unless country == SKIP
  @personal_identification = personal_identification unless personal_identification == SKIP
  @first_name = first_name unless first_name == SKIP
  @middle_initial = middle_initial unless middle_initial == SKIP
  @middle_name = middle_name unless middle_name == SKIP
  @last_name = last_name unless last_name == SKIP
  @address1 = address1 unless address1 == SKIP
  @address2 = address2 unless address2 == SKIP
  @building_number = building_number unless building_number == SKIP
  @locality = locality unless locality == SKIP
  @identification_number = identification_number unless identification_number == SKIP
  @type = type unless type == SKIP
  @descriptor = descriptor unless descriptor == SKIP
  @account_id =  unless  == SKIP
  @account_type =  unless  == SKIP
  @alias_name = alias_name unless alias_name == SKIP
  @country_of_birth = country_of_birth unless country_of_birth == SKIP
  @date_of_birth = date_of_birth unless date_of_birth == SKIP
  @email = email unless email == SKIP
  @nationality = nationality unless nationality == SKIP
  @occupation = occupation unless occupation == SKIP
  @street_name = street_name unless street_name == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

Identifier for the recipient’s account.

Returns:

  • (String)


101
102
103
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 101

def 
  @account_id
end

#account_typeString

Identifies the recipient’s account type. This field is applicable for AFT transactions. Valid values are:

  • 00 Other
  • 01 Routing transit number (RTN) and bank account
  • 02 IBAN
  • 03 Card account
  • 04 Email
  • 05 Phone number
  • 06 Bank account number (BAN) and bank identification code (BIC)
  • 07 Wallet ID
  • 08 Social network ID

Returns:

  • (String)


116
117
118
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 116

def 
  @account_type
end

#address1String

Street address of recipient. This field is conditional: it is required if using neither a Customer nor Payment Instrument token.

Returns:

  • (String)


59
60
61
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 59

def address1
  @address1
end

#address2String

Second line of the recipient's address.

Returns:

  • (String)


63
64
65
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 63

def address2
  @address2
end

#administrative_areaString

Recipient's state. Use the State, Province, and Territory Codes for the United States and Canada. Value must be an ISO Standard State Code: https://developer.cybersource.com/library/documentation/sbc/quickref/state s_and_provinces.pdf

Returns:

  • (String)


18
19
20
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 18

def administrative_area
  @administrative_area
end

#alias_nameString

Account owner alias name.

Returns:

  • (String)


120
121
122
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 120

def alias_name
  @alias_name
end

#building_numberString

This field contains the house or the building number of the recipient address.

Returns:

  • (String)


68
69
70
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 68

def building_number
  @building_number
end

#countryString

Recipient's country code. Check that this field contains 2-character alpha ISO 3166-1 standard values.

Returns:

  • (String)


27
28
29
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 27

def country
  @country
end

#country_of_birthString

Account Owner Country of Birth

Returns:

  • (String)


124
125
126
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 124

def country_of_birth
  @country_of_birth
end

#date_of_birthString

Recipient’s date of birth. Format: YYYYMMDD.

Returns:

  • (String)


128
129
130
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 128

def date_of_birth
  @date_of_birth
end

#descriptorString

Recipient first name, this will be concatenated with the 4-digit originator abbreviation.

Returns:

  • (String)


97
98
99
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 97

def descriptor
  @descriptor
end

#emailString

Account Owner email address

Returns:

  • (String)


132
133
134
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 132

def email
  @email
end

#first_nameString

Recipient's first name.

Returns:

  • (String)


36
37
38
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 36

def first_name
  @first_name
end

#identification_numberString

Government-issued identification number. Conditional: This field is mandatory if the processingInformation.businessApplicationId is any of the following:

  • AA
  • PP
  • TU
  • BI
  • WT
  • FT
  • and country code = BR, AR, CO, PE, in recipientInformation.countryCode (Argentina, Brazil, Colombia, and Peru)

Returns:

  • (String)


86
87
88
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 86

def identification_number
  @identification_number
end

#last_nameString

Recipient's last name. Conditional field. If recipientInformation.sameAsSender = false, this field is mandatory.

Returns:

  • (String)


54
55
56
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 54

def last_name
  @last_name
end

#localityString

Recipient city.

Returns:

  • (String)


72
73
74
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 72

def locality
  @locality
end

#middle_initialString

Middle Initial of recipient. This field is supported by FDC Compass.

Returns:

  • (String)


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

def middle_initial
  @middle_initial
end

#middle_nameString

Recipient’s middle name. This field is a pass through, which means that CyberSource does not verify the value or modify it in any way before sending it to the processor. If the field is not required for the transaction, CyberSource does not forward it to the processor.

Returns:

  • (String)


49
50
51
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 49

def middle_name
  @middle_name
end

#nationalityString

Account Owner Nationality

Returns:

  • (String)


136
137
138
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 136

def nationality
  @nationality
end

#occupationString

Account Owner Occupation

Returns:

  • (String)


140
141
142
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 140

def occupation
  @occupation
end

#personal_identificationPersonalIdentification31

Recipient's country code. Check that this field contains 2-character alpha ISO 3166-1 standard values.



32
33
34
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 32

def personal_identification
  @personal_identification
end

#postal_codeString

Recipient's postal code.

Returns:

  • (String)


22
23
24
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 22

def postal_code
  @postal_code
end

#street_nameString

This field contains the street name of the recipient's address.

Returns:

  • (String)


144
145
146
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 144

def street_name
  @street_name
end

#typeString

B for Business or I for individual. Conditional: If recipientInformation.identificationNumber is present, then this field is mandatory.

Returns:

  • (String)


92
93
94
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 92

def type
  @type
end

Class Method Details

.from_element(root) ⇒ Object



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 322

def self.from_element(root)
  administrative_area = XmlUtilities.from_element(root,
                                                  'administrativeArea',
                                                  String)
  postal_code = XmlUtilities.from_element(root, 'postalCode', String)
  country = XmlUtilities.from_element(root, 'country', String)
  personal_identification = XmlUtilities.from_element(
    root, 'PersonalIdentification31', PersonalIdentification31
  )
  first_name = XmlUtilities.from_element(root, 'firstName', String)
  middle_initial = XmlUtilities.from_element(root, 'middleInitial', String)
  middle_name = XmlUtilities.from_element(root, 'middleName', String)
  last_name = XmlUtilities.from_element(root, 'lastName', String)
  address1 = XmlUtilities.from_element(root, 'address1', String)
  address2 = XmlUtilities.from_element(root, 'address2', String)
  building_number = XmlUtilities.from_element(root, 'buildingNumber',
                                              String)
  locality = XmlUtilities.from_element(root, 'locality', String)
  identification_number = XmlUtilities.from_element(root,
                                                    'identificationNumber',
                                                    String)
  type = XmlUtilities.from_element(root, 'type', String)
  descriptor = XmlUtilities.from_element(root, 'descriptor', String)
   = XmlUtilities.from_element(root, 'accountId', String)
   = XmlUtilities.from_element(root, 'accountType', String)
  alias_name = XmlUtilities.from_element(root, 'aliasName', String)
  country_of_birth = XmlUtilities.from_element(root, 'countryOfBirth',
                                               String)
  date_of_birth = XmlUtilities.from_element(root, 'dateOfBirth', String)
  email = XmlUtilities.from_element(root, 'email', String)
  nationality = XmlUtilities.from_element(root, 'nationality', String)
  occupation = XmlUtilities.from_element(root, 'occupation', String)
  street_name = XmlUtilities.from_element(root, 'streetName', String)

  new(administrative_area: administrative_area,
      postal_code: postal_code,
      country: country,
      personal_identification: personal_identification,
      first_name: first_name,
      middle_initial: middle_initial,
      middle_name: middle_name,
      last_name: last_name,
      address1: address1,
      address2: address2,
      building_number: building_number,
      locality: locality,
      identification_number: identification_number,
      type: type,
      descriptor: descriptor,
      account_id: ,
      account_type: ,
      alias_name: alias_name,
      country_of_birth: country_of_birth,
      date_of_birth: date_of_birth,
      email: email,
      nationality: nationality,
      occupation: occupation,
      street_name: street_name,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 252

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  administrative_area =
    hash.key?('administrativeArea') ? hash['administrativeArea'] : SKIP
  postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  if hash['personalIdentification']
    personal_identification = PersonalIdentification31.from_hash(hash['personalIdentification'])
  end
  first_name = hash.key?('firstName') ? hash['firstName'] : SKIP
  middle_initial = hash.key?('middleInitial') ? hash['middleInitial'] : SKIP
  middle_name = hash.key?('middleName') ? hash['middleName'] : SKIP
  last_name = hash.key?('lastName') ? hash['lastName'] : SKIP
  address1 = hash.key?('address1') ? hash['address1'] : SKIP
  address2 = hash.key?('address2') ? hash['address2'] : SKIP
  building_number =
    hash.key?('buildingNumber') ? hash['buildingNumber'] : SKIP
  locality = hash.key?('locality') ? hash['locality'] : SKIP
  identification_number =
    hash.key?('identificationNumber') ? hash['identificationNumber'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  descriptor = hash.key?('descriptor') ? hash['descriptor'] : SKIP
   = hash.key?('accountId') ? hash['accountId'] : SKIP
   = hash.key?('accountType') ? hash['accountType'] : SKIP
  alias_name = hash.key?('aliasName') ? hash['aliasName'] : SKIP
  country_of_birth =
    hash.key?('countryOfBirth') ? hash['countryOfBirth'] : SKIP
  date_of_birth = hash.key?('dateOfBirth') ? hash['dateOfBirth'] : SKIP
  email = hash.key?('email') ? hash['email'] : SKIP
  nationality = hash.key?('nationality') ? hash['nationality'] : SKIP
  occupation = hash.key?('occupation') ? hash['occupation'] : SKIP
  street_name = hash.key?('streetName') ? hash['streetName'] : 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.
  RecipientInformation5.new(administrative_area: administrative_area,
                            postal_code: postal_code,
                            country: country,
                            personal_identification: personal_identification,
                            first_name: first_name,
                            middle_initial: middle_initial,
                            middle_name: middle_name,
                            last_name: last_name,
                            address1: address1,
                            address2: address2,
                            building_number: building_number,
                            locality: locality,
                            identification_number: identification_number,
                            type: type,
                            descriptor: descriptor,
                            account_id: ,
                            account_type: ,
                            alias_name: alias_name,
                            country_of_birth: country_of_birth,
                            date_of_birth: date_of_birth,
                            email: email,
                            nationality: nationality,
                            occupation: occupation,
                            street_name: street_name,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 147

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['administrative_area'] = 'administrativeArea'
  @_hash['postal_code'] = 'postalCode'
  @_hash['country'] = 'country'
  @_hash['personal_identification'] = 'personalIdentification'
  @_hash['first_name'] = 'firstName'
  @_hash['middle_initial'] = 'middleInitial'
  @_hash['middle_name'] = 'middleName'
  @_hash['last_name'] = 'lastName'
  @_hash['address1'] = 'address1'
  @_hash['address2'] = 'address2'
  @_hash['building_number'] = 'buildingNumber'
  @_hash['locality'] = 'locality'
  @_hash['identification_number'] = 'identificationNumber'
  @_hash['type'] = 'type'
  @_hash['descriptor'] = 'descriptor'
  @_hash['account_id'] = 'accountId'
  @_hash['account_type'] = 'accountType'
  @_hash['alias_name'] = 'aliasName'
  @_hash['country_of_birth'] = 'countryOfBirth'
  @_hash['date_of_birth'] = 'dateOfBirth'
  @_hash['email'] = 'email'
  @_hash['nationality'] = 'nationality'
  @_hash['occupation'] = 'occupation'
  @_hash['street_name'] = 'streetName'
  @_hash
end

.nullablesObject

An array for nullable fields



207
208
209
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 207

def self.nullables
  []
end

.optionalsObject

An array for optional fields



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 177

def self.optionals
  %w[
    administrative_area
    postal_code
    country
    personal_identification
    first_name
    middle_initial
    middle_name
    last_name
    address1
    address2
    building_number
    locality
    identification_number
    type
    descriptor
    account_id
    account_type
    alias_name
    country_of_birth
    date_of_birth
    email
    nationality
    occupation
    street_name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 437

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} administrative_area: #{@administrative_area.inspect}, postal_code:"\
  " #{@postal_code.inspect}, country: #{@country.inspect}, personal_identification:"\
  " #{@personal_identification.inspect}, first_name: #{@first_name.inspect}, middle_initial:"\
  " #{@middle_initial.inspect}, middle_name: #{@middle_name.inspect}, last_name:"\
  " #{@last_name.inspect}, address1: #{@address1.inspect}, address2: #{@address2.inspect},"\
  " building_number: #{@building_number.inspect}, locality: #{@locality.inspect},"\
  " identification_number: #{@identification_number.inspect}, type: #{@type.inspect},"\
  " descriptor: #{@descriptor.inspect}, account_id: #{@account_id.inspect}, account_type:"\
  " #{@account_type.inspect}, alias_name: #{@alias_name.inspect}, country_of_birth:"\
  " #{@country_of_birth.inspect}, date_of_birth: #{@date_of_birth.inspect}, email:"\
  " #{@email.inspect}, nationality: #{@nationality.inspect}, occupation:"\
  " #{@occupation.inspect}, street_name: #{@street_name.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 422

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} administrative_area: #{@administrative_area}, postal_code: #{@postal_code},"\
  " country: #{@country}, personal_identification: #{@personal_identification}, first_name:"\
  " #{@first_name}, middle_initial: #{@middle_initial}, middle_name: #{@middle_name},"\
  " last_name: #{@last_name}, address1: #{@address1}, address2: #{@address2}, building_number:"\
  " #{@building_number}, locality: #{@locality}, identification_number:"\
  " #{@identification_number}, type: #{@type}, descriptor: #{@descriptor}, account_id:"\
  " #{@account_id}, account_type: #{@account_type}, alias_name: #{@alias_name},"\
  " country_of_birth: #{@country_of_birth}, date_of_birth: #{@date_of_birth}, email:"\
  " #{@email}, nationality: #{@nationality}, occupation: #{@occupation}, street_name:"\
  " #{@street_name}, additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
# File 'lib/cyber_source_merged_spec/models/recipient_information5.rb', line 383

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

  XmlUtilities.add_as_subelement(doc, root, 'administrativeArea',
                                 administrative_area)
  XmlUtilities.add_as_subelement(doc, root, 'postalCode', postal_code)
  XmlUtilities.add_as_subelement(doc, root, 'country', country)
  XmlUtilities.add_as_subelement(doc, root, 'PersonalIdentification31',
                                 personal_identification)
  XmlUtilities.add_as_subelement(doc, root, 'firstName', first_name)
  XmlUtilities.add_as_subelement(doc, root, 'middleInitial', middle_initial)
  XmlUtilities.add_as_subelement(doc, root, 'middleName', middle_name)
  XmlUtilities.add_as_subelement(doc, root, 'lastName', last_name)
  XmlUtilities.add_as_subelement(doc, root, 'address1', address1)
  XmlUtilities.add_as_subelement(doc, root, 'address2', address2)
  XmlUtilities.add_as_subelement(doc, root, 'buildingNumber',
                                 building_number)
  XmlUtilities.add_as_subelement(doc, root, 'locality', locality)
  XmlUtilities.add_as_subelement(doc, root, 'identificationNumber',
                                 identification_number)
  XmlUtilities.add_as_subelement(doc, root, 'type', type)
  XmlUtilities.add_as_subelement(doc, root, 'descriptor', descriptor)
  XmlUtilities.add_as_subelement(doc, root, 'accountId', )
  XmlUtilities.add_as_subelement(doc, root, 'accountType', )
  XmlUtilities.add_as_subelement(doc, root, 'aliasName', alias_name)
  XmlUtilities.add_as_subelement(doc, root, 'countryOfBirth',
                                 country_of_birth)
  XmlUtilities.add_as_subelement(doc, root, 'dateOfBirth', date_of_birth)
  XmlUtilities.add_as_subelement(doc, root, 'email', email)
  XmlUtilities.add_as_subelement(doc, root, 'nationality', nationality)
  XmlUtilities.add_as_subelement(doc, root, 'occupation', occupation)
  XmlUtilities.add_as_subelement(doc, root, 'streetName', street_name)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end