Class: CyberSourceMergedSpec::TransactionSummary

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

Overview

TransactionSummary 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(id: SKIP, submit_time_utc: SKIP, merchant_id: SKIP, status: SKIP, application_information: SKIP, buyer_information: SKIP, client_reference_information: SKIP, consumer_authentication_information: SKIP, device_information: SKIP, error_information: SKIP, fraud_marking_information: SKIP, merchant_defined_information: SKIP, merchant_information: SKIP, order_information: SKIP, payment_information: SKIP, processing_information: SKIP, processor_information: SKIP, point_of_sale_information: SKIP, risk_information: SKIP, links: SKIP, additional_properties: nil) ⇒ TransactionSummary

Returns a new instance of TransactionSummary.



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
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 166

def initialize(id: SKIP, submit_time_utc: SKIP, merchant_id: SKIP,
               status: SKIP, application_information: SKIP,
               buyer_information: SKIP, client_reference_information: SKIP,
               consumer_authentication_information: SKIP,
               device_information: SKIP, error_information: SKIP,
               fraud_marking_information: SKIP,
               merchant_defined_information: SKIP,
               merchant_information: SKIP, order_information: SKIP,
               payment_information: SKIP, processing_information: SKIP,
               processor_information: SKIP, point_of_sale_information: SKIP,
               risk_information: SKIP, links: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id unless id == SKIP
  @submit_time_utc = submit_time_utc unless submit_time_utc == SKIP
  @merchant_id = merchant_id unless merchant_id == SKIP
  @status = status unless status == SKIP
  @application_information = application_information unless application_information == SKIP
  @buyer_information = buyer_information unless buyer_information == SKIP
  unless client_reference_information == SKIP
    @client_reference_information =
      client_reference_information
  end
  unless consumer_authentication_information == SKIP
    @consumer_authentication_information =
      consumer_authentication_information
  end
  @device_information = device_information unless device_information == SKIP
  @error_information = error_information unless error_information == SKIP
  unless fraud_marking_information == SKIP
    @fraud_marking_information =
      fraud_marking_information
  end
  unless merchant_defined_information == SKIP
    @merchant_defined_information =
      merchant_defined_information
  end
  @merchant_information = merchant_information unless merchant_information == SKIP
  @order_information = order_information unless order_information == SKIP
  @payment_information = payment_information unless payment_information == SKIP
  @processing_information = processing_information unless processing_information == SKIP
  @processor_information = processor_information unless processor_information == SKIP
  unless point_of_sale_information == SKIP
    @point_of_sale_information =
      point_of_sale_information
  end
  @risk_information = risk_information unless risk_information == SKIP
  @links = links unless links == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#application_informationApplicationInformation1

The status of the submitted transaction. Note: This field may not be returned for all transactions.



40
41
42
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 40

def application_information
  @application_information
end

#buyer_informationBuyerInformation11

The status of the submitted transaction. Note: This field may not be returned for all transactions.

Returns:



45
46
47
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 45

def buyer_information
  @buyer_information
end

#client_reference_informationClientReferenceInformation76

The status of the submitted transaction. Note: This field may not be returned for all transactions.



50
51
52
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 50

def client_reference_information
  @client_reference_information
end

#consumer_authentication_informationConsumerAuthenticationInformation12

The status of the submitted transaction. Note: This field may not be returned for all transactions.



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

def consumer_authentication_information
  @consumer_authentication_information
end

#device_informationDeviceInformation15

The status of the submitted transaction. Note: This field may not be returned for all transactions.

Returns:



60
61
62
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 60

def device_information
  @device_information
end

#error_informationErrorInformation34

The status of the submitted transaction. Note: This field may not be returned for all transactions.

Returns:



65
66
67
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 65

def error_information
  @error_information
end

#fraud_marking_informationFraudMarkingInformation

The status of the submitted transaction. Note: This field may not be returned for all transactions.



70
71
72
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 70

def fraud_marking_information
  @fraud_marking_information
end

#idString

An unique identification number generated by Cybersource to identify the submitted request. Returned by all services. It is also appended to the endpoint of the resource. On incremental authorizations, this value with be the same as the identification number returned in the original authorization response.

Returns:

  • (String)


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

def id
  @id
end

The object containing the custom data that the merchant defines.

Returns:



106
107
108
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 106

def links
  @links
end

#merchant_defined_informationArray[MerchantDefinedInformation]

The object containing the custom data that the merchant defines.

Returns:



74
75
76
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 74

def merchant_defined_information
  @merchant_defined_information
end

#merchant_idString

Your CyberSource merchant ID.

Returns:

  • (String)


30
31
32
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 30

def merchant_id
  @merchant_id
end

#merchant_informationMerchantInformation25

The object containing the custom data that the merchant defines.



78
79
80
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 78

def merchant_information
  @merchant_information
end

#order_informationOrderInformation58

The object containing the custom data that the merchant defines.

Returns:



82
83
84
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 82

def order_information
  @order_information
end

#payment_informationPaymentInformation44

The object containing the custom data that the merchant defines.



86
87
88
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 86

def payment_information
  @payment_information
end

#point_of_sale_informationPointOfSaleInformation15

The object containing the custom data that the merchant defines.



98
99
100
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 98

def point_of_sale_information
  @point_of_sale_information
end

#processing_informationProcessingInformation70

The object containing the custom data that the merchant defines.



90
91
92
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 90

def processing_information
  @processing_information
end

#processor_informationProcessorInformation35

The object containing the custom data that the merchant defines.



94
95
96
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 94

def processor_information
  @processor_information
end

#risk_informationRiskInformation11

The object containing the custom data that the merchant defines.

Returns:



102
103
104
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 102

def risk_information
  @risk_information
end

#statusString

The status of the submitted transaction. Note: This field may not be returned for all transactions.

Returns:

  • (String)


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

def status
  @status
end

#submit_time_utcString

Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57 (10:47:57 p.m.). The T separates the date and the time. The Z indicates UTC. Returned by Cybersource for all services.

Returns:

  • (String)


26
27
28
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 26

def submit_time_utc
  @submit_time_utc
end

Class Method Details

.from_element(root) ⇒ Object



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
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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 304

def self.from_element(root)
  id = XmlUtilities.from_element(root, 'id', String)
  submit_time_utc = XmlUtilities.from_element(root, 'submitTimeUtc', String)
  merchant_id = XmlUtilities.from_element(root, 'merchantId', String)
  status = XmlUtilities.from_element(root, 'status', String)
  application_information = XmlUtilities.from_element(
    root, 'ApplicationInformation1', ApplicationInformation1
  )
  buyer_information = XmlUtilities.from_element(root, 'BuyerInformation11',
                                                BuyerInformation11)
  client_reference_information = XmlUtilities.from_element(
    root, 'ClientReferenceInformation76',
    ClientReferenceInformation76
  )
  consumer_authentication_information = XmlUtilities.from_element(
    root, 'ConsumerAuthenticationInformation12',
    ConsumerAuthenticationInformation12
  )
  device_information = XmlUtilities.from_element(root,
                                                 'DeviceInformation15',
                                                 DeviceInformation15)
  error_information = XmlUtilities.from_element(root, 'ErrorInformation34',
                                                ErrorInformation34)
  fraud_marking_information = XmlUtilities.from_element(
    root, 'FraudMarkingInformation', FraudMarkingInformation
  )
  merchant_defined_information = XmlUtilities.from_element_to_array(
    root, 'MerchantDefinedInformation',
    MerchantDefinedInformation
  )
  merchant_information = XmlUtilities.from_element(root,
                                                   'MerchantInformation25',
                                                   MerchantInformation25)
  order_information = XmlUtilities.from_element(root, 'OrderInformation58',
                                                OrderInformation58)
  payment_information = XmlUtilities.from_element(root,
                                                  'PaymentInformation44',
                                                  PaymentInformation44)
  processing_information = XmlUtilities.from_element(
    root, 'ProcessingInformation70', ProcessingInformation70
  )
  processor_information = XmlUtilities.from_element(
    root, 'ProcessorInformation35', ProcessorInformation35
  )
  point_of_sale_information = XmlUtilities.from_element(
    root, 'PointOfSaleInformation15', PointOfSaleInformation15
  )
  risk_information = XmlUtilities.from_element(root, 'RiskInformation11',
                                               RiskInformation11)
  links = XmlUtilities.from_element(root, 'Links246', Links246)

  new(id: id,
      submit_time_utc: submit_time_utc,
      merchant_id: merchant_id,
      status: status,
      application_information: application_information,
      buyer_information: buyer_information,
      client_reference_information: client_reference_information,
      consumer_authentication_information: consumer_authentication_information,
      device_information: device_information,
      error_information: error_information,
      fraud_marking_information: fraud_marking_information,
      merchant_defined_information: merchant_defined_information,
      merchant_information: merchant_information,
      order_information: order_information,
      payment_information: payment_information,
      processing_information: processing_information,
      processor_information: processor_information,
      point_of_sale_information: point_of_sale_information,
      risk_information: risk_information,
      links: links,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 220

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  submit_time_utc =
    hash.key?('submitTimeUtc') ? hash['submitTimeUtc'] : SKIP
  merchant_id = hash.key?('merchantId') ? hash['merchantId'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  application_information = ApplicationInformation1.from_hash(hash['applicationInformation']) if
    hash['applicationInformation']
  buyer_information = BuyerInformation11.from_hash(hash['buyerInformation']) if
    hash['buyerInformation']
  if hash['clientReferenceInformation']
    client_reference_information = ClientReferenceInformation76.from_hash(hash['clientReferenceInformation'])
  end
  if hash['consumerAuthenticationInformation']
    consumer_authentication_information = ConsumerAuthenticationInformation12.from_hash(hash['consumerAuthenticationInformation'])
  end
  device_information = DeviceInformation15.from_hash(hash['deviceInformation']) if
    hash['deviceInformation']
  error_information = ErrorInformation34.from_hash(hash['errorInformation']) if
    hash['errorInformation']
  if hash['fraudMarkingInformation']
    fraud_marking_information = FraudMarkingInformation.from_hash(hash['fraudMarkingInformation'])
  end
  # 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 << (MerchantDefinedInformation.from_hash(structure) if structure)
    end
  end

  merchant_defined_information = SKIP unless hash.key?('merchantDefinedInformation')
  merchant_information = MerchantInformation25.from_hash(hash['merchantInformation']) if
    hash['merchantInformation']
  order_information = OrderInformation58.from_hash(hash['orderInformation']) if
    hash['orderInformation']
  payment_information = PaymentInformation44.from_hash(hash['paymentInformation']) if
    hash['paymentInformation']
  processing_information = ProcessingInformation70.from_hash(hash['processingInformation']) if
    hash['processingInformation']
  processor_information = ProcessorInformation35.from_hash(hash['processorInformation']) if
    hash['processorInformation']
  if hash['pointOfSaleInformation']
    point_of_sale_information = PointOfSaleInformation15.from_hash(hash['pointOfSaleInformation'])
  end
  risk_information = RiskInformation11.from_hash(hash['riskInformation']) if
    hash['riskInformation']
  links = Links246.from_hash(hash['_links']) if hash['_links']

  # 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.
  TransactionSummary.new(id: id,
                         submit_time_utc: submit_time_utc,
                         merchant_id: merchant_id,
                         status: status,
                         application_information: application_information,
                         buyer_information: buyer_information,
                         client_reference_information: client_reference_information,
                         consumer_authentication_information: consumer_authentication_information,
                         device_information: device_information,
                         error_information: error_information,
                         fraud_marking_information: fraud_marking_information,
                         merchant_defined_information: merchant_defined_information,
                         merchant_information: merchant_information,
                         order_information: order_information,
                         payment_information: payment_information,
                         processing_information: processing_information,
                         processor_information: processor_information,
                         point_of_sale_information: point_of_sale_information,
                         risk_information: risk_information,
                         links: links,
                         additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['submit_time_utc'] = 'submitTimeUtc'
  @_hash['merchant_id'] = 'merchantId'
  @_hash['status'] = 'status'
  @_hash['application_information'] = 'applicationInformation'
  @_hash['buyer_information'] = 'buyerInformation'
  @_hash['client_reference_information'] = 'clientReferenceInformation'
  @_hash['consumer_authentication_information'] =
    'consumerAuthenticationInformation'
  @_hash['device_information'] = 'deviceInformation'
  @_hash['error_information'] = 'errorInformation'
  @_hash['fraud_marking_information'] = 'fraudMarkingInformation'
  @_hash['merchant_defined_information'] = 'merchantDefinedInformation'
  @_hash['merchant_information'] = 'merchantInformation'
  @_hash['order_information'] = 'orderInformation'
  @_hash['payment_information'] = 'paymentInformation'
  @_hash['processing_information'] = 'processingInformation'
  @_hash['processor_information'] = 'processorInformation'
  @_hash['point_of_sale_information'] = 'pointOfSaleInformation'
  @_hash['risk_information'] = 'riskInformation'
  @_hash['links'] = '_links'
  @_hash
end

.nullablesObject

An array for nullable fields



162
163
164
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 162

def self.nullables
  []
end

.optionalsObject

An array for optional fields



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 136

def self.optionals
  %w[
    id
    submit_time_utc
    merchant_id
    status
    application_information
    buyer_information
    client_reference_information
    consumer_authentication_information
    device_information
    error_information
    fraud_marking_information
    merchant_defined_information
    merchant_information
    order_information
    payment_information
    processing_information
    processor_information
    point_of_sale_information
    risk_information
    links
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 444

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, submit_time_utc: #{@submit_time_utc.inspect},"\
  " merchant_id: #{@merchant_id.inspect}, status: #{@status.inspect}, application_information:"\
  " #{@application_information.inspect}, buyer_information: #{@buyer_information.inspect},"\
  " client_reference_information: #{@client_reference_information.inspect},"\
  " consumer_authentication_information: #{@consumer_authentication_information.inspect},"\
  " device_information: #{@device_information.inspect}, error_information:"\
  " #{@error_information.inspect}, fraud_marking_information:"\
  " #{@fraud_marking_information.inspect}, merchant_defined_information:"\
  " #{@merchant_defined_information.inspect}, merchant_information:"\
  " #{@merchant_information.inspect}, order_information: #{@order_information.inspect},"\
  " payment_information: #{@payment_information.inspect}, processing_information:"\
  " #{@processing_information.inspect}, processor_information:"\
  " #{@processor_information.inspect}, point_of_sale_information:"\
  " #{@point_of_sale_information.inspect}, risk_information: #{@risk_information.inspect},"\
  " links: #{@links.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 426

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, submit_time_utc: #{@submit_time_utc}, merchant_id:"\
  " #{@merchant_id}, status: #{@status}, application_information: #{@application_information},"\
  " buyer_information: #{@buyer_information}, client_reference_information:"\
  " #{@client_reference_information}, consumer_authentication_information:"\
  " #{@consumer_authentication_information}, device_information: #{@device_information},"\
  " error_information: #{@error_information}, fraud_marking_information:"\
  " #{@fraud_marking_information}, merchant_defined_information:"\
  " #{@merchant_defined_information}, merchant_information: #{@merchant_information},"\
  " order_information: #{@order_information}, payment_information: #{@payment_information},"\
  " processing_information: #{@processing_information}, processor_information:"\
  " #{@processor_information}, point_of_sale_information: #{@point_of_sale_information},"\
  " risk_information: #{@risk_information}, links: #{@links}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
# File 'lib/cyber_source_merged_spec/models/transaction_summary.rb', line 378

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

  XmlUtilities.add_as_subelement(doc, root, 'id', id)
  XmlUtilities.add_as_subelement(doc, root, 'submitTimeUtc',
                                 submit_time_utc)
  XmlUtilities.add_as_subelement(doc, root, 'merchantId', merchant_id)
  XmlUtilities.add_as_subelement(doc, root, 'status', status)
  XmlUtilities.add_as_subelement(doc, root, 'ApplicationInformation1',
                                 application_information)
  XmlUtilities.add_as_subelement(doc, root, 'BuyerInformation11',
                                 buyer_information)
  XmlUtilities.add_as_subelement(doc, root, 'ClientReferenceInformation76',
                                 client_reference_information)
  XmlUtilities.add_as_subelement(doc, root,
                                 'ConsumerAuthenticationInformation12',
                                 consumer_authentication_information)
  XmlUtilities.add_as_subelement(doc, root, 'DeviceInformation15',
                                 device_information)
  XmlUtilities.add_as_subelement(doc, root, 'ErrorInformation34',
                                 error_information)
  XmlUtilities.add_as_subelement(doc, root, 'FraudMarkingInformation',
                                 fraud_marking_information)
  XmlUtilities.add_array_as_subelement(doc, root,
                                       'MerchantDefinedInformation',
                                       merchant_defined_information)
  XmlUtilities.add_as_subelement(doc, root, 'MerchantInformation25',
                                 merchant_information)
  XmlUtilities.add_as_subelement(doc, root, 'OrderInformation58',
                                 order_information)
  XmlUtilities.add_as_subelement(doc, root, 'PaymentInformation44',
                                 payment_information)
  XmlUtilities.add_as_subelement(doc, root, 'ProcessingInformation70',
                                 processing_information)
  XmlUtilities.add_as_subelement(doc, root, 'ProcessorInformation35',
                                 processor_information)
  XmlUtilities.add_as_subelement(doc, root, 'PointOfSaleInformation15',
                                 point_of_sale_information)
  XmlUtilities.add_as_subelement(doc, root, 'RiskInformation11',
                                 risk_information)
  XmlUtilities.add_as_subelement(doc, root, 'Links246', links)
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end