Class: CyberSourceMergedSpec::CreateBundledDecisionManagerCaseRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb

Overview

CreateBundledDecisionManagerCaseRequest 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(order_information:, client_reference_information: SKIP, processor_information: SKIP, processing_information: SKIP, payment_information: SKIP, buyer_information: SKIP, device_information: SKIP, risk_information: SKIP, travel_information: SKIP, merchant_defined_information: SKIP, merchant_information: SKIP, acquirer_information: SKIP, recurring_payment_information: SKIP, consumer_authentication_information: SKIP, watchlist_screening_information: SKIP, token_information: SKIP, additional_properties: nil) ⇒ CreateBundledDecisionManagerCaseRequest

Returns a new instance of CreateBundledDecisionManagerCaseRequest.



127
128
129
130
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
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 127

def initialize(order_information:, client_reference_information: SKIP,
               processor_information: SKIP, processing_information: SKIP,
               payment_information: SKIP, buyer_information: SKIP,
               device_information: SKIP, risk_information: SKIP,
               travel_information: SKIP, merchant_defined_information: SKIP,
               merchant_information: SKIP, acquirer_information: SKIP,
               recurring_payment_information: SKIP,
               consumer_authentication_information: SKIP,
               watchlist_screening_information: SKIP,
               token_information: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  unless client_reference_information == SKIP
    @client_reference_information =
      client_reference_information
  end
  @processor_information = processor_information unless processor_information == SKIP
  @processing_information = processing_information unless processing_information == SKIP
  @payment_information = payment_information unless payment_information == SKIP
  @order_information = order_information
  @buyer_information = buyer_information unless buyer_information == SKIP
  @device_information = device_information unless device_information == SKIP
  @risk_information = risk_information unless risk_information == SKIP
  @travel_information = travel_information unless travel_information == SKIP
  unless merchant_defined_information == SKIP
    @merchant_defined_information =
      merchant_defined_information
  end
  @merchant_information = merchant_information unless merchant_information == SKIP
  @acquirer_information = acquirer_information unless acquirer_information == SKIP
  unless recurring_payment_information == SKIP
    @recurring_payment_information =
      recurring_payment_information
  end
  unless consumer_authentication_information == SKIP
    @consumer_authentication_information =
      consumer_authentication_information
  end
  unless watchlist_screening_information == SKIP
    @watchlist_screening_information =
      watchlist_screening_information
  end
  @token_information = token_information unless token_information == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#acquirer_informationAcquirerInformation1

Contains information about the buyer.



59
60
61
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 59

def acquirer_information
  @acquirer_information
end

#buyer_informationBuyerInformation37

Contains information about the buyer.

Returns:



35
36
37
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 35

def buyer_information
  @buyer_information
end

#client_reference_informationClientReferenceInformation48

TODO: Write general description for this method



14
15
16
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 14

def client_reference_information
  @client_reference_information
end

#consumer_authentication_informationConsumerAuthenticationInformation4

This object contains recurring payment information.



67
68
69
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 67

def consumer_authentication_information
  @consumer_authentication_information
end

#device_informationDeviceInformation13

Contains information about the buyer.

Returns:



39
40
41
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 39

def device_information
  @device_information
end

#merchant_defined_informationArray[MerchantDefinedInformation13]

Contains information about the buyer.

Returns:



51
52
53
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 51

def merchant_defined_information
  @merchant_defined_information
end

#merchant_informationMerchantInformation19

Contains information about the buyer.



55
56
57
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 55

def merchant_information
  @merchant_information
end

#order_informationOrderInformation35

Contains detailed order-level information.

Returns:



31
32
33
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 31

def order_information
  @order_information
end

#payment_informationPaymentInformation31

Contains the payment data for this transaction.



27
28
29
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 27

def payment_information
  @payment_information
end

#processing_informationProcessingInformation56

Decides whether to call Payer Authentication or Watchlist Screening service along with DM or not.



23
24
25
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 23

def processing_information
  @processing_information
end

#processor_informationProcessorInformation29

Contains information related to the payment processor.



18
19
20
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 18

def processor_information
  @processor_information
end

#recurring_payment_informationRecurringPaymentInformation

This object contains recurring payment information.



63
64
65
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 63

def recurring_payment_information
  @recurring_payment_information
end

#risk_informationRiskInformation5

Contains information about the buyer.

Returns:



43
44
45
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 43

def risk_information
  @risk_information
end

#token_informationTokenInformation5

This object contains recurring payment information.

Returns:



75
76
77
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 75

def token_information
  @token_information
end

#travel_informationTravelInformation9

Contains information about the buyer.

Returns:



47
48
49
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 47

def travel_information
  @travel_information
end

#watchlist_screening_informationWatchlistScreeningInformation

This object contains recurring payment information.



71
72
73
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 71

def watchlist_screening_information
  @watchlist_screening_information
end

Class Method Details

.from_element(root) ⇒ Object



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
283
284
285
286
287
288
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
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 251

def self.from_element(root)
  order_information = XmlUtilities.from_element(root, 'OrderInformation35',
                                                OrderInformation35)
  client_reference_information = XmlUtilities.from_element(
    root, 'ClientReferenceInformation48',
    ClientReferenceInformation48
  )
  processor_information = XmlUtilities.from_element(
    root, 'ProcessorInformation29', ProcessorInformation29
  )
  processing_information = XmlUtilities.from_element(
    root, 'ProcessingInformation56', ProcessingInformation56
  )
  payment_information = XmlUtilities.from_element(root,
                                                  'PaymentInformation31',
                                                  PaymentInformation31)
  buyer_information = XmlUtilities.from_element(root, 'BuyerInformation37',
                                                BuyerInformation37)
  device_information = XmlUtilities.from_element(root,
                                                 'DeviceInformation13',
                                                 DeviceInformation13)
  risk_information = XmlUtilities.from_element(root, 'RiskInformation5',
                                               RiskInformation5)
  travel_information = XmlUtilities.from_element(root, 'TravelInformation9',
                                                 TravelInformation9)
  merchant_defined_information = XmlUtilities.from_element_to_array(
    root, 'MerchantDefinedInformation13',
    MerchantDefinedInformation13
  )
  merchant_information = XmlUtilities.from_element(root,
                                                   'MerchantInformation19',
                                                   MerchantInformation19)
  acquirer_information = XmlUtilities.from_element(root,
                                                   'AcquirerInformation1',
                                                   AcquirerInformation1)
  recurring_payment_information = XmlUtilities.from_element(
    root, 'RecurringPaymentInformation',
    RecurringPaymentInformation
  )
  consumer_authentication_information = XmlUtilities.from_element(
    root, 'ConsumerAuthenticationInformation4',
    ConsumerAuthenticationInformation4
  )
  watchlist_screening_information = XmlUtilities.from_element(
    root, 'WatchlistScreeningInformation',
    WatchlistScreeningInformation
  )
  token_information = XmlUtilities.from_element(root, 'TokenInformation5',
                                                TokenInformation5)

  new(order_information: order_information,
      client_reference_information: client_reference_information,
      processor_information: processor_information,
      processing_information: processing_information,
      payment_information: payment_information,
      buyer_information: buyer_information,
      device_information: device_information,
      risk_information: risk_information,
      travel_information: travel_information,
      merchant_defined_information: merchant_defined_information,
      merchant_information: merchant_information,
      acquirer_information: acquirer_information,
      recurring_payment_information: recurring_payment_information,
      consumer_authentication_information: consumer_authentication_information,
      watchlist_screening_information: watchlist_screening_information,
      token_information: token_information,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 175

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  order_information = OrderInformation35.from_hash(hash['orderInformation']) if
    hash['orderInformation']
  if hash['clientReferenceInformation']
    client_reference_information = ClientReferenceInformation48.from_hash(hash['clientReferenceInformation'])
  end
  processor_information = ProcessorInformation29.from_hash(hash['processorInformation']) if
    hash['processorInformation']
  processing_information = ProcessingInformation56.from_hash(hash['processingInformation']) if
    hash['processingInformation']
  payment_information = PaymentInformation31.from_hash(hash['paymentInformation']) if
    hash['paymentInformation']
  buyer_information = BuyerInformation37.from_hash(hash['buyerInformation']) if
    hash['buyerInformation']
  device_information = DeviceInformation13.from_hash(hash['deviceInformation']) if
    hash['deviceInformation']
  risk_information = RiskInformation5.from_hash(hash['riskInformation']) if
    hash['riskInformation']
  travel_information = TravelInformation9.from_hash(hash['travelInformation']) if
    hash['travelInformation']
  # Parameter is an array, so we need to iterate through it
  merchant_defined_information = nil
  unless hash['merchantDefinedInformation'].nil?
    merchant_defined_information = []
    hash['merchantDefinedInformation'].each do |structure|
      merchant_defined_information << (MerchantDefinedInformation13.from_hash(structure) if structure)
    end
  end

  merchant_defined_information = SKIP unless hash.key?('merchantDefinedInformation')
  merchant_information = MerchantInformation19.from_hash(hash['merchantInformation']) if
    hash['merchantInformation']
  acquirer_information = AcquirerInformation1.from_hash(hash['acquirerInformation']) if
    hash['acquirerInformation']
  if hash['recurringPaymentInformation']
    recurring_payment_information = RecurringPaymentInformation.from_hash(hash['recurringPaymentInformation'])
  end
  if hash['consumerAuthenticationInformation']
    consumer_authentication_information = ConsumerAuthenticationInformation4.from_hash(hash['consumerAuthenticationInformation'])
  end
  if hash['watchlistScreeningInformation']
    watchlist_screening_information = WatchlistScreeningInformation.from_hash(hash['watchlistScreeningInformation'])
  end
  token_information = TokenInformation5.from_hash(hash['tokenInformation']) if
    hash['tokenInformation']

  # 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.
  CreateBundledDecisionManagerCaseRequest.new(order_information: order_information,
                                              client_reference_information: client_reference_information,
                                              processor_information: processor_information,
                                              processing_information: processing_information,
                                              payment_information: payment_information,
                                              buyer_information: buyer_information,
                                              device_information: device_information,
                                              risk_information: risk_information,
                                              travel_information: travel_information,
                                              merchant_defined_information: merchant_defined_information,
                                              merchant_information: merchant_information,
                                              acquirer_information: acquirer_information,
                                              recurring_payment_information: recurring_payment_information,
                                              consumer_authentication_information: consumer_authentication_information,
                                              watchlist_screening_information: watchlist_screening_information,
                                              token_information: token_information,
                                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 78

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_reference_information'] = 'clientReferenceInformation'
  @_hash['processor_information'] = 'processorInformation'
  @_hash['processing_information'] = 'processingInformation'
  @_hash['payment_information'] = 'paymentInformation'
  @_hash['order_information'] = 'orderInformation'
  @_hash['buyer_information'] = 'buyerInformation'
  @_hash['device_information'] = 'deviceInformation'
  @_hash['risk_information'] = 'riskInformation'
  @_hash['travel_information'] = 'travelInformation'
  @_hash['merchant_defined_information'] = 'merchantDefinedInformation'
  @_hash['merchant_information'] = 'merchantInformation'
  @_hash['acquirer_information'] = 'acquirerInformation'
  @_hash['recurring_payment_information'] = 'recurringPaymentInformation'
  @_hash['consumer_authentication_information'] =
    'consumerAuthenticationInformation'
  @_hash['watchlist_screening_information'] =
    'watchlistScreeningInformation'
  @_hash['token_information'] = 'tokenInformation'
  @_hash
end

.nullablesObject

An array for nullable fields



123
124
125
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 123

def self.nullables
  []
end

.optionalsObject

An array for optional fields



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 102

def self.optionals
  %w[
    client_reference_information
    processor_information
    processing_information
    payment_information
    buyer_information
    device_information
    risk_information
    travel_information
    merchant_defined_information
    merchant_information
    acquirer_information
    recurring_payment_information
    consumer_authentication_information
    watchlist_screening_information
    token_information
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 381

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_reference_information: #{@client_reference_information.inspect},"\
  " processor_information: #{@processor_information.inspect}, processing_information:"\
  " #{@processing_information.inspect}, payment_information: #{@payment_information.inspect},"\
  " order_information: #{@order_information.inspect}, buyer_information:"\
  " #{@buyer_information.inspect}, device_information: #{@device_information.inspect},"\
  " risk_information: #{@risk_information.inspect}, travel_information:"\
  " #{@travel_information.inspect}, merchant_defined_information:"\
  " #{@merchant_defined_information.inspect}, merchant_information:"\
  " #{@merchant_information.inspect}, acquirer_information: #{@acquirer_information.inspect},"\
  " recurring_payment_information: #{@recurring_payment_information.inspect},"\
  " consumer_authentication_information: #{@consumer_authentication_information.inspect},"\
  " watchlist_screening_information: #{@watchlist_screening_information.inspect},"\
  " token_information: #{@token_information.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 364

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_reference_information: #{@client_reference_information},"\
  " processor_information: #{@processor_information}, processing_information:"\
  " #{@processing_information}, payment_information: #{@payment_information},"\
  " order_information: #{@order_information}, buyer_information: #{@buyer_information},"\
  " device_information: #{@device_information}, risk_information: #{@risk_information},"\
  " travel_information: #{@travel_information}, merchant_defined_information:"\
  " #{@merchant_defined_information}, merchant_information: #{@merchant_information},"\
  " acquirer_information: #{@acquirer_information}, recurring_payment_information:"\
  " #{@recurring_payment_information}, consumer_authentication_information:"\
  " #{@consumer_authentication_information}, watchlist_screening_information:"\
  " #{@watchlist_screening_information}, token_information: #{@token_information},"\
  " additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/cyber_source_merged_spec/models/create_bundled_decision_manager_case_request.rb', line 320

def to_xml_element(doc, root_name)
  root = doc.create_element(root_name)

  XmlUtilities.add_as_subelement(doc, root, 'OrderInformation35',
                                 order_information)
  XmlUtilities.add_as_subelement(doc, root, 'ClientReferenceInformation48',
                                 client_reference_information)
  XmlUtilities.add_as_subelement(doc, root, 'ProcessorInformation29',
                                 processor_information)
  XmlUtilities.add_as_subelement(doc, root, 'ProcessingInformation56',
                                 processing_information)
  XmlUtilities.add_as_subelement(doc, root, 'PaymentInformation31',
                                 payment_information)
  XmlUtilities.add_as_subelement(doc, root, 'BuyerInformation37',
                                 buyer_information)
  XmlUtilities.add_as_subelement(doc, root, 'DeviceInformation13',
                                 device_information)
  XmlUtilities.add_as_subelement(doc, root, 'RiskInformation5',
                                 risk_information)
  XmlUtilities.add_as_subelement(doc, root, 'TravelInformation9',
                                 travel_information)
  XmlUtilities.add_array_as_subelement(doc, root,
                                       'MerchantDefinedInformation13',
                                       merchant_defined_information)
  XmlUtilities.add_as_subelement(doc, root, 'MerchantInformation19',
                                 merchant_information)
  XmlUtilities.add_as_subelement(doc, root, 'AcquirerInformation1',
                                 acquirer_information)
  XmlUtilities.add_as_subelement(doc, root, 'RecurringPaymentInformation',
                                 recurring_payment_information)
  XmlUtilities.add_as_subelement(doc, root,
                                 'ConsumerAuthenticationInformation4',
                                 consumer_authentication_information)
  XmlUtilities.add_as_subelement(doc, root, 'WatchlistScreeningInformation',
                                 watchlist_screening_information)
  XmlUtilities.add_as_subelement(doc, root, 'TokenInformation5',
                                 token_information)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end