Class: CyberSource::Ptsv2paymentsInstallmentInformation

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Ptsv2paymentsInstallmentInformation

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
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
175
176
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
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 132

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  if attributes.has_key?(:'amount')
    self.amount = attributes[:'amount']
  end

  if attributes.has_key?(:'frequency')
    self.frequency = attributes[:'frequency']
  end

  if attributes.has_key?(:'planType')
    self.plan_type = attributes[:'planType']
  end

  if attributes.has_key?(:'sequence')
    self.sequence = attributes[:'sequence']
  end

  if attributes.has_key?(:'totalAmount')
    self.total_amount = attributes[:'totalAmount']
  end

  if attributes.has_key?(:'totalCount')
    self.total_count = attributes[:'totalCount']
  end

  if attributes.has_key?(:'firstInstallmentDate')
    self.first_installment_date = attributes[:'firstInstallmentDate']
  end

  if attributes.has_key?(:'invoiceData')
    self.invoice_data = attributes[:'invoiceData']
  end

  if attributes.has_key?(:'paymentType')
    self.payment_type = attributes[:'paymentType']
  end

  if attributes.has_key?(:'eligibilityInquiry')
    self.eligibility_inquiry = attributes[:'eligibilityInquiry']
  end

  if attributes.has_key?(:'gracePeriodDuration')
    self.grace_period_duration = attributes[:'gracePeriodDuration']
  end

  if attributes.has_key?(:'gracePeriodDurationType')
    self.grace_period_duration_type = attributes[:'gracePeriodDurationType']
  end

  if attributes.has_key?(:'firstInstallmentAmount')
    self.first_installment_amount = attributes[:'firstInstallmentAmount']
  end

  if attributes.has_key?(:'validationIndicator')
    self.validation_indicator = attributes[:'validationIndicator']
  end

  if attributes.has_key?(:'identifier')
    self.identifier = attributes[:'identifier']
  end

  if attributes.has_key?(:'annualInterestRate')
    self.annual_interest_rate = attributes[:'annualInterestRate']
  end
end

Instance Attribute Details

#amountObject

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



17
18
19
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 17

def amount
  @amount
end

#annual_interest_rateObject

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



62
63
64
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 62

def annual_interest_rate
  @annual_interest_rate
end

#eligibility_inquiryObject

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 CyberSource through VisaNet.



44
45
46
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 44

def eligibility_inquiry
  @eligibility_inquiry
end

#first_installment_amountObject

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 CyberSource 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



53
54
55
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 53

def first_installment_amount
  @first_installment_amount
end

#first_installment_dateObject

Date of the first installment payment. Format: YYMMDD. When you do not include this field, CyberSource sends a string of six zeros (000000) to the processor. This field is supported only for Crediario installment payments in Brazil on CyberSource 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



35
36
37
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 35

def first_installment_date
  @first_installment_date
end

#frequencyObject

Frequency of the installment payments. When you do not include this field in a request for a Crediario installment payment, CyberSource sends a space character to the processor. This field is supported only for CyberSource 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



20
21
22
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 20

def frequency
  @frequency
end

#grace_period_durationObject

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.



47
48
49
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 47

def grace_period_duration
  @grace_period_duration
end

#grace_period_duration_typeObject

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 CyberSource through VisaNet.



50
51
52
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 50

def grace_period_duration_type
  @grace_period_duration_type
end

#identifierObject

Standing Instruction/Installment identifier.



59
60
61
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 59

def identifier
  @identifier
end

#invoice_dataObject

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 CyberSource 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



38
39
40
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 38

def invoice_data
  @invoice_data
end

#payment_typeObject

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.



41
42
43
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 41

def payment_type
  @payment_type
end

#plan_typeObject

#### American Express Direct, Cielo, and CyberSource 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, CyberSource uses the value in your CyberSource account. To change the value in your CyberSource account, contact CyberSource Customer Service. #### CyberSource 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 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. #### CyberSource 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)



23
24
25
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 23

def plan_type
  @plan_type
end

#sequenceObject

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 CyberSource 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. #### CyberSource through VisaNet When you do not include this field in a request for a Crediario installment payment, CyberSource 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 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.



26
27
28
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 26

def sequence
  @sequence
end

#total_amountObject

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



29
30
31
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 29

def total_amount
  @total_amount
end

#total_countObject

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. #### CyberSource 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 CyberSource as sequence = 2 and totalCount = 5. #### CyberSource 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 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.



32
33
34
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 32

def total_count
  @total_count
end

#validation_indicatorObject

Standing Instruction/Installment validation indicator. - ‘1’: Prevalidated - ‘2’: Not Validated



56
57
58
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 56

def validation_indicator
  @validation_indicator
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 65

def self.attribute_map
  {
    :'amount' => :'amount',
    :'frequency' => :'frequency',
    :'plan_type' => :'planType',
    :'sequence' => :'sequence',
    :'total_amount' => :'totalAmount',
    :'total_count' => :'totalCount',
    :'first_installment_date' => :'firstInstallmentDate',
    :'invoice_data' => :'invoiceData',
    :'payment_type' => :'paymentType',
    :'eligibility_inquiry' => :'eligibilityInquiry',
    :'grace_period_duration' => :'gracePeriodDuration',
    :'grace_period_duration_type' => :'gracePeriodDurationType',
    :'first_installment_amount' => :'firstInstallmentAmount',
    :'validation_indicator' => :'validationIndicator',
    :'identifier' => :'identifier',
    :'annual_interest_rate' => :'annualInterestRate'
  }
end

.json_mapObject

Attribute mapping from JSON key to ruby-style variable name.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 87

def self.json_map
  {
    :'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'
  }
end

.swagger_typesObject

Attribute type mapping.



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 109

def self.swagger_types
  {
    :'amount' => :'String',
    :'frequency' => :'String',
    :'plan_type' => :'String',
    :'sequence' => :'Integer',
    :'total_amount' => :'String',
    :'total_count' => :'Integer',
    :'first_installment_date' => :'String',
    :'invoice_data' => :'String',
    :'payment_type' => :'String',
    :'eligibility_inquiry' => :'String',
    :'grace_period_duration' => :'String',
    :'grace_period_duration_type' => :'String',
    :'first_installment_amount' => :'String',
    :'validation_indicator' => :'String',
    :'identifier' => :'String',
    :'annual_interest_rate' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 296

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      amount == o.amount &&
      frequency == o.frequency &&
      plan_type == o.plan_type &&
      sequence == o.sequence &&
      total_amount == o.total_amount &&
      total_count == o.total_count &&
      first_installment_date == o.first_installment_date &&
      invoice_data == o.invoice_data &&
      payment_type == o.payment_type &&
      eligibility_inquiry == o.eligibility_inquiry &&
      grace_period_duration == o.grace_period_duration &&
      grace_period_duration_type == o.grace_period_duration_type &&
      first_installment_amount == o.first_installment_amount &&
      validation_indicator == o.validation_indicator &&
      identifier == o.identifier &&
      annual_interest_rate == o.annual_interest_rate
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



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
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 353

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = CyberSource.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 419

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 332

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{self.class.json_map[key]}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{self.class.json_map[key]}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


319
320
321
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 319

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



325
326
327
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 325

def hash
  [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].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



205
206
207
208
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 205

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



399
400
401
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 399

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



405
406
407
408
409
410
411
412
413
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 405

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



393
394
395
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 393

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



212
213
214
# File 'lib/cybersource_rest_client/models/ptsv2payments_installment_information.rb', line 212

def valid?
  true
end