Class: CyberSourceMergedSpec::SenderInformation3

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

Overview

SenderInformation3 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(reference_number: SKIP, account: SKIP, first_name: SKIP, middle_initial: SKIP, middle_name: SKIP, last_name: SKIP, name: SKIP, address1: SKIP, locality: SKIP, administrative_area: SKIP, country_code: SKIP, postal_code: SKIP, phone_number: SKIP, date_of_birth: SKIP, vat_registration_number: SKIP, personal_id_type: SKIP, type: SKIP, identification_number: SKIP, alias_name: SKIP, additional_properties: nil) ⇒ SenderInformation3

Returns a new instance of SenderInformation3.



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 194

def initialize(reference_number: SKIP, account: SKIP, first_name: SKIP,
               middle_initial: SKIP, middle_name: SKIP, last_name: SKIP,
               name: SKIP, address1: SKIP, locality: SKIP,
               administrative_area: SKIP, country_code: SKIP,
               postal_code: SKIP, phone_number: SKIP, date_of_birth: SKIP,
               vat_registration_number: SKIP, personal_id_type: SKIP,
               type: SKIP, identification_number: SKIP, alias_name: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @reference_number = reference_number unless reference_number == SKIP
  @account =  unless  == 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
  @name = name unless name == SKIP
  @address1 = address1 unless address1 == SKIP
  @locality = locality unless locality == SKIP
  @administrative_area = administrative_area unless administrative_area == SKIP
  @country_code = country_code unless country_code == SKIP
  @postal_code = postal_code unless postal_code == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @date_of_birth = date_of_birth unless date_of_birth == SKIP
  @vat_registration_number = vat_registration_number unless vat_registration_number == SKIP
  @personal_id_type = personal_id_type unless personal_id_type == SKIP
  @type = type unless type == SKIP
  @identification_number = identification_number unless identification_number == SKIP
  @alias_name = alias_name unless alias_name == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#accountAccount16

Reference number generated by you that uniquely identifies the sender.

Returns:



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

def 
  @account
end

#address1String

Street address of sender. Funds Disbursement This value is the address of the originator sending the funds disbursement.

Returns:

  • (String)


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

def address1
  @address1
end

#administrative_areaString

Sender’s state. Use the [State, Province, and Territory Codes for the United States and Canada](https://developer.cybersource.com/library/documentation/sbc/quickr ef/states_and_provinces.pdf).

Returns:

  • (String)


73
74
75
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 73

def administrative_area
  @administrative_area
end

#alias_nameString

Sender's alias name.

Returns:

  • (String)


137
138
139
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 137

def alias_name
  @alias_name
end

#country_codeString

Country of sender. Use the [ISO Standard Country Codes](https://developer.cybersource.com/library/documentation/sbc/quickre f/countries_alpha_list.pdf).

  • CTV (3)

Returns:

  • (String)


80
81
82
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 80

def country_code
  @country_code
end

#date_of_birthString

Sender’s date of birth in YYYYMMDD format. Required only for FDCCompass.

Returns:

  • (String)


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

def date_of_birth
  @date_of_birth
end

#first_nameString

First name of the sender. This field is applicable for AFT and OCT transactions. Only alpha numeric values are supported.Special characters not in the standard ASCII character set, are not supported and will be stripped before being sent to the processor.

Returns:

  • (String)


26
27
28
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 26

def first_name
  @first_name
end

#identification_numberString

Visa Platform Connect

This tag will contain an acquirer-populated value associated with the API : senderInformation.personalIdType which will identify the personal ID type of the sender.

Returns:

  • (String)


133
134
135
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 133

def identification_number
  @identification_number
end

#last_nameString

Last name of the sender. This field is applicable for AFT and OCT transactions. Only alpha numeric values are supported. Special characters not in the standard ASCII character set, are not supported and will be stripped before being sent to sent to the processor.

Returns:

  • (String)


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

def last_name
  @last_name
end

#localityString

City of sender. Funds Disbursement This value is the city of the originator sending the funds disbursement.

Returns:

  • (String)


66
67
68
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 66

def locality
  @locality
end

#middle_initialString

Recipient middle initial (Optional).

Returns:

  • (String)


30
31
32
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 30

def middle_initial
  @middle_initial
end

#middle_nameString

Middle name of the sender. This field is applicable for AFT and OCT transactions. Only alpha numeric values are supported. Special characters not in the standard ASCII character set, are not supported and will be stripped before being sent to sent to the processor.

Returns:

  • (String)


38
39
40
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 38

def middle_name
  @middle_name
end

#nameString

Name of sender. Funds Disbursement This value is the name of the originator sending the funds disbursement.

  • CTV, Paymentech (30)

Returns:

  • (String)


53
54
55
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 53

def name
  @name
end

#personal_id_typeString

Visa Platform Connect

This tag will contain the type of sender 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)


117
118
119
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 117

def personal_id_type
  @personal_id_type
end

#phone_numberString

Sender’s phone number. Required only for FDCCompass.

Returns:

  • (String)


88
89
90
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 88

def phone_number
  @phone_number
end

#postal_codeString

Sender’s postal code. Required only for FDCCompass.

Returns:

  • (String)


84
85
86
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 84

def postal_code
  @postal_code
end

#reference_numberString

Reference number generated by you that uniquely identifies the sender.

Returns:

  • (String)


14
15
16
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 14

def reference_number
  @reference_number
end

#typeString

Visa Platform Connect

This tag will denote whether the tax ID is a business or individual tax ID when personal ID Type contains the value of TXIN (Tax identification). The valid values are: • B (Business) • I (Individual)

Returns:

  • (String)


126
127
128
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 126

def type
  @type
end

#vat_registration_numberString

Customer's government-assigned tax identification number.

Returns:

  • (String)


96
97
98
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 96

def vat_registration_number
  @vat_registration_number
end

Class Method Details

.from_element(root) ⇒ Object



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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 287

def self.from_element(root)
  reference_number = XmlUtilities.from_element(root, 'referenceNumber',
                                               String)
   = XmlUtilities.from_element(root, 'Account16', Account16)
  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)
  name = XmlUtilities.from_element(root, 'name', String)
  address1 = XmlUtilities.from_element(root, 'address1', String)
  locality = XmlUtilities.from_element(root, 'locality', String)
  administrative_area = XmlUtilities.from_element(root,
                                                  'administrativeArea',
                                                  String)
  country_code = XmlUtilities.from_element(root, 'countryCode', String)
  postal_code = XmlUtilities.from_element(root, 'postalCode', String)
  phone_number = XmlUtilities.from_element(root, 'phoneNumber', String)
  date_of_birth = XmlUtilities.from_element(root, 'dateOfBirth', String)
  vat_registration_number = XmlUtilities.from_element(
    root, 'vatRegistrationNumber', String
  )
  personal_id_type = XmlUtilities.from_element(root, 'personalIdType',
                                               String)
  type = XmlUtilities.from_element(root, 'type', String)
  identification_number = XmlUtilities.from_element(root,
                                                    'identificationNumber',
                                                    String)
  alias_name = XmlUtilities.from_element(root, 'aliasName', String)

  new(reference_number: reference_number,
      account: ,
      first_name: first_name,
      middle_initial: middle_initial,
      middle_name: middle_name,
      last_name: last_name,
      name: name,
      address1: address1,
      locality: locality,
      administrative_area: administrative_area,
      country_code: country_code,
      postal_code: postal_code,
      phone_number: phone_number,
      date_of_birth: date_of_birth,
      vat_registration_number: vat_registration_number,
      personal_id_type: personal_id_type,
      type: type,
      identification_number: identification_number,
      alias_name: alias_name,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
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
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 228

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  reference_number =
    hash.key?('referenceNumber') ? hash['referenceNumber'] : SKIP
   = Account16.from_hash(hash['account']) if hash['account']
  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
  name = hash.key?('name') ? hash['name'] : SKIP
  address1 = hash.key?('address1') ? hash['address1'] : SKIP
  locality = hash.key?('locality') ? hash['locality'] : SKIP
  administrative_area =
    hash.key?('administrativeArea') ? hash['administrativeArea'] : SKIP
  country_code = hash.key?('countryCode') ? hash['countryCode'] : SKIP
  postal_code = hash.key?('postalCode') ? hash['postalCode'] : SKIP
  phone_number = hash.key?('phoneNumber') ? hash['phoneNumber'] : SKIP
  date_of_birth = hash.key?('dateOfBirth') ? hash['dateOfBirth'] : SKIP
  vat_registration_number =
    hash.key?('vatRegistrationNumber') ? hash['vatRegistrationNumber'] : SKIP
  personal_id_type =
    hash.key?('personalIdType') ? hash['personalIdType'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  identification_number =
    hash.key?('identificationNumber') ? hash['identificationNumber'] : SKIP
  alias_name = hash.key?('aliasName') ? hash['aliasName'] : 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.
  SenderInformation3.new(reference_number: reference_number,
                         account: ,
                         first_name: first_name,
                         middle_initial: middle_initial,
                         middle_name: middle_name,
                         last_name: last_name,
                         name: name,
                         address1: address1,
                         locality: locality,
                         administrative_area: administrative_area,
                         country_code: country_code,
                         postal_code: postal_code,
                         phone_number: phone_number,
                         date_of_birth: date_of_birth,
                         vat_registration_number: vat_registration_number,
                         personal_id_type: personal_id_type,
                         type: type,
                         identification_number: identification_number,
                         alias_name: alias_name,
                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 140

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['reference_number'] = 'referenceNumber'
  @_hash['account'] = 'account'
  @_hash['first_name'] = 'firstName'
  @_hash['middle_initial'] = 'middleInitial'
  @_hash['middle_name'] = 'middleName'
  @_hash['last_name'] = 'lastName'
  @_hash['name'] = 'name'
  @_hash['address1'] = 'address1'
  @_hash['locality'] = 'locality'
  @_hash['administrative_area'] = 'administrativeArea'
  @_hash['country_code'] = 'countryCode'
  @_hash['postal_code'] = 'postalCode'
  @_hash['phone_number'] = 'phoneNumber'
  @_hash['date_of_birth'] = 'dateOfBirth'
  @_hash['vat_registration_number'] = 'vatRegistrationNumber'
  @_hash['personal_id_type'] = 'personalIdType'
  @_hash['type'] = 'type'
  @_hash['identification_number'] = 'identificationNumber'
  @_hash['alias_name'] = 'aliasName'
  @_hash
end

.nullablesObject

An array for nullable fields



190
191
192
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 190

def self.nullables
  []
end

.optionalsObject

An array for optional fields



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 165

def self.optionals
  %w[
    reference_number
    account
    first_name
    middle_initial
    middle_name
    last_name
    name
    address1
    locality
    administrative_area
    country_code
    postal_code
    phone_number
    date_of_birth
    vat_registration_number
    personal_id_type
    type
    identification_number
    alias_name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



385
386
387
388
389
390
391
392
393
394
395
396
397
398
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 385

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} reference_number: #{@reference_number.inspect}, account:"\
  " #{@account.inspect}, first_name: #{@first_name.inspect}, middle_initial:"\
  " #{@middle_initial.inspect}, middle_name: #{@middle_name.inspect}, last_name:"\
  " #{@last_name.inspect}, name: #{@name.inspect}, address1: #{@address1.inspect}, locality:"\
  " #{@locality.inspect}, administrative_area: #{@administrative_area.inspect}, country_code:"\
  " #{@country_code.inspect}, postal_code: #{@postal_code.inspect}, phone_number:"\
  " #{@phone_number.inspect}, date_of_birth: #{@date_of_birth.inspect},"\
  " vat_registration_number: #{@vat_registration_number.inspect}, personal_id_type:"\
  " #{@personal_id_type.inspect}, type: #{@type.inspect}, identification_number:"\
  " #{@identification_number.inspect}, alias_name: #{@alias_name.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



372
373
374
375
376
377
378
379
380
381
382
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 372

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} reference_number: #{@reference_number}, account: #{@account}, first_name:"\
  " #{@first_name}, middle_initial: #{@middle_initial}, middle_name: #{@middle_name},"\
  " last_name: #{@last_name}, name: #{@name}, address1: #{@address1}, locality: #{@locality},"\
  " administrative_area: #{@administrative_area}, country_code: #{@country_code}, postal_code:"\
  " #{@postal_code}, phone_number: #{@phone_number}, date_of_birth: #{@date_of_birth},"\
  " vat_registration_number: #{@vat_registration_number}, personal_id_type:"\
  " #{@personal_id_type}, type: #{@type}, identification_number: #{@identification_number},"\
  " alias_name: #{@alias_name}, additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



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
# File 'lib/cyber_source_merged_spec/models/sender_information3.rb', line 338

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

  XmlUtilities.add_as_subelement(doc, root, 'referenceNumber',
                                 reference_number)
  XmlUtilities.add_as_subelement(doc, root, 'Account16', )
  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, 'name', name)
  XmlUtilities.add_as_subelement(doc, root, 'address1', address1)
  XmlUtilities.add_as_subelement(doc, root, 'locality', locality)
  XmlUtilities.add_as_subelement(doc, root, 'administrativeArea',
                                 administrative_area)
  XmlUtilities.add_as_subelement(doc, root, 'countryCode', country_code)
  XmlUtilities.add_as_subelement(doc, root, 'postalCode', postal_code)
  XmlUtilities.add_as_subelement(doc, root, 'phoneNumber', phone_number)
  XmlUtilities.add_as_subelement(doc, root, 'dateOfBirth', date_of_birth)
  XmlUtilities.add_as_subelement(doc, root, 'vatRegistrationNumber',
                                 vat_registration_number)
  XmlUtilities.add_as_subelement(doc, root, 'personalIdType',
                                 personal_id_type)
  XmlUtilities.add_as_subelement(doc, root, 'type', type)
  XmlUtilities.add_as_subelement(doc, root, 'identificationNumber',
                                 identification_number)
  XmlUtilities.add_as_subelement(doc, root, 'aliasName', alias_name)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end