Class: VisaAcceptanceMergedSpec::InstallmentInformation

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/installment_information.rb

Overview

InstallmentInformation 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(amount: SKIP, frequency: SKIP, plan_type: SKIP, sequence: SKIP, total_amount: SKIP, total_count: SKIP, first_installment_date: SKIP, invoice_data: SKIP, payment_type: SKIP, eligibility_inquiry: SKIP, grace_period_duration: SKIP, grace_period_duration_type: SKIP, first_installment_amount: SKIP, validation_indicator: SKIP, identifier: SKIP, annual_interest_rate: SKIP, interest_indicator: SKIP, is_government_plan: SKIP, additional_properties: nil) ⇒ InstallmentInformation

Returns a new instance of InstallmentInformation.



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
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 359

def initialize(amount: SKIP, frequency: SKIP, plan_type: SKIP,
               sequence: SKIP, total_amount: SKIP, total_count: SKIP,
               first_installment_date: SKIP, invoice_data: SKIP,
               payment_type: SKIP, eligibility_inquiry: SKIP,
               grace_period_duration: SKIP,
               grace_period_duration_type: SKIP,
               first_installment_amount: SKIP, validation_indicator: SKIP,
               identifier: SKIP, annual_interest_rate: SKIP,
               interest_indicator: SKIP, is_government_plan: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @amount = amount unless amount == SKIP
  @frequency = frequency unless frequency == SKIP
  @plan_type = plan_type unless plan_type == SKIP
  @sequence = sequence unless sequence == SKIP
  @total_amount = total_amount unless total_amount == SKIP
  @total_count = total_count unless total_count == SKIP
  @first_installment_date = first_installment_date unless first_installment_date == SKIP
  @invoice_data = invoice_data unless invoice_data == SKIP
  @payment_type = payment_type unless payment_type == SKIP
  @eligibility_inquiry = eligibility_inquiry unless eligibility_inquiry == SKIP
  @grace_period_duration = grace_period_duration unless grace_period_duration == SKIP
  unless grace_period_duration_type == SKIP
    @grace_period_duration_type =
      grace_period_duration_type
  end
  @first_installment_amount = first_installment_amount unless first_installment_amount == SKIP
  @validation_indicator = validation_indicator unless validation_indicator == SKIP
  @identifier = identifier unless identifier == SKIP
  @annual_interest_rate = annual_interest_rate unless annual_interest_rate == SKIP
  @interest_indicator = interest_indicator unless interest_indicator == SKIP
  @is_government_plan = is_government_plan unless is_government_plan == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#amountString

Amount for the current installment payment. This field is supported only for Visa Acceptance through VisaNet.

Returns:

  • (String)


15
16
17
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 15

def amount
  @amount
end

#annual_interest_rateString

Annual interest rate. This field is returned only for two kinds of installment payments on Visa Platform Connect:

  • Crediario with Visa in Brazil: this field is included in the authorization response for the Crediario eligibility request when the issuer approves the customer's request for Crediario installment payments.
  • Mastercard in all countries except Brazil, Croatia, Georgia, and Greece. Example: A value of 1.0 specifies 1%. Example: A value of 4.0 specifies 4%.

Brazil

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

  • Record: CP01 TCR9
  • Position: 151-157
  • Field: Annual Interest Rate

Other Countries

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

  • Record: CP01 TCR5
  • Position: 58-62 SCMP API Fields| 216
  • Field: Mastercard Annual Percentage Rate

Returns:

  • (String)


287
288
289
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 287

def annual_interest_rate
  @annual_interest_rate
end

#eligibility_inquiryString

Indicates whether the authorization request is a Crediario eligibility inquiry. Set the value for this field to Crediario. This field is supported only for Crediario installment payments in Brazil on Visa Acceptance through VisaNet.

Returns:

  • (String)


215
216
217
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 215

def eligibility_inquiry
  @eligibility_inquiry
end

#first_installment_amountString

Amount of the first installment payment. The issuer provides this value when the first installment payment is successful. This field is supported for Mastercard installment payments on Visa Acceptance through VisaNet in all countries except Brazil,Croatia, Georgia, and Greece. The value for this field corresponds to the following data in the TC 33 capture file:

  • Record: CP01 TCR5
  • Position: 23-34
  • Field: Amount of Each Installment

Returns:

  • (String)


253
254
255
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 253

def first_installment_amount
  @first_installment_amount
end

#first_installment_dateString

Date of the first installment payment. Format: YYMMDD. When you do not include this field, Visa Acceptance sends a string of six zeros (000000) to the processor. This field is supported only for Crediario installment payments in Brazil on Visa Acceptance through VisaNet. The value for this field corresponds to the following data in the TC 33 capture file:

  • Record: CP01 TCR9
  • Position: 42-47
  • Field: Date of First Installment

Returns:

  • (String)


165
166
167
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 165

def first_installment_date
  @first_installment_date
end

#frequencyString

Frequency of the installment payments. When you do not include this field in a request for a Crediario installment payment, Visa Acceptance sends a space character to the processor. This field is supported only for Visa Acceptance through VisaNet. Possible values:

  • B: Biweekly
  • M: Monthly
  • W: Weekly For Crediario installment payments, the value for this field corresponds to the following data in the TC 33 capture file5:
  • Record: CP01 TCR9
  • Position: 41
  • Field: Installment Frequency

Returns:

  • (String)


32
33
34
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 32

def frequency
  @frequency
end

#grace_period_durationString

Grace period requested by the customer before the first installment payment is due. When you include this field in a request, you must also include the grace period duration type field. The value for this field corresponds to the following data in the TC 33 capture file3: Record: CP01 TCR5, Position: 100-101, Field: Mastercard Grace Period Details. This field is supported only for Mastercard installment payments in Brazil and Greece.

Returns:

  • (String)


227
228
229
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 227

def grace_period_duration
  @grace_period_duration
end

#grace_period_duration_typeString

Unit for the requested grace period duration. Possible values:

  • D: Days
  • W: Weeks
  • M: Months The value for this field corresponds to the following data in the TC 33 capture file3: Record: CP01 TCR5, Position: 99, Field: Mastercard Grace Period Details This field is supported only for Mastercard installment payments in Brazil and Greece on Visa Acceptance through VisaNet.

Returns:

  • (String)


240
241
242
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 240

def grace_period_duration_type
  @grace_period_duration_type
end

#identifierString

Standing Instruction/Installment identifier.

Returns:

  • (String)


263
264
265
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 263

def identifier
  @identifier
end

#interest_indicatorString

Indicates if the installment plan has interest. Possible values: -Y - with interest -N - without interest -NULL - Do not send the field if no information available

Returns:

  • (String)


295
296
297
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 295

def interest_indicator
  @interest_indicator
end

#invoice_dataString

Invoice information that you want to provide to the issuer. This value is similar to a tracking number and is the same for all installment payments for one purchase. This field is supported only for installment payments with Mastercard on Visa Acceptance through VisaNet in Brazil. The value for this field corresponds to the following data in the TC 33 capture file5:

  • Record: CP07 TCR4
  • Position: 51-70
  • Field: Purchase Identification

Returns:

  • (String)


178
179
180
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 178

def invoice_data
  @invoice_data
end

#is_government_planTrueClass | FalseClass

Indicates if an installment plan is a government sponsored or part of a government program. Possible values: -true -false This field defaults to false when no value is provided.

Returns:

  • (TrueClass | FalseClass)


304
305
306
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 304

def is_government_plan
  @is_government_plan
end

#payment_typeString

Payment plan for the installments. This field is supported only for installment payments on Visa Platform Connect, RuPay and SPG-KSA seamless flow. Possible values for a standing-instruction (SI) merchant-initiated transaction (MIT) with Diners Club or Mastercard in India or with an India-issued card:

  • 1: SI with a fixed amount.
  • 2: SI with a maximum amount.
  • 3: Other kind of SI. Possible values for a type of Installment transaction for on-soil transaction in Kingdom of Saudi Arabia
  • 1: Registration or first transaction.
  • 2: Subsequent transaction. Possible values for other kinds of installment payments:
  • 0 (default): Regular installment. This value is not allowed for airline transactions.
  • 1: Installment payment with down payment.
  • 2: Installment payment without down payment. This value is supported only for airline transactions.
  • 3: Installment payment; down payment and boarding fee will follow. This value is supported only for airline transactions.
  • 4: Down payment only; regular installment payment will follow.
  • 5: Boarding fee only. This value is supported only for airline transactions.
  • 6: SI de-registration on RuPay for the payer authentication seamless flow.

Returns:

  • (String)


207
208
209
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 207

def payment_type
  @payment_type
end

#plan_typeString

American Express Direct, Cielo, and Visa Acceptance Latin American

Processing Flag that indicates the type of funding for the installment plan associated with the payment. Possible values:

  • 1: Merchant-funded installment plan
  • 2: Issuer-funded installment plan If you do not include this field in the request, Visa Acceptance uses the value in your Visa Acceptance account. To change the value in your Visa Acceptance account, contact Visa Acceptance Customer Service.

Visa Acceptance through VisaNet and American Express

Defined code that indicates the type of installment plan for this transaction. Contact American Express for:

  • Information about the kinds of installment plans that American Express provides
  • Values for this field For installment payments with American Express in Brazil, the value for this field corresponds to the following data in the TC 33 capture file*:
  • Record: CP07 TCR3
  • Position: 5-6
  • Field: Plan Type
  • The TC 33 Capture file contains information about the purchases and refunds that a merchant submits to Visa Acceptance. Visa Acceptance 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.

Visa Acceptance through VisaNet with Visa or Mastercard

Flag indicating the type of funding for the installment plan associated with the payment. Possible values:

  • 1 or 01: Merchant-funded installment plan
  • 2 or 02: Issuer-funded installment plan
  • 43: Crediario installment plan—only with Visa in Brazil For installment payments with Visa in Brazil, the value for this field corresponds to the following data in the TC 33 capture file5:
  • Record: CP07 TCR1
  • Position: 5-6
  • Field: Installment Type For all other kinds of installment payments, the value for this field corresponds to the following data in the TC 33 capture file5:
  • Record: CP01 TCR5
  • Position: 39-40
  • Field: Installment Plan Type (Issuer or Merchant)

Returns:

  • (String)


80
81
82
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 80

def plan_type
  @plan_type
end

#sequenceInteger

Installment number when making payments in installments. Used along with totalCount to track which payment is being processed. For example, the second of 5 payments would be passed to Visa Acceptance as sequence = 2 and totalCount = 5.

Chase Paymentech Solutions and FDC Compass

This field is optional because this value is required in the merchant descriptors.

Visa Acceptance through VisaNet

When you do not include this field in a request for a Crediario installment payment, Visa Acceptance sends a value of 0 to the processor. For Crediario installment payments, the value for this field corresponds to the following data in the TC 33 capture file*:

  • Record: CP01 TCR9
  • Position: 38-40
  • Field: Installment Payment Number
  • The TC 33 Capture file contains information about the purchases and refunds that a merchant submits to Visa Acceptance. Visa Acceptance 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:

  • (Integer)


103
104
105
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 103

def sequence
  @sequence
end

#total_amountString

Total amount of the loan that is being paid in installments. This field is supported only for Visa Acceptance through VisaNet.

Returns:

  • (String)


109
110
111
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 109

def total_amount
  @total_amount
end

#total_countInteger

Total number of installments when making payments in installments.

Chase Paymentech Solutions and FDC Compass

This field is optional because this value is required in the merchant descriptors.

American Express Direct, Cielo, and Comercio Latino

This value is the total number of installments you approved.

Visa Acceptance Latin American Processing in Brazil

This value is the total number of installments that you approved. The default is 1.

All Other Processors

This value is used along with sequence to track which payment is being processed. For example, the second of 5 payments would be passed to Visa Acceptance as sequence = 2 and totalCount = 5.

Visa Acceptance through VisaNet

For Crediario installment payments, the value for this field corresponds to the following data in the TC 33 capture file*:

  • Record: CP01 TCR9
  • Position: 23-25
  • Field: Number of Installments For installment payments with American Express in Brazil, the value for this field corresponds to the following data in the TC 33 capture file*:
  • Record: CP07 TCR3
  • Position: 7-8
  • Field: Number of Installments For installment payments with Visa in Brazil, the value for this field corresponds to the following data in the TC 33 capture file*:
  • Record: CP07 TCR1
  • Position: 7-8
  • Field: Number of Installments For all other kinds of installment payments, the value for this field corresponds to the following data in the TC 33 capture file*:
  • Record: CP01 TCR5
  • Position: 20-22
  • Field: Installment Total Count Note The TC 33 Capture file contains information about the purchases and refunds that a merchant submits to Visa Acceptance. Visa Acceptance 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:

  • (Integer)


152
153
154
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 152

def total_count
  @total_count
end

#validation_indicatorString

Standing Instruction/Installment validation indicator.

  • '1': Prevalidated
  • '2': Not Validated

Returns:

  • (String)


259
260
261
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 259

def validation_indicator
  @validation_indicator
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



397
398
399
400
401
402
403
404
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
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 397

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  amount = hash.key?('amount') ? hash['amount'] : SKIP
  frequency = hash.key?('frequency') ? hash['frequency'] : SKIP
  plan_type = hash.key?('planType') ? hash['planType'] : SKIP
  sequence = hash.key?('sequence') ? hash['sequence'] : SKIP
  total_amount = hash.key?('totalAmount') ? hash['totalAmount'] : SKIP
  total_count = hash.key?('totalCount') ? hash['totalCount'] : SKIP
  first_installment_date =
    hash.key?('firstInstallmentDate') ? hash['firstInstallmentDate'] : SKIP
  invoice_data = hash.key?('invoiceData') ? hash['invoiceData'] : SKIP
  payment_type = hash.key?('paymentType') ? hash['paymentType'] : SKIP
  eligibility_inquiry =
    hash.key?('eligibilityInquiry') ? hash['eligibilityInquiry'] : SKIP
  grace_period_duration =
    hash.key?('gracePeriodDuration') ? hash['gracePeriodDuration'] : SKIP
  grace_period_duration_type =
    hash.key?('gracePeriodDurationType') ? hash['gracePeriodDurationType'] : SKIP
  first_installment_amount =
    hash.key?('firstInstallmentAmount') ? hash['firstInstallmentAmount'] : SKIP
  validation_indicator =
    hash.key?('validationIndicator') ? hash['validationIndicator'] : SKIP
  identifier = hash.key?('identifier') ? hash['identifier'] : SKIP
  annual_interest_rate =
    hash.key?('annualInterestRate') ? hash['annualInterestRate'] : SKIP
  interest_indicator =
    hash.key?('interestIndicator') ? hash['interestIndicator'] : SKIP
  is_government_plan =
    hash.key?('isGovernmentPlan') ? hash['isGovernmentPlan'] : 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.
  InstallmentInformation.new(amount: amount,
                             frequency: frequency,
                             plan_type: plan_type,
                             sequence: sequence,
                             total_amount: total_amount,
                             total_count: total_count,
                             first_installment_date: first_installment_date,
                             invoice_data: invoice_data,
                             payment_type: payment_type,
                             eligibility_inquiry: eligibility_inquiry,
                             grace_period_duration: grace_period_duration,
                             grace_period_duration_type: grace_period_duration_type,
                             first_installment_amount: first_installment_amount,
                             validation_indicator: validation_indicator,
                             identifier: identifier,
                             annual_interest_rate: annual_interest_rate,
                             interest_indicator: interest_indicator,
                             is_government_plan: is_government_plan,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 307

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['amount'] = 'amount'
  @_hash['frequency'] = 'frequency'
  @_hash['plan_type'] = 'planType'
  @_hash['sequence'] = 'sequence'
  @_hash['total_amount'] = 'totalAmount'
  @_hash['total_count'] = 'totalCount'
  @_hash['first_installment_date'] = 'firstInstallmentDate'
  @_hash['invoice_data'] = 'invoiceData'
  @_hash['payment_type'] = 'paymentType'
  @_hash['eligibility_inquiry'] = 'eligibilityInquiry'
  @_hash['grace_period_duration'] = 'gracePeriodDuration'
  @_hash['grace_period_duration_type'] = 'gracePeriodDurationType'
  @_hash['first_installment_amount'] = 'firstInstallmentAmount'
  @_hash['validation_indicator'] = 'validationIndicator'
  @_hash['identifier'] = 'identifier'
  @_hash['annual_interest_rate'] = 'annualInterestRate'
  @_hash['interest_indicator'] = 'interestIndicator'
  @_hash['is_government_plan'] = 'isGovernmentPlan'
  @_hash
end

.nullablesObject

An array for nullable fields



355
356
357
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 355

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    amount
    frequency
    plan_type
    sequence
    total_amount
    total_count
    first_installment_date
    invoice_data
    payment_type
    eligibility_inquiry
    grace_period_duration
    grace_period_duration_type
    first_installment_amount
    validation_indicator
    identifier
    annual_interest_rate
    interest_indicator
    is_government_plan
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 474

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} amount: #{@amount.inspect}, frequency: #{@frequency.inspect}, plan_type:"\
  " #{@plan_type.inspect}, sequence: #{@sequence.inspect}, total_amount:"\
  " #{@total_amount.inspect}, total_count: #{@total_count.inspect}, first_installment_date:"\
  " #{@first_installment_date.inspect}, invoice_data: #{@invoice_data.inspect}, payment_type:"\
  " #{@payment_type.inspect}, eligibility_inquiry: #{@eligibility_inquiry.inspect},"\
  " grace_period_duration: #{@grace_period_duration.inspect}, grace_period_duration_type:"\
  " #{@grace_period_duration_type.inspect}, first_installment_amount:"\
  " #{@first_installment_amount.inspect}, validation_indicator:"\
  " #{@validation_indicator.inspect}, identifier: #{@identifier.inspect},"\
  " annual_interest_rate: #{@annual_interest_rate.inspect}, interest_indicator:"\
  " #{@interest_indicator.inspect}, is_government_plan: #{@is_government_plan.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/visa_acceptance_merged_spec/models/installment_information.rb', line 459

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} amount: #{@amount}, frequency: #{@frequency}, plan_type: #{@plan_type},"\
  " sequence: #{@sequence}, total_amount: #{@total_amount}, total_count: #{@total_count},"\
  " first_installment_date: #{@first_installment_date}, invoice_data: #{@invoice_data},"\
  " payment_type: #{@payment_type}, eligibility_inquiry: #{@eligibility_inquiry},"\
  " grace_period_duration: #{@grace_period_duration}, grace_period_duration_type:"\
  " #{@grace_period_duration_type}, first_installment_amount: #{@first_installment_amount},"\
  " validation_indicator: #{@validation_indicator}, identifier: #{@identifier},"\
  " annual_interest_rate: #{@annual_interest_rate}, interest_indicator:"\
  " #{@interest_indicator}, is_government_plan: #{@is_government_plan}, additional_properties:"\
  " #{@additional_properties}>"
end