Class: CyberSourceMergedSpec::BillTo67

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

Overview

BillTo67 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(address1:, country:, locality:, postal_code:, address2: SKIP, address3: SKIP, address4: SKIP, administrative_area: SKIP, additional_properties: nil) ⇒ BillTo67

Returns a new instance of BillTo67.



280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 280

def initialize(address1:, country:, locality:, postal_code:, address2: SKIP,
               address3: SKIP, address4: SKIP, administrative_area: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @address1 = address1
  @address2 = address2 unless address2 == SKIP
  @address3 = address3 unless address3 == SKIP
  @address4 = address4 unless address4 == SKIP
  @administrative_area = administrative_area unless administrative_area == SKIP
  @country = country
  @locality = locality
  @postal_code = postal_code
  @additional_properties = additional_properties
end

Instance Attribute Details

#address1String

Payment card billing street address as it appears on the credit card issuer’s records.

SEPA

Required for Create Mandate and Import Mandate

Atos

This field must not contain colons (:).

CyberSource through VisaNet

Important When you populate orderInformation.billTo.address1 and orderInformation.billTo.address2, CyberSource through VisaNet concatenates the two values. If the concatenated value exceeds 40 characters, CyberSource through VisaNet truncates the value at 40 characters before sending it to Visa and the issuing bank. Truncating this value affects AVS results and therefore might also affect risk decisions and chargebacks. Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks.

FDMS Nashville

When the street name is numeric, it must be sent in numeric format. For example, if the address is One First Street, it must be sent as 1 1st Street. Required if keyed; not used if swiped. String (20)

TSYS Acquiring Solutions

Required when processingInformation.billPaymentOptions.billPayment=true and pointOfSaleInformation.entryMode=keyed.

All other processors:

Optional. String (60)

For Payouts

This field may be sent only for FDC Compass. Important It is your responsibility to determine whether a field is required for the transaction you are requesting.

Returns:

  • (String)


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

def address1
  @address1
end

#address2String

Used for additional address information. For example: Attention: Accounts Payable Optional field. For Payouts: This field may be sent only for FDC Compass.

Atos

This field must not contain colons (:).

CyberSource through VisaNet

Important When you populate orderInformation.billTo.address1 and orderInformation.billTo.address2, CyberSource through VisaNet concatenates the two values. If the concatenated value exceeds 40 characters, CyberSource through VisaNet truncates the value at 40 characters before sending it to Visa and the issuing bank. Truncating this value affects AVS results and therefore might also affect risk decisions and chargebacks. Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks.

Chase Paymentech Solutions, FDC Compass, and TSYS Acquiring Solutions

This value is used for AVS.

FDMS Nashville

orderInformation.billTo.address1 and orderInformation.billTo.address2 together cannot exceed 20 characters. String (20)

All Other Processors

String (60)

Returns:

  • (String)


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

def address2
  @address2
end

#address3String

Additional address information (third line of the billing address)

Returns:

  • (String)


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

def address3
  @address3
end

#address4String

Additional address information (fourth line of the billing address)

Returns:

  • (String)


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

def address4
  @address4
end

#administrative_areaString

State or province of the billing address. 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). For Payouts: This field may be sent only for FDC Compass.

CyberSource through VisaNet

Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. Important It is your responsibility to determine whether a field is required for the transaction you are requesting.

Chase Paymentech Solutions

Optional field.

Credit Mutuel-CIC

Optional field.

OmniPay Direct

Optional field.

SIX

Optional field.

TSYS Acquiring Solutions

Required when processingInformation.billPaymentOptions.billPayment=true and pointOfSaleInformation.entryMode=keyed.

Worldpay VAP

Optional field.

All other processors

Not used.

Returns:

  • (String)


131
132
133
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 131

def administrative_area
  @administrative_area
end

#countryString

Payment card billing country. Use the two-character [ISO Standard Country Codes](http://apps.cybersource.com/library/documentation/sbc/quickref/coun tries_alpha_list.pdf).

SEPA/BACS

Required for Create Mandate and Import Mandate

CyberSource through VisaNet

Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks. Important It is your responsibility to determine whether a field is required for the transaction you are requesting.

Chase Paymentech Solutions

Optional field.

Credit Mutuel-CIC

Optional field.

OmniPay Direct

Optional field.

SIX

Optional field.

TSYS Acquiring Solutions

Required when processingInformation.billPaymentOptions.billPayment=true and pointOfSaleInformation.entryMode=keyed.

Worldpay VAP

Optional field.

All other processors

Not used.

Returns:

  • (String)


166
167
168
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 166

def country
  @country
end

#localityString

Payment card billing city.

SEPA

Required for Create Mandate and Import Mandate

Atos

This field must not contain colons (:).

CyberSource through VisaNet

Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks.

For Payouts:

This field may be sent only for FDC Compass.

Chase Paymentech Solutions

Optional field.

Credit Mutuel-CIC

Optional field.

OmniPay Direct

Optional field.

SIX

Optional field.

TSYS Acquiring Solutions

Required when processingInformation.billPaymentOptions.billPayment=true and pointOfSaleInformation.entryMode=keyed.

Worldpay VAP

Optional field.

All other processors

Not used.

Returns:

  • (String)


200
201
202
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 200

def locality
  @locality
end

#postal_codeString

Postal code for the billing address. The postal code must consist of 5 to 9 digits. When the billing country is the U.S., the 9-digit postal code must follow this format: [5 digits][dash][4 digits] Example 12345-6789 When the billing country is Canada, the 6-digit postal code must follow this format: [alpha][numeric][alpha][space][numeric][alpha][numeric] Example A1B 2C3 Important It is your responsibility to determine whether a field is required for the transaction you are requesting.

SEPA

Required for Create Mandate and Import Mandate

For Payouts:

This field may be sent only for FDC Compass.

American Express Direct

Before sending the postal code to the processor, CyberSource removes all nonalphanumeric characters and, if the remaining value is longer than nine characters, truncates the value starting from the right side.

Atos

This field must not contain colons (:).

CyberSource through VisaNet

Credit card networks cannot process transactions that contain non-ASCII characters. CyberSource through VisaNet accepts and stores non-ASCII characters correctly and displays them correctly in reports. However, the limitations of the credit card networks prevent CyberSource through VisaNet from transmitting non-ASCII characters to the credit card networks. Therefore, CyberSource through VisaNet replaces non-ASCII characters with meaningless ASCII characters for transmission to the credit card networks.

FDMS Nashville

Required if pointOfSaleInformation.entryMode=keyed and the address is in the U.S. or Canada. Optional if pointOfSaleInformation.entryMode=keyed and the address is not in the U.S. or Canada. Not used if swiped.

RBS WorldPay Atlanta:

For best card-present keyed rates, send the postal code if pointOfSaleInformation.entryMode=keyed.

TSYS Acquiring Solutions

Required when processingInformation.billPaymentOptions.billPayment=true and pointOfSaleInformation.entryMode=keyed.

All other processors:

Optional field.

Returns:

  • (String)


249
250
251
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 249

def postal_code
  @postal_code
end

Class Method Details

.from_element(root) ⇒ Object



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 331

def self.from_element(root)
  address1 = XmlUtilities.from_element(root, 'address1', String)
  country = XmlUtilities.from_element(root, 'country', String)
  locality = XmlUtilities.from_element(root, 'locality', String)
  postal_code = XmlUtilities.from_element(root, 'postalCode', String)
  address2 = XmlUtilities.from_element(root, 'address2', String)
  address3 = XmlUtilities.from_element(root, 'address3', String)
  address4 = XmlUtilities.from_element(root, 'address4', String)
  administrative_area = XmlUtilities.from_element(root,
                                                  'administrativeArea',
                                                  String)

  new(address1: address1,
      country: country,
      locality: locality,
      postal_code: postal_code,
      address2: address2,
      address3: address3,
      address4: address4,
      administrative_area: administrative_area,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  address1 = hash.key?('address1') ? hash['address1'] : nil
  country = hash.key?('country') ? hash['country'] : nil
  locality = hash.key?('locality') ? hash['locality'] : nil
  postal_code = hash.key?('postalCode') ? hash['postalCode'] : nil
  address2 = hash.key?('address2') ? hash['address2'] : SKIP
  address3 = hash.key?('address3') ? hash['address3'] : SKIP
  address4 = hash.key?('address4') ? hash['address4'] : SKIP
  administrative_area =
    hash.key?('administrativeArea') ? hash['administrativeArea'] : 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.
  BillTo67.new(address1: address1,
               country: country,
               locality: locality,
               postal_code: postal_code,
               address2: address2,
               address3: address3,
               address4: address4,
               administrative_area: administrative_area,
               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 252

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['address1'] = 'address1'
  @_hash['address2'] = 'address2'
  @_hash['address3'] = 'address3'
  @_hash['address4'] = 'address4'
  @_hash['administrative_area'] = 'administrativeArea'
  @_hash['country'] = 'country'
  @_hash['locality'] = 'locality'
  @_hash['postal_code'] = 'postalCode'
  @_hash
end

.nullablesObject

An array for nullable fields



276
277
278
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 276

def self.nullables
  []
end

.optionalsObject

An array for optional fields



266
267
268
269
270
271
272
273
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 266

def self.optionals
  %w[
    address2
    address3
    address4
    administrative_area
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



382
383
384
385
386
387
388
389
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 382

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} address1: #{@address1.inspect}, address2: #{@address2.inspect}, address3:"\
  " #{@address3.inspect}, address4: #{@address4.inspect}, administrative_area:"\
  " #{@administrative_area.inspect}, country: #{@country.inspect}, locality:"\
  " #{@locality.inspect}, postal_code: #{@postal_code.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



373
374
375
376
377
378
379
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 373

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} address1: #{@address1}, address2: #{@address2}, address3: #{@address3},"\
  " address4: #{@address4}, administrative_area: #{@administrative_area}, country:"\
  " #{@country}, locality: #{@locality}, postal_code: #{@postal_code}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/cyber_source_merged_spec/models/bill_to67.rb', line 354

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

  XmlUtilities.add_as_subelement(doc, root, 'address1', address1)
  XmlUtilities.add_as_subelement(doc, root, 'country', country)
  XmlUtilities.add_as_subelement(doc, root, 'locality', locality)
  XmlUtilities.add_as_subelement(doc, root, 'postalCode', postal_code)
  XmlUtilities.add_as_subelement(doc, root, 'address2', address2)
  XmlUtilities.add_as_subelement(doc, root, 'address3', address3)
  XmlUtilities.add_as_subelement(doc, root, 'address4', address4)
  XmlUtilities.add_as_subelement(doc, root, 'administrativeArea',
                                 administrative_area)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end