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



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
213
214
215
216
217
218
219
220
221
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 136

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?(:'alternativePaymentMethods')
    self.alternative_payment_methods = attributes[:'alternativePaymentMethods']
  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

#alternative_payment_methodsObject

Returns the value of attribute alternative_payment_methods.



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

def alternative_payment_methods
  @alternative_payment_methods
end

#card_present_connectObject

Returns the value of attribute card_present_connect.



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

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.



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

def currency_conversion
  @currency_conversion
end

#customer_invoicingObject

Returns the value of attribute customer_invoicing.



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

def customer_invoicing
  @customer_invoicing
end

#cybs_ready_terminalObject

Returns the value of attribute cybs_ready_terminal.



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

def cybs_ready_terminal
  @cybs_ready_terminal
end

#differential_feeObject

Returns the value of attribute differential_fee.



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

def differential_fee
  @differential_fee
end

#digital_paymentsObject

Returns the value of attribute digital_payments.



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

def digital_payments
  @digital_payments
end

#e_checkObject

Returns the value of attribute e_check.



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

def e_check
  @e_check
end

Returns the value of attribute pay_by_link.



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

def pay_by_link
  @pay_by_link
end

#payer_authenticationObject

Returns the value of attribute payer_authentication.



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

def payer_authentication
  @payer_authentication
end

#payment_orchestrationObject

Returns the value of attribute payment_orchestration.



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

def payment_orchestration
  @payment_orchestration
end

#payoutsObject

Returns the value of attribute payouts.



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

def payouts
  @payouts
end

#receivables_managerObject

Returns the value of attribute receivables_manager.



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

def receivables_manager
  @receivables_manager
end

#recurring_billingObject

Returns the value of attribute recurring_billing.



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

def recurring_billing
  @recurring_billing
end

#secure_acceptanceObject

Returns the value of attribute secure_acceptance.



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

def secure_acceptance
  @secure_acceptance
end

#service_feeObject

Returns the value of attribute service_fee.



54
55
56
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 54

def service_fee
  @service_fee
end

#taxObject

Returns the value of attribute tax.



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

def tax
  @tax
end

#unified_checkoutObject

Returns the value of attribute unified_checkout.



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

def unified_checkout
  @unified_checkout
end

#virtual_terminalObject

Returns the value of attribute virtual_terminal.



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

def virtual_terminal
  @virtual_terminal
end

Class Method Details

.attribute_mapObject

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



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

def self.attribute_map
  {
    :'card_processing' => :'cardProcessing',
    :'alternative_payment_methods' => :'alternativePaymentMethods',
    :'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.



83
84
85
86
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/payments_products.rb', line 83

def self.json_map
  {
    :'card_processing' => :'card_processing',
    :'alternative_payment_methods' => :'alternative_payment_methods',
    :'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.



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

def self.swagger_types
  {
    :'card_processing' => :'PaymentsProductsCardProcessing',
    :'alternative_payment_methods' => :'PaymentsProductsAlternativePaymentMethods',
    :'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



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 238

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      card_processing == o.card_processing &&
      alternative_payment_methods == o.alternative_payment_methods &&
      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



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

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



365
366
367
368
369
370
371
372
373
374
375
376
377
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 365

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



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 278

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


265
266
267
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 265

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



271
272
273
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 271

def hash
  [card_processing, alternative_payment_methods, 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



225
226
227
228
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 225

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



345
346
347
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 345

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



351
352
353
354
355
356
357
358
359
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 351

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



339
340
341
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 339

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



232
233
234
# File 'lib/cybersource_rest_client/models/payments_products.rb', line 232

def valid?
  true
end