Class: CyberSource::Ptsv2billingagreementsInstallmentInformation

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Ptsv2billingagreementsInstallmentInformation

Initializes the object

Parameters:

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

    Model attributes in the form of hash



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 90

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?(:'alertPreference')
    self.alert_preference = attributes[:'alertPreference']
  end

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

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

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

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

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

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

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

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

Instance Attribute Details

#alert_preferenceObject

Applicable only for SI. Required in case the authentication is initiated for SI registration. Valid Values: - ‘SMS` - `EMAIL` - `BOTH`



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

def alert_preference
  @alert_preference
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



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

def first_installment_date
  @first_installment_date
end

#identifierObject

Standing Instruction/Installment identifier.



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

def identifier
  @identifier
end

#last_installment_dateObject

End date of the SI transactions. Cannot be later than card expiry date. Ideally this can be set to expiry date. Required in case the authentication is initiated for SI registration.



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

def last_installment_date
  @last_installment_date
end

#max_amountObject

Maximum Amount for which SI can be initiated. Required in case the authentication is initiated for SI registration.



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

def max_amount
  @max_amount
end

#min_amountObject

Minimum Amount for which SI can be initiated. Required in case the authentication is initiated for SI registration.



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

def min_amount
  @min_amount
end

#payment_typeObject

Payment plan for the installments. Possible values: - 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. This field is supported only for installment payments with Visa on CyberSource through VisaNet in Brazil. The value for this field corresponds to the following data in the TC 33 capture file5: - Record: CP07 TCR1 - Position: 9 - Field: Merchant Installment Supporting Information



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

def payment_type
  @payment_type
end

#preferred_dayObject

Preferred date for initiating the SI transaction every month. This field need not be sent in case the SI has to be initiated as and when required, e.g., topping up the wallet, etc.



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

def preferred_day
  @preferred_day
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.



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

def sequence
  @sequence
end

Class Method Details

.attribute_mapObject

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



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 44

def self.attribute_map
  {
    :'alert_preference' => :'alertPreference',
    :'first_installment_date' => :'firstInstallmentDate',
    :'identifier' => :'identifier',
    :'last_installment_date' => :'lastInstallmentDate',
    :'max_amount' => :'maxAmount',
    :'min_amount' => :'minAmount',
    :'payment_type' => :'paymentType',
    :'preferred_day' => :'preferredDay',
    :'sequence' => :'sequence'
  }
end

.json_mapObject

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



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 59

def self.json_map
  {
    :'alert_preference' => :'alert_preference',
    :'first_installment_date' => :'first_installment_date',
    :'identifier' => :'identifier',
    :'last_installment_date' => :'last_installment_date',
    :'max_amount' => :'max_amount',
    :'min_amount' => :'min_amount',
    :'payment_type' => :'payment_type',
    :'preferred_day' => :'preferred_day',
    :'sequence' => :'sequence'
  }
end

.swagger_typesObject

Attribute type mapping.



74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 74

def self.swagger_types
  {
    :'alert_preference' => :'String',
    :'first_installment_date' => :'String',
    :'identifier' => :'String',
    :'last_installment_date' => :'String',
    :'max_amount' => :'String',
    :'min_amount' => :'String',
    :'payment_type' => :'String',
    :'preferred_day' => :'String',
    :'sequence' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 196

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      alert_preference == o.alert_preference &&
      first_installment_date == o.first_installment_date &&
      identifier == o.identifier &&
      last_installment_date == o.last_installment_date &&
      max_amount == o.max_amount &&
      min_amount == o.min_amount &&
      payment_type == o.payment_type &&
      preferred_day == o.preferred_day &&
      sequence == o.sequence
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



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

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



312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 312

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



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 225

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


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

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



218
219
220
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 218

def hash
  [alert_preference, first_installment_date, identifier, last_installment_date, max_amount, min_amount, payment_type, preferred_day, sequence].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



135
136
137
138
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 135

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



292
293
294
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 292

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



298
299
300
301
302
303
304
305
306
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 298

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



286
287
288
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 286

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



142
143
144
# File 'lib/cybersource_rest_client/models/ptsv2billingagreements_installment_information.rb', line 142

def valid?
  true
end