Class: CyberSource::PaymentsProducts

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PaymentsProducts

Initializes the object

Parameters:

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

    Model attributes in the form of hash



131
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
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 131

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#card_present_connectObject

Returns the value of attribute card_present_connect.



18
19
20
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 18

def card_present_connect
  @card_present_connect
end

#card_processingObject

Returns the value of attribute card_processing.



16
17
18
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 16

def card_processing
  @card_processing
end

#currency_conversionObject

Returns the value of attribute currency_conversion.



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

def currency_conversion
  @currency_conversion
end

#customer_invoicingObject

Returns the value of attribute customer_invoicing.



36
37
38
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 36

def customer_invoicing
  @customer_invoicing
end

#cybs_ready_terminalObject

Returns the value of attribute cybs_ready_terminal.



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

def cybs_ready_terminal
  @cybs_ready_terminal
end

#differential_feeObject

Returns the value of attribute differential_fee.



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

def differential_fee
  @differential_fee
end

#digital_paymentsObject

Returns the value of attribute digital_payments.



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

def digital_payments
  @digital_payments
end

#e_checkObject

Returns the value of attribute e_check.



22
23
24
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 22

def e_check
  @e_check
end

Returns the value of attribute pay_by_link.



46
47
48
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 46

def pay_by_link
  @pay_by_link
end

#payer_authenticationObject

Returns the value of attribute payer_authentication.



24
25
26
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 24

def payer_authentication
  @payer_authentication
end

#payment_orchestrationObject

Returns the value of attribute payment_orchestration.



40
41
42
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 40

def payment_orchestration
  @payment_orchestration
end

#payoutsObject

Returns the value of attribute payouts.



42
43
44
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 42

def payouts
  @payouts
end

#receivables_managerObject

Returns the value of attribute receivables_manager.



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

def receivables_manager
  @receivables_manager
end

#recurring_billingObject

Returns the value of attribute recurring_billing.



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

def recurring_billing
  @recurring_billing
end

#secure_acceptanceObject

Returns the value of attribute secure_acceptance.



28
29
30
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 28

def secure_acceptance
  @secure_acceptance
end

#service_feeObject

Returns the value of attribute service_fee.



52
53
54
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 52

def service_fee
  @service_fee
end

#taxObject

Returns the value of attribute tax.



34
35
36
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 34

def tax
  @tax
end

#unified_checkoutObject

Returns the value of attribute unified_checkout.



48
49
50
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 48

def unified_checkout
  @unified_checkout
end

#virtual_terminalObject

Returns the value of attribute virtual_terminal.



30
31
32
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 30

def virtual_terminal
  @virtual_terminal
end

Class Method Details

.attribute_mapObject

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



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 55

def self.attribute_map
  {
    :'card_processing' => :'cardProcessing',
    :'card_present_connect' => :'cardPresentConnect',
    :'cybs_ready_terminal' => :'cybsReadyTerminal',
    :'e_check' => :'eCheck',
    :'payer_authentication' => :'payerAuthentication',
    :'digital_payments' => :'digitalPayments',
    :'secure_acceptance' => :'secureAcceptance',
    :'virtual_terminal' => :'virtualTerminal',
    :'currency_conversion' => :'currencyConversion',
    :'tax' => :'tax',
    :'customer_invoicing' => :'customerInvoicing',
    :'recurring_billing' => :'recurringBilling',
    :'payment_orchestration' => :'paymentOrchestration',
    :'payouts' => :'payouts',
    :'differential_fee' => :'differentialFee',
    :'pay_by_link' => :'payByLink',
    :'unified_checkout' => :'unifiedCheckout',
    :'receivables_manager' => :'receivablesManager',
    :'service_fee' => :'serviceFee'
  }
end

.json_mapObject

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



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 80

def self.json_map
  {
    :'card_processing' => :'card_processing',
    :'card_present_connect' => :'card_present_connect',
    :'cybs_ready_terminal' => :'cybs_ready_terminal',
    :'e_check' => :'e_check',
    :'payer_authentication' => :'payer_authentication',
    :'digital_payments' => :'digital_payments',
    :'secure_acceptance' => :'secure_acceptance',
    :'virtual_terminal' => :'virtual_terminal',
    :'currency_conversion' => :'currency_conversion',
    :'tax' => :'tax',
    :'customer_invoicing' => :'customer_invoicing',
    :'recurring_billing' => :'recurring_billing',
    :'payment_orchestration' => :'payment_orchestration',
    :'payouts' => :'payouts',
    :'differential_fee' => :'differential_fee',
    :'pay_by_link' => :'pay_by_link',
    :'unified_checkout' => :'unified_checkout',
    :'receivables_manager' => :'receivables_manager',
    :'service_fee' => :'service_fee'
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    :'card_processing' => :'PaymentsProductsCardProcessing',
    :'card_present_connect' => :'PaymentsProductsCardPresentConnect',
    :'cybs_ready_terminal' => :'PaymentsProductsCybsReadyTerminal',
    :'e_check' => :'PaymentsProductsECheck',
    :'payer_authentication' => :'PaymentsProductsPayerAuthentication',
    :'digital_payments' => :'PaymentsProductsDigitalPayments',
    :'secure_acceptance' => :'PaymentsProductsSecureAcceptance',
    :'virtual_terminal' => :'PaymentsProductsVirtualTerminal',
    :'currency_conversion' => :'PaymentsProductsCurrencyConversion',
    :'tax' => :'PaymentsProductsTax',
    :'customer_invoicing' => :'PaymentsProductsTax',
    :'recurring_billing' => :'PaymentsProductsTax',
    :'payment_orchestration' => :'PaymentsProductsTax',
    :'payouts' => :'PaymentsProductsPayouts',
    :'differential_fee' => :'PaymentsProductsDifferentialFee',
    :'pay_by_link' => :'PaymentsProductsTax',
    :'unified_checkout' => :'PaymentsProductsTax',
    :'receivables_manager' => :'PaymentsProductsTax',
    :'service_fee' => :'PaymentsProductsServiceFee'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 229

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      card_processing == o.card_processing &&
      card_present_connect == o.card_present_connect &&
      cybs_ready_terminal == o.cybs_ready_terminal &&
      e_check == o.e_check &&
      payer_authentication == o.payer_authentication &&
      digital_payments == o.digital_payments &&
      secure_acceptance == o.secure_acceptance &&
      virtual_terminal == o.virtual_terminal &&
      currency_conversion == o.currency_conversion &&
      tax == o.tax &&
      customer_invoicing == o.customer_invoicing &&
      recurring_billing == o.recurring_billing &&
      payment_orchestration == o.payment_orchestration &&
      payouts == o.payouts &&
      differential_fee == o.differential_fee &&
      pay_by_link == o.pay_by_link &&
      unified_checkout == o.unified_checkout &&
      receivables_manager == o.receivables_manager &&
      service_fee == o.service_fee
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



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

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



355
356
357
358
359
360
361
362
363
364
365
366
367
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 355

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



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 268

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


255
256
257
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 255

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



261
262
263
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 261

def hash
  [card_processing, card_present_connect, cybs_ready_terminal, e_check, payer_authentication, digital_payments, secure_acceptance, virtual_terminal, currency_conversion, tax, customer_invoicing, recurring_billing, payment_orchestration, payouts, differential_fee, pay_by_link, unified_checkout, receivables_manager, service_fee].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



216
217
218
219
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 216

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



335
336
337
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 335

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



341
342
343
344
345
346
347
348
349
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 341

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



329
330
331
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 329

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



223
224
225
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 223

def valid?
  true
end