Class: CyberSourceMergedSpec::RetrievalDetail

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

Overview

RetrievalDetail 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(processor_merchant_id: SKIP, merchant_name: SKIP, transaction_reference_number: SKIP, merchant_reference_number: SKIP, nature_of_dispute: SKIP, alert_type: SKIP, amount: SKIP, sign: SKIP, action: SKIP, card_type: SKIP, original_settlement_time: SKIP, tracking_number: SKIP, currency_code: SKIP, request_id: SKIP, response_due_time: SKIP, time: SKIP, action_description: SKIP, customer_id: SKIP, reason_code: SKIP, representment_cp_time: SKIP, applications: SKIP, event_requested_time: SKIP, additional_properties: nil) ⇒ RetrievalDetail

Returns a new instance of RetrievalDetail.



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

def initialize(processor_merchant_id: SKIP, merchant_name: SKIP,
               transaction_reference_number: SKIP,
               merchant_reference_number: SKIP, nature_of_dispute: SKIP,
               alert_type: SKIP, amount: SKIP, sign: SKIP, action: SKIP,
               card_type: SKIP, original_settlement_time: SKIP,
               tracking_number: SKIP, currency_code: SKIP, request_id: SKIP,
               response_due_time: SKIP, time: SKIP,
               action_description: SKIP, customer_id: SKIP,
               reason_code: SKIP, representment_cp_time: SKIP,
               applications: SKIP, event_requested_time: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @processor_merchant_id = processor_merchant_id unless processor_merchant_id == SKIP
  @merchant_name = merchant_name unless merchant_name == SKIP
  unless transaction_reference_number == SKIP
    @transaction_reference_number =
      transaction_reference_number
  end
  unless merchant_reference_number == SKIP
    @merchant_reference_number =
      merchant_reference_number
  end
  @nature_of_dispute = nature_of_dispute unless nature_of_dispute == SKIP
  @alert_type = alert_type unless alert_type == SKIP
  @amount = amount unless amount == SKIP
  @sign = sign unless sign == SKIP
  @action = action unless action == SKIP
  @card_type = card_type unless card_type == SKIP
  @original_settlement_time = original_settlement_time unless original_settlement_time == SKIP
  @tracking_number = tracking_number unless tracking_number == SKIP
  @currency_code = currency_code unless currency_code == SKIP
  @request_id = request_id unless request_id == SKIP
  @response_due_time = response_due_time unless response_due_time == SKIP
  @time = time unless time == SKIP
  @action_description = action_description unless action_description == SKIP
  @customer_id = customer_id unless customer_id == SKIP
  @reason_code = reason_code unless reason_code == SKIP
  @representment_cp_time = representment_cp_time unless representment_cp_time == SKIP
  @applications = applications unless applications == SKIP
  @event_requested_time = event_requested_time unless event_requested_time == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#actionString

Retrieval Action

Returns:

  • (String)


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

def action
  @action
end

#action_descriptionString

Retrieval Action Description

Returns:

  • (String)


79
80
81
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 79

def action_description
  @action_description
end

#alert_typeString

Retrieval Alert Type

Returns:

  • (String)


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

def alert_type
  @alert_type
end

#amountString

Retrieval Amount

Returns:

  • (String)


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

def amount
  @amount
end

#applicationsString

ICS Request Applications

Returns:

  • (String)


95
96
97
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 95

def applications
  @applications
end

#card_typeString

Card Type

Returns:

  • (String)


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

def card_type
  @card_type
end

#currency_codeString

Valid ISO 4217 ALPHA-3 currency code

Returns:

  • (String)


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

def currency_code
  @currency_code
end

#customer_idString

Customer Id

Returns:

  • (String)


83
84
85
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 83

def customer_id
  @customer_id
end

#event_requested_timeDateTime

Event Request Date

Returns:

  • (DateTime)


99
100
101
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 99

def event_requested_time
  @event_requested_time
end

#merchant_nameString

Merchant Name

Returns:

  • (String)


19
20
21
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 19

def merchant_name
  @merchant_name
end

#merchant_reference_numberString

Merchant Reference Number

Returns:

  • (String)


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

def merchant_reference_number
  @merchant_reference_number
end

#nature_of_disputeString

Nature of Dispute

Returns:

  • (String)


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

def nature_of_dispute
  @nature_of_dispute
end

#original_settlement_timeDateTime

Original Settlement Date

Returns:

  • (DateTime)


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

def original_settlement_time
  @original_settlement_time
end

#processor_merchant_idString

Processor Merchant Id

Returns:

  • (String)


15
16
17
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 15

def processor_merchant_id
  @processor_merchant_id
end

#reason_codeString

Retrieval Reason Code

Returns:

  • (String)


87
88
89
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 87

def reason_code
  @reason_code
end

#representment_cp_timeDateTime

Representment CP Date

Returns:

  • (DateTime)


91
92
93
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 91

def representment_cp_time
  @representment_cp_time
end

#request_idString

Request Id

Returns:

  • (String)


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

def request_id
  @request_id
end

#response_due_timeDateTime

Response Due Date

Returns:

  • (DateTime)


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

def response_due_time
  @response_due_time
end

#signString

Retrieval Sign

Returns:

  • (String)


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

def sign
  @sign
end

#timeDateTime

Retrieval Date

Returns:

  • (DateTime)


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

def time
  @time
end

#tracking_numberString

Tracking Number

Returns:

  • (String)


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

def tracking_number
  @tracking_number
end

#transaction_reference_numberString

Transaction Reference Number

Returns:

  • (String)


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

def transaction_reference_number
  @transaction_reference_number
end

Class Method Details

.from_element(root) ⇒ Object



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
377
378
379
380
381
382
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 314

def self.from_element(root)
  processor_merchant_id = XmlUtilities.from_element(root,
                                                    'processorMerchantId',
                                                    String)
  merchant_name = XmlUtilities.from_element(root, 'merchantName', String)
  transaction_reference_number = XmlUtilities.from_element(
    root, 'transactionReferenceNumber', String
  )
  merchant_reference_number = XmlUtilities.from_element(
    root, 'merchantReferenceNumber', String
  )
  nature_of_dispute = XmlUtilities.from_element(root, 'natureOfDispute',
                                                String)
  alert_type = XmlUtilities.from_element(root, 'alertType', String)
  amount = XmlUtilities.from_element(root, 'amount', String)
  sign = XmlUtilities.from_element(root, 'sign', String)
  action = XmlUtilities.from_element(root, 'action', String)
  card_type = XmlUtilities.from_element(root, 'cardType', String)
  original_settlement_time = XmlUtilities.from_element(
    root, 'originalSettlementTime', String,
    datetime_format: 'rfc3339'
  )
  tracking_number = XmlUtilities.from_element(root, 'trackingNumber',
                                              String)
  currency_code = XmlUtilities.from_element(root, 'currencyCode', String)
  request_id = XmlUtilities.from_element(root, 'requestId', String)
  response_due_time = XmlUtilities.from_element(root, 'responseDueTime',
                                                String,
                                                datetime_format: 'rfc3339')
  time = XmlUtilities.from_element(root, 'time', String,
                                   datetime_format: 'rfc3339')
  action_description = XmlUtilities.from_element(root, 'actionDescription',
                                                 String)
  customer_id = XmlUtilities.from_element(root, 'customerId', String)
  reason_code = XmlUtilities.from_element(root, 'reasonCode', String)
  representment_cp_time = XmlUtilities.from_element(
    root, 'representmentCPTime', String,
    datetime_format: 'rfc3339'
  )
  applications = XmlUtilities.from_element(root, 'applications', String)
  event_requested_time = XmlUtilities.from_element(
    root, 'eventRequestedTime', String,
    datetime_format: 'rfc3339'
  )

  new(processor_merchant_id: processor_merchant_id,
      merchant_name: merchant_name,
      transaction_reference_number: transaction_reference_number,
      merchant_reference_number: merchant_reference_number,
      nature_of_dispute: nature_of_dispute,
      alert_type: alert_type,
      amount: amount,
      sign: sign,
      action: action,
      card_type: card_type,
      original_settlement_time: original_settlement_time,
      tracking_number: tracking_number,
      currency_code: currency_code,
      request_id: request_id,
      response_due_time: response_due_time,
      time: time,
      action_description: action_description,
      customer_id: customer_id,
      reason_code: reason_code,
      representment_cp_time: representment_cp_time,
      applications: applications,
      event_requested_time: event_requested_time,
      additional_properties: additional_properties)
end

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  processor_merchant_id =
    hash.key?('processorMerchantId') ? hash['processorMerchantId'] : SKIP
  merchant_name = hash.key?('merchantName') ? hash['merchantName'] : SKIP
  transaction_reference_number =
    hash.key?('transactionReferenceNumber') ? hash['transactionReferenceNumber'] : SKIP
  merchant_reference_number =
    hash.key?('merchantReferenceNumber') ? hash['merchantReferenceNumber'] : SKIP
  nature_of_dispute =
    hash.key?('natureOfDispute') ? hash['natureOfDispute'] : SKIP
  alert_type = hash.key?('alertType') ? hash['alertType'] : SKIP
  amount = hash.key?('amount') ? hash['amount'] : SKIP
  sign = hash.key?('sign') ? hash['sign'] : SKIP
  action = hash.key?('action') ? hash['action'] : SKIP
  card_type = hash.key?('cardType') ? hash['cardType'] : SKIP
  original_settlement_time = if hash.key?('originalSettlementTime')
                               (DateTimeHelper.from_rfc3339(hash['originalSettlementTime']) if hash['originalSettlementTime'])
                             else
                               SKIP
                             end
  tracking_number =
    hash.key?('trackingNumber') ? hash['trackingNumber'] : SKIP
  currency_code = hash.key?('currencyCode') ? hash['currencyCode'] : SKIP
  request_id = hash.key?('requestId') ? hash['requestId'] : SKIP
  response_due_time = if hash.key?('responseDueTime')
                        (DateTimeHelper.from_rfc3339(hash['responseDueTime']) if hash['responseDueTime'])
                      else
                        SKIP
                      end
  time = if hash.key?('time')
           (DateTimeHelper.from_rfc3339(hash['time']) if hash['time'])
         else
           SKIP
         end
  action_description =
    hash.key?('actionDescription') ? hash['actionDescription'] : SKIP
  customer_id = hash.key?('customerId') ? hash['customerId'] : SKIP
  reason_code = hash.key?('reasonCode') ? hash['reasonCode'] : SKIP
  representment_cp_time = if hash.key?('representmentCPTime')
                            (DateTimeHelper.from_rfc3339(hash['representmentCPTime']) if hash['representmentCPTime'])
                          else
                            SKIP
                          end
  applications = hash.key?('applications') ? hash['applications'] : SKIP
  event_requested_time = if hash.key?('eventRequestedTime')
                           (DateTimeHelper.from_rfc3339(hash['eventRequestedTime']) if hash['eventRequestedTime'])
                         else
                           SKIP
                         end

  # 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.
  RetrievalDetail.new(processor_merchant_id: processor_merchant_id,
                      merchant_name: merchant_name,
                      transaction_reference_number: transaction_reference_number,
                      merchant_reference_number: merchant_reference_number,
                      nature_of_dispute: nature_of_dispute,
                      alert_type: alert_type,
                      amount: amount,
                      sign: sign,
                      action: action,
                      card_type: card_type,
                      original_settlement_time: original_settlement_time,
                      tracking_number: tracking_number,
                      currency_code: currency_code,
                      request_id: request_id,
                      response_due_time: response_due_time,
                      time: time,
                      action_description: action_description,
                      customer_id: customer_id,
                      reason_code: reason_code,
                      representment_cp_time: representment_cp_time,
                      applications: applications,
                      event_requested_time: event_requested_time,
                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['processor_merchant_id'] = 'processorMerchantId'
  @_hash['merchant_name'] = 'merchantName'
  @_hash['transaction_reference_number'] = 'transactionReferenceNumber'
  @_hash['merchant_reference_number'] = 'merchantReferenceNumber'
  @_hash['nature_of_dispute'] = 'natureOfDispute'
  @_hash['alert_type'] = 'alertType'
  @_hash['amount'] = 'amount'
  @_hash['sign'] = 'sign'
  @_hash['action'] = 'action'
  @_hash['card_type'] = 'cardType'
  @_hash['original_settlement_time'] = 'originalSettlementTime'
  @_hash['tracking_number'] = 'trackingNumber'
  @_hash['currency_code'] = 'currencyCode'
  @_hash['request_id'] = 'requestId'
  @_hash['response_due_time'] = 'responseDueTime'
  @_hash['time'] = 'time'
  @_hash['action_description'] = 'actionDescription'
  @_hash['customer_id'] = 'customerId'
  @_hash['reason_code'] = 'reasonCode'
  @_hash['representment_cp_time'] = 'representmentCPTime'
  @_hash['applications'] = 'applications'
  @_hash['event_requested_time'] = 'eventRequestedTime'
  @_hash
end

.nullablesObject

An array for nullable fields



158
159
160
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 158

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    processor_merchant_id
    merchant_name
    transaction_reference_number
    merchant_reference_number
    nature_of_dispute
    alert_type
    amount
    sign
    action
    card_type
    original_settlement_time
    tracking_number
    currency_code
    request_id
    response_due_time
    time
    action_description
    customer_id
    reason_code
    representment_cp_time
    applications
    event_requested_time
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 447

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} processor_merchant_id: #{@processor_merchant_id.inspect}, merchant_name:"\
  " #{@merchant_name.inspect}, transaction_reference_number:"\
  " #{@transaction_reference_number.inspect}, merchant_reference_number:"\
  " #{@merchant_reference_number.inspect}, nature_of_dispute: #{@nature_of_dispute.inspect},"\
  " alert_type: #{@alert_type.inspect}, amount: #{@amount.inspect}, sign: #{@sign.inspect},"\
  " action: #{@action.inspect}, card_type: #{@card_type.inspect}, original_settlement_time:"\
  " #{@original_settlement_time.inspect}, tracking_number: #{@tracking_number.inspect},"\
  " currency_code: #{@currency_code.inspect}, request_id: #{@request_id.inspect},"\
  " response_due_time: #{@response_due_time.inspect}, time: #{@time.inspect},"\
  " action_description: #{@action_description.inspect}, customer_id: #{@customer_id.inspect},"\
  " reason_code: #{@reason_code.inspect}, representment_cp_time:"\
  " #{@representment_cp_time.inspect}, applications: #{@applications.inspect},"\
  " event_requested_time: #{@event_requested_time.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_event_requested_timeObject



310
311
312
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 310

def to_custom_event_requested_time
  DateTimeHelper.to_rfc3339(event_requested_time)
end

#to_custom_original_settlement_timeObject



294
295
296
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 294

def to_custom_original_settlement_time
  DateTimeHelper.to_rfc3339(original_settlement_time)
end

#to_custom_representment_cp_timeObject



306
307
308
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 306

def to_custom_representment_cp_time
  DateTimeHelper.to_rfc3339(representment_cp_time)
end

#to_custom_response_due_timeObject



298
299
300
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 298

def to_custom_response_due_time
  DateTimeHelper.to_rfc3339(response_due_time)
end

#to_custom_timeObject



302
303
304
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 302

def to_custom_time
  DateTimeHelper.to_rfc3339(time)
end

#to_sObject

Provides a human-readable string representation of the object.



431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 431

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} processor_merchant_id: #{@processor_merchant_id}, merchant_name:"\
  " #{@merchant_name}, transaction_reference_number: #{@transaction_reference_number},"\
  " merchant_reference_number: #{@merchant_reference_number}, nature_of_dispute:"\
  " #{@nature_of_dispute}, alert_type: #{@alert_type}, amount: #{@amount}, sign: #{@sign},"\
  " action: #{@action}, card_type: #{@card_type}, original_settlement_time:"\
  " #{@original_settlement_time}, tracking_number: #{@tracking_number}, currency_code:"\
  " #{@currency_code}, request_id: #{@request_id}, response_due_time: #{@response_due_time},"\
  " time: #{@time}, action_description: #{@action_description}, customer_id: #{@customer_id},"\
  " reason_code: #{@reason_code}, representment_cp_time: #{@representment_cp_time},"\
  " applications: #{@applications}, event_requested_time: #{@event_requested_time},"\
  " additional_properties: #{@additional_properties}>"
end

#to_xml_element(doc, root_name) ⇒ Object



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
424
425
426
427
428
# File 'lib/cyber_source_merged_spec/models/retrieval_detail.rb', line 384

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

  XmlUtilities.add_as_subelement(doc, root, 'processorMerchantId',
                                 processor_merchant_id)
  XmlUtilities.add_as_subelement(doc, root, 'merchantName', merchant_name)
  XmlUtilities.add_as_subelement(doc, root, 'transactionReferenceNumber',
                                 transaction_reference_number)
  XmlUtilities.add_as_subelement(doc, root, 'merchantReferenceNumber',
                                 merchant_reference_number)
  XmlUtilities.add_as_subelement(doc, root, 'natureOfDispute',
                                 nature_of_dispute)
  XmlUtilities.add_as_subelement(doc, root, 'alertType', alert_type)
  XmlUtilities.add_as_subelement(doc, root, 'amount', amount)
  XmlUtilities.add_as_subelement(doc, root, 'sign', sign)
  XmlUtilities.add_as_subelement(doc, root, 'action', action)
  XmlUtilities.add_as_subelement(doc, root, 'cardType', card_type)
  XmlUtilities.add_as_subelement(doc, root, 'originalSettlementTime',
                                 original_settlement_time,
                                 datetime_format: 'rfc3339')
  XmlUtilities.add_as_subelement(doc, root, 'trackingNumber',
                                 tracking_number)
  XmlUtilities.add_as_subelement(doc, root, 'currencyCode', currency_code)
  XmlUtilities.add_as_subelement(doc, root, 'requestId', request_id)
  XmlUtilities.add_as_subelement(doc, root, 'responseDueTime',
                                 response_due_time,
                                 datetime_format: 'rfc3339')
  XmlUtilities.add_as_subelement(doc, root, 'time', time,
                                 datetime_format: 'rfc3339')
  XmlUtilities.add_as_subelement(doc, root, 'actionDescription',
                                 action_description)
  XmlUtilities.add_as_subelement(doc, root, 'customerId', customer_id)
  XmlUtilities.add_as_subelement(doc, root, 'reasonCode', reason_code)
  XmlUtilities.add_as_subelement(doc, root, 'representmentCPTime',
                                 representment_cp_time,
                                 datetime_format: 'rfc3339')
  XmlUtilities.add_as_subelement(doc, root, 'applications', applications)
  XmlUtilities.add_as_subelement(doc, root, 'eventRequestedTime',
                                 event_requested_time,
                                 datetime_format: 'rfc3339')
  XmlUtilities.add_as_subelement(doc, root, 'additional_properties',
                                 additional_properties)

  root
end