Class: CyberSourceMergedSpec::MerchantInformation

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

Overview

MerchantInformation 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(merchant_descriptor: SKIP, domain_name: SKIP, sales_organization_id: SKIP, category_code: SKIP, category_code_domestic: SKIP, tax_id: SKIP, vat_registration_number: SKIP, card_acceptor_reference_number: SKIP, transaction_local_date_time: SKIP, service_fee_descriptor: SKIP, cancel_url: SKIP, success_url: SKIP, failure_url: SKIP, return_url: SKIP, partner_id_code: SKIP, service_location: SKIP, note_to_buyer: SKIP, merchant_name: SKIP, additional_properties: nil) ⇒ MerchantInformation

Returns a new instance of MerchantInformation.



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/merchant_information.rb', line 246

def initialize(merchant_descriptor: SKIP, domain_name: SKIP,
               sales_organization_id: SKIP, category_code: SKIP,
               category_code_domestic: SKIP, tax_id: SKIP,
               vat_registration_number: SKIP,
               card_acceptor_reference_number: SKIP,
               transaction_local_date_time: SKIP,
               service_fee_descriptor: SKIP, cancel_url: SKIP,
               success_url: SKIP, failure_url: SKIP, return_url: SKIP,
               partner_id_code: SKIP, service_location: SKIP,
               note_to_buyer: SKIP, merchant_name: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @merchant_descriptor = merchant_descriptor unless merchant_descriptor == SKIP
  @domain_name = domain_name unless domain_name == SKIP
  @sales_organization_id = sales_organization_id unless sales_organization_id == SKIP
  @category_code = category_code unless category_code == SKIP
  @category_code_domestic = category_code_domestic unless category_code_domestic == SKIP
  @tax_id = tax_id unless tax_id == SKIP
  @vat_registration_number = vat_registration_number unless vat_registration_number == SKIP
  unless card_acceptor_reference_number == SKIP
    @card_acceptor_reference_number =
      card_acceptor_reference_number
  end
  unless transaction_local_date_time == SKIP
    @transaction_local_date_time =
      transaction_local_date_time
  end
  @service_fee_descriptor = service_fee_descriptor unless service_fee_descriptor == SKIP
  @cancel_url = cancel_url unless cancel_url == SKIP
  @success_url = success_url unless success_url == SKIP
  @failure_url = failure_url unless failure_url == SKIP
  @return_url = return_url unless return_url == SKIP
  @partner_id_code = partner_id_code unless partner_id_code == SKIP
  @service_location = service_location unless service_location == SKIP
  @note_to_buyer = note_to_buyer unless note_to_buyer == SKIP
  @merchant_name = merchant_name unless merchant_name == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#cancel_urlString

customer would be redirected to this url based on the decision of the transaction

Returns:

  • (String)


149
150
151
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 149

def cancel_url
  @cancel_url
end

#card_acceptor_reference_numberString

Reference number that facilitates card acceptor/corporation communication and record keeping.

Returns:

  • (String)


98
99
100
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 98

def card_acceptor_reference_number
  @card_acceptor_reference_number
end

#category_codeInteger

The value for this field is a four-digit number that the payment card industry uses to classify merchants into market segments. A payment card company assigned one or more of these values to your business when you started accepting the payment card company’s cards. When you do not include this field in your request, CyberSource uses the value in your CyberSource account.

CyberSource through VisaNet

The value for this field corresponds to the following data in the TC 33 capture file5:

  • Record: CP01 TCR4
  • Position: 150-153
  • Field: Merchant Category Code

Returns:

  • (Integer)


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

def category_code
  @category_code
end

#category_code_domesticInteger

Merchant category code for domestic transactions. The value for this field is a four-digit number that the payment card industry uses to classify merchants into market segments. A payment card company assigned one or more of these values to your business when you started accepting the payment card company’s cards. Including this field in a request for a domestic transaction might reduce interchange fees. When you include this field in a request:

  • Do not include the merchant_category_code field.
  • The value for this field overrides the value in your CyberSource account. This field is supported only for:
  • Domestic transactions with Mastercard in Spain. Domestic means that you and the cardholder are in the same country.
  • Merchants enrolled in the OmniPay Direct interchange program.
  • First Data Merchant Solutions (Europe) on OmniPay Direct.

Returns:

  • (Integer)


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

def category_code_domestic
  @category_code_domestic
end

#domain_nameString

This field will contain either the merchant url or the reverse domain as per the requirement for DSRP Format 3. This might vary transaction to transaction and might not be static. Merchant needs to have access to send this value for all DSRP program.

Returns:

  • (String)


21
22
23
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 21

def domain_name
  @domain_name
end

#failure_urlString

customer would be redirected to this url based on the decision of the transaction

Returns:

  • (String)


159
160
161
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 159

def failure_url
  @failure_url
end

#merchant_descriptorMerchantDescriptor

TODO: Write general description for this method

Returns:



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

def merchant_descriptor
  @merchant_descriptor
end

#merchant_nameString

Use this field only if you are requesting payment with Payer Authentication serice together. Your company’s name as you want it to appear to the customer in the issuing bank’s authentication form. This value overrides the value specified by your merchant bank.

Returns:

  • (String)


191
192
193
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 191

def merchant_name
  @merchant_name
end

#note_to_buyerString

Free-form text field.

Returns:

  • (String)


183
184
185
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 183

def note_to_buyer
  @note_to_buyer
end

#partner_id_codeString

Visa Platform Connect

This field may be used for transactions on accounts issued under co-branding agreements when one of the co-branding partners.

Returns:

  • (String)


172
173
174
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 172

def partner_id_code
  @partner_id_code
end

#return_urlString

URL for displaying payment results to the consumer (notifications) after the transaction is processed. Usually this URL belongs to merchant and its behavior is defined by merchant

Returns:

  • (String)


165
166
167
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 165

def return_url
  @return_url
end

#sales_organization_idString

Company ID assigned to an independent sales organization. Get this value from Mastercard.

CyberSource through VisaNet

The value for this field corresponds to the following data in the TC 33 capture file:

  • Record: CP01 TCR6
  • Position: 106-116
  • Field: Independent Sales Organization ID This field is supported for Visa, Mastercard and Discover Transactions. Note The TC 33 Capture file contains information about the purchases and refunds that a merchant submits to CyberSource. CyberSource through VisaNet creates the TC 33 Capture file at the end of the day and sends it to the merchant’s acquirer, who uses this information to facilitate end-of-day clearing processing with payment card companies.

Returns:

  • (String)


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

def sales_organization_id
  @sales_organization_id
end

#service_fee_descriptorServiceFeeDescriptor

Date and time at your physical location. Format: YYYYMMDDhhmmss, where:

  • YYYY = year
  • MM = month
  • DD = day
  • hh = hour
  • mm = minutes
  • ss = seconds

Used by

Authorization Required for these processors:

  • American Express Direct

                                    - American Express Direct
    
  • Credit Mutuel-CIC

  • FDC Nashville Global

  • SIX Optional for all other processors.



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

def service_fee_descriptor
  @service_fee_descriptor
end

#service_locationServiceLocation

Visa Platform Connect

This field may be used for transactions on accounts issued under co-branding agreements when one of the co-branding partners.

Returns:



179
180
181
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 179

def service_location
  @service_location
end

#success_urlString

customer would be redirected to this url based on the decision of the transaction

Returns:

  • (String)


154
155
156
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 154

def success_url
  @success_url
end

#tax_idString

Your Cadastro Nacional da Pessoa Jurídica (CNPJ) number. This field is supported only for BNDES transactions on CyberSource through VisaNet. The value for this field corresponds to the following data in the TC 33 capture file5:

  • Record: CP07 TCR6
  • Position: 40-59
  • Field: BNDES Reference Field 1

Returns:

  • (String)


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

def tax_id
  @tax_id
end

#transaction_local_date_timeString

Date and time at your physical location. Format: YYYYMMDDhhmmss, where:

  • YYYY = year
  • MM = month
  • DD = day
  • hh = hour
  • mm = minutes
  • ss = seconds

Used by

Authorization Required for these processors:

  • American Express Direct

                                    - American Express Direct
    
  • Credit Mutuel-CIC

  • FDC Nashville Global

  • SIX Optional for all other processors.

Returns:

  • (String)


121
122
123
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 121

def transaction_local_date_time
  @transaction_local_date_time
end

#vat_registration_numberString

Your government-assigned tax identification number.

Tax Calculation

Required field for value added tax only. Not applicable to U.S. and Canadian taxes.

CyberSource through VisaNet

For CtV processors, the maximum length is 20.

Returns:

  • (String)


93
94
95
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 93

def vat_registration_number
  @vat_registration_number
end

Class Method Details

.from_element(root) ⇒ Object



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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 349

def self.from_element(root)
  merchant_descriptor = XmlUtilities.from_element(root,
                                                  'MerchantDescriptor',
                                                  MerchantDescriptor)
  domain_name = XmlUtilities.from_element(root, 'domainName', String)
  sales_organization_id = XmlUtilities.from_element(root,
                                                    'salesOrganizationId',
                                                    String)
  category_code = XmlUtilities.from_element(root, 'categoryCode', Integer)
  category_code_domestic = XmlUtilities.from_element(root,
                                                     'categoryCodeDomestic',
                                                     Integer)
  tax_id = XmlUtilities.from_element(root, 'taxId', String)
  vat_registration_number = XmlUtilities.from_element(
    root, 'vatRegistrationNumber', String
  )
  card_acceptor_reference_number = XmlUtilities.from_element(
    root, 'cardAcceptorReferenceNumber', String
  )
  transaction_local_date_time = XmlUtilities.from_element(
    root, 'transactionLocalDateTime', String
  )
  service_fee_descriptor = XmlUtilities.from_element(root,
                                                     'ServiceFeeDescriptor',
                                                     ServiceFeeDescriptor)
  cancel_url = XmlUtilities.from_element(root, 'cancelUrl', String)
  success_url = XmlUtilities.from_element(root, 'successUrl', String)
  failure_url = XmlUtilities.from_element(root, 'failureUrl', String)
  return_url = XmlUtilities.from_element(root, 'returnUrl', String)
  partner_id_code = XmlUtilities.from_element(root, 'partnerIdCode', String)
  service_location = XmlUtilities.from_element(root, 'ServiceLocation',
                                               ServiceLocation)
  note_to_buyer = XmlUtilities.from_element(root, 'noteToBuyer', String)
  merchant_name = XmlUtilities.from_element(root, 'merchantName', String)

  new(merchant_descriptor: merchant_descriptor,
      domain_name: domain_name,
      sales_organization_id: sales_organization_id,
      category_code: category_code,
      category_code_domestic: category_code_domestic,
      tax_id: tax_id,
      vat_registration_number: vat_registration_number,
      card_acceptor_reference_number: card_acceptor_reference_number,
      transaction_local_date_time: transaction_local_date_time,
      service_fee_descriptor: service_fee_descriptor,
      cancel_url: cancel_url,
      success_url: success_url,
      failure_url: failure_url,
      return_url: return_url,
      partner_id_code: partner_id_code,
      service_location: service_location,
      note_to_buyer: note_to_buyer,
      merchant_name: merchant_name,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 288

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  merchant_descriptor = MerchantDescriptor.from_hash(hash['merchantDescriptor']) if
    hash['merchantDescriptor']
  domain_name = hash.key?('domainName') ? hash['domainName'] : SKIP
  sales_organization_id =
    hash.key?('salesOrganizationId') ? hash['salesOrganizationId'] : SKIP
  category_code = hash.key?('categoryCode') ? hash['categoryCode'] : SKIP
  category_code_domestic =
    hash.key?('categoryCodeDomestic') ? hash['categoryCodeDomestic'] : SKIP
  tax_id = hash.key?('taxId') ? hash['taxId'] : SKIP
  vat_registration_number =
    hash.key?('vatRegistrationNumber') ? hash['vatRegistrationNumber'] : SKIP
  card_acceptor_reference_number =
    hash.key?('cardAcceptorReferenceNumber') ? hash['cardAcceptorReferenceNumber'] : SKIP
  transaction_local_date_time =
    hash.key?('transactionLocalDateTime') ? hash['transactionLocalDateTime'] : SKIP
  service_fee_descriptor = ServiceFeeDescriptor.from_hash(hash['serviceFeeDescriptor']) if
    hash['serviceFeeDescriptor']
  cancel_url = hash.key?('cancelUrl') ? hash['cancelUrl'] : SKIP
  success_url = hash.key?('successUrl') ? hash['successUrl'] : SKIP
  failure_url = hash.key?('failureUrl') ? hash['failureUrl'] : SKIP
  return_url = hash.key?('returnUrl') ? hash['returnUrl'] : SKIP
  partner_id_code =
    hash.key?('partnerIdCode') ? hash['partnerIdCode'] : SKIP
  service_location = ServiceLocation.from_hash(hash['serviceLocation']) if
    hash['serviceLocation']
  note_to_buyer = hash.key?('noteToBuyer') ? hash['noteToBuyer'] : SKIP
  merchant_name = hash.key?('merchantName') ? hash['merchantName'] : 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.
  MerchantInformation.new(merchant_descriptor: merchant_descriptor,
                          domain_name: domain_name,
                          sales_organization_id: sales_organization_id,
                          category_code: category_code,
                          category_code_domestic: category_code_domestic,
                          tax_id: tax_id,
                          vat_registration_number: vat_registration_number,
                          card_acceptor_reference_number: card_acceptor_reference_number,
                          transaction_local_date_time: transaction_local_date_time,
                          service_fee_descriptor: service_fee_descriptor,
                          cancel_url: cancel_url,
                          success_url: success_url,
                          failure_url: failure_url,
                          return_url: return_url,
                          partner_id_code: partner_id_code,
                          service_location: service_location,
                          note_to_buyer: note_to_buyer,
                          merchant_name: merchant_name,
                          additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 194

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['merchant_descriptor'] = 'merchantDescriptor'
  @_hash['domain_name'] = 'domainName'
  @_hash['sales_organization_id'] = 'salesOrganizationId'
  @_hash['category_code'] = 'categoryCode'
  @_hash['category_code_domestic'] = 'categoryCodeDomestic'
  @_hash['tax_id'] = 'taxId'
  @_hash['vat_registration_number'] = 'vatRegistrationNumber'
  @_hash['card_acceptor_reference_number'] = 'cardAcceptorReferenceNumber'
  @_hash['transaction_local_date_time'] = 'transactionLocalDateTime'
  @_hash['service_fee_descriptor'] = 'serviceFeeDescriptor'
  @_hash['cancel_url'] = 'cancelUrl'
  @_hash['success_url'] = 'successUrl'
  @_hash['failure_url'] = 'failureUrl'
  @_hash['return_url'] = 'returnUrl'
  @_hash['partner_id_code'] = 'partnerIdCode'
  @_hash['service_location'] = 'serviceLocation'
  @_hash['note_to_buyer'] = 'noteToBuyer'
  @_hash['merchant_name'] = 'merchantName'
  @_hash
end

.nullablesObject

An array for nullable fields



242
243
244
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 242

def self.nullables
  []
end

.optionalsObject

An array for optional fields



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 218

def self.optionals
  %w[
    merchant_descriptor
    domain_name
    sales_organization_id
    category_code
    category_code_domestic
    tax_id
    vat_registration_number
    card_acceptor_reference_number
    transaction_local_date_time
    service_fee_descriptor
    cancel_url
    success_url
    failure_url
    return_url
    partner_id_code
    service_location
    note_to_buyer
    merchant_name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 457

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} merchant_descriptor: #{@merchant_descriptor.inspect}, domain_name:"\
  " #{@domain_name.inspect}, sales_organization_id: #{@sales_organization_id.inspect},"\
  " category_code: #{@category_code.inspect}, category_code_domestic:"\
  " #{@category_code_domestic.inspect}, tax_id: #{@tax_id.inspect}, vat_registration_number:"\
  " #{@vat_registration_number.inspect}, card_acceptor_reference_number:"\
  " #{@card_acceptor_reference_number.inspect}, transaction_local_date_time:"\
  " #{@transaction_local_date_time.inspect}, service_fee_descriptor:"\
  " #{@service_fee_descriptor.inspect}, cancel_url: #{@cancel_url.inspect}, success_url:"\
  " #{@success_url.inspect}, failure_url: #{@failure_url.inspect}, return_url:"\
  " #{@return_url.inspect}, partner_id_code: #{@partner_id_code.inspect}, service_location:"\
  " #{@service_location.inspect}, note_to_buyer: #{@note_to_buyer.inspect}, merchant_name:"\
  " #{@merchant_name.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 442

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} merchant_descriptor: #{@merchant_descriptor}, domain_name: #{@domain_name},"\
  " sales_organization_id: #{@sales_organization_id}, category_code: #{@category_code},"\
  " category_code_domestic: #{@category_code_domestic}, tax_id: #{@tax_id},"\
  " vat_registration_number: #{@vat_registration_number}, card_acceptor_reference_number:"\
  " #{@card_acceptor_reference_number}, transaction_local_date_time:"\
  " #{@transaction_local_date_time}, service_fee_descriptor: #{@service_fee_descriptor},"\
  " cancel_url: #{@cancel_url}, success_url: #{@success_url}, failure_url: #{@failure_url},"\
  " return_url: #{@return_url}, partner_id_code: #{@partner_id_code}, service_location:"\
  " #{@service_location}, note_to_buyer: #{@note_to_buyer}, merchant_name: #{@merchant_name},"\
  " additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/cyber_source_merged_spec/models/merchant_information.rb', line 405

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

  XmlUtilities.add_as_subelement(doc, root, 'MerchantDescriptor',
                                 merchant_descriptor)
  XmlUtilities.add_as_subelement(doc, root, 'domainName', domain_name)
  XmlUtilities.add_as_subelement(doc, root, 'salesOrganizationId',
                                 sales_organization_id)
  XmlUtilities.add_as_subelement(doc, root, 'categoryCode', category_code)
  XmlUtilities.add_as_subelement(doc, root, 'categoryCodeDomestic',
                                 category_code_domestic)
  XmlUtilities.add_as_subelement(doc, root, 'taxId', tax_id)
  XmlUtilities.add_as_subelement(doc, root, 'vatRegistrationNumber',
                                 vat_registration_number)
  XmlUtilities.add_as_subelement(doc, root, 'cardAcceptorReferenceNumber',
                                 card_acceptor_reference_number)
  XmlUtilities.add_as_subelement(doc, root, 'transactionLocalDateTime',
                                 transaction_local_date_time)
  XmlUtilities.add_as_subelement(doc, root, 'ServiceFeeDescriptor',
                                 service_fee_descriptor)
  XmlUtilities.add_as_subelement(doc, root, 'cancelUrl', cancel_url)
  XmlUtilities.add_as_subelement(doc, root, 'successUrl', success_url)
  XmlUtilities.add_as_subelement(doc, root, 'failureUrl', failure_url)
  XmlUtilities.add_as_subelement(doc, root, 'returnUrl', return_url)
  XmlUtilities.add_as_subelement(doc, root, 'partnerIdCode',
                                 partner_id_code)
  XmlUtilities.add_as_subelement(doc, root, 'ServiceLocation',
                                 service_location)
  XmlUtilities.add_as_subelement(doc, root, 'noteToBuyer', note_to_buyer)
  XmlUtilities.add_as_subelement(doc, root, 'merchantName', merchant_name)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end