dna-apimatic-sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +172 -0
  4. data/bin/console +15 -0
  5. data/lib/dna_payments_partner_reporting_settlement_ap_is/api_helper.rb +10 -0
  6. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/authentication_api.rb +53 -0
  7. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/base_api.rb +67 -0
  8. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/ecommerce_transactions_api.rb +113 -0
  9. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/merchants_api.rb +79 -0
  10. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/oauth_authorization_api.rb +44 -0
  11. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/pos_transactions_api.rb +128 -0
  12. data/lib/dna_payments_partner_reporting_settlement_ap_is/apis/settlements_api.rb +82 -0
  13. data/lib/dna_payments_partner_reporting_settlement_ap_is/client.rb +110 -0
  14. data/lib/dna_payments_partner_reporting_settlement_ap_is/configuration.rb +177 -0
  15. data/lib/dna_payments_partner_reporting_settlement_ap_is/exceptions/api_exception.rb +21 -0
  16. data/lib/dna_payments_partner_reporting_settlement_ap_is/exceptions/error_exception.rb +51 -0
  17. data/lib/dna_payments_partner_reporting_settlement_ap_is/exceptions/oauth_provider_exception.rb +64 -0
  18. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/api_response.rb +19 -0
  19. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/auth/oauth_2.rb +156 -0
  20. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/http_call_back.rb +10 -0
  21. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/http_method_enum.rb +10 -0
  22. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/http_request.rb +10 -0
  23. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/http_response.rb +10 -0
  24. data/lib/dna_payments_partner_reporting_settlement_ap_is/http/proxy_settings.rb +22 -0
  25. data/lib/dna_payments_partner_reporting_settlement_ap_is/logging/configuration/api_logging_configuration.rb +186 -0
  26. data/lib/dna_payments_partner_reporting_settlement_ap_is/logging/sdk_logger.rb +17 -0
  27. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/auth_token_request.rb +97 -0
  28. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/auth_token_response.rb +115 -0
  29. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/base_model.rb +110 -0
  30. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/capture_method.rb +72 -0
  31. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/card_type.rb +36 -0
  32. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/ecommerce_transaction.rb +528 -0
  33. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/ecommerce_transactions_response.rb +94 -0
  34. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/grant_type.rb +26 -0
  35. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v1.rb +85 -0
  36. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/merchant_v2.rb +138 -0
  37. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/merchants_v2_response.rb +94 -0
  38. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/oauth_provider_error.rb +62 -0
  39. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/oauth_scope.rb +26 -0
  40. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/oauth_token.rb +96 -0
  41. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/operation.rb +48 -0
  42. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/pos_transaction.rb +298 -0
  43. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/pos_transactions_response.rb +105 -0
  44. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/processor.rb +36 -0
  45. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/scope.rb +26 -0
  46. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/search_by.rb +36 -0
  47. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/settlement.rb +314 -0
  48. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/settlements_response.rb +94 -0
  49. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/status.rb +46 -0
  50. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/status1.rb +36 -0
  51. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/status2.rb +36 -0
  52. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/terminal.rb +141 -0
  53. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/token_type.rb +26 -0
  54. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/transaction_type.rb +201 -0
  55. data/lib/dna_payments_partner_reporting_settlement_ap_is/models/type.rb +36 -0
  56. data/lib/dna_payments_partner_reporting_settlement_ap_is/utilities/date_time_helper.rb +11 -0
  57. data/lib/dna_payments_partner_reporting_settlement_ap_is/utilities/file_wrapper.rb +28 -0
  58. data/lib/dna_payments_partner_reporting_settlement_ap_is.rb +125 -0
  59. metadata +142 -0
@@ -0,0 +1,528 @@
1
+ # dna_payments_partner_reporting_settlement_ap_is
2
+ #
3
+ # This file was
4
+ # automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module DnaPaymentsPartnerReportingSettlementApIs
8
+ # EcommerceTransaction Model.
9
+ class EcommerceTransaction < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Unique transaction ID.
14
+ # @return [String]
15
+ attr_accessor :id
16
+
17
+ # Unique ID for the merchant, allocated by DNA Payments.
18
+ # @return [String]
19
+ attr_accessor :merchant_id
20
+
21
+ # Name of the merchant.
22
+ # @return [String]
23
+ attr_accessor :merchant_name
24
+
25
+ # Unique order number allocated by the merchant.
26
+ # @return [String]
27
+ attr_accessor :merchant_reference
28
+
29
+ # Original requested transaction amount.
30
+ # @return [Float]
31
+ attr_accessor :amount
32
+
33
+ # Transaction currency code. ISO 4217 format, e.g. GBP.
34
+ # @return [String]
35
+ attr_accessor :currency
36
+
37
+ # Date/time the transaction was created on the DNA Platform.
38
+ # @return [DateTime]
39
+ attr_accessor :created_date
40
+
41
+ # Date/time the transaction authorisation was attempted with the acquirer.
42
+ # @return [DateTime]
43
+ attr_accessor :auth_date
44
+
45
+ # Date/time the transaction was confirmed on the DNA Platform.
46
+ # @return [DateTime]
47
+ attr_accessor :confirm_date
48
+
49
+ # Date/time the transaction was processed (last action performed, e.g.
50
+ # charged/settled/refunded).
51
+ # @return [DateTime]
52
+ attr_accessor :processed_date
53
+
54
+ # Charged/Settled/Refunded amount.
55
+ # @return [Float]
56
+ attr_accessor :processed_amount
57
+
58
+ # Transaction type. See the Ecommerce Reference documentation for the full
59
+ # list (not available at spec-generation time).
60
+ # @return [String]
61
+ attr_accessor :type
62
+
63
+ # Status of the transaction. See the Ecommerce Reference documentation for
64
+ # the full list (not available at spec-generation time).
65
+ # @return [String]
66
+ attr_accessor :status
67
+
68
+ # Payment method used on the transaction. See the Ecommerce Reference
69
+ # documentation for the full list (not available at spec-generation time).
70
+ # @return [String]
71
+ attr_accessor :payment_method
72
+
73
+ # Type of card used in the transaction.
74
+ # @return [String]
75
+ attr_accessor :card_type
76
+
77
+ # Card scheme used in the transaction, e.g. mastercard, visa.
78
+ # @return [String]
79
+ attr_accessor :card_scheme
80
+
81
+ # Masked PAN for the payment card used; contains the first six and last four
82
+ # digits.
83
+ # @return [String]
84
+ attr_accessor :card_mask
85
+
86
+ # Issuer of the payment card used in the transaction.
87
+ # @return [String]
88
+ attr_accessor :issuer
89
+
90
+ # Country in which the payment card was issued. ISO 3166-1 alpha-3.
91
+ # @return [String]
92
+ attr_accessor :issuer_country
93
+
94
+ # Response code returned by the acquirer during authorisation.
95
+ # @return [String]
96
+ attr_accessor :response_code
97
+
98
+ # Authorisation code issued by the acquirer/issuer for the transaction, when
99
+ # applicable.
100
+ # @return [String]
101
+ attr_accessor :auth_code
102
+
103
+ # Result of the Address Verification System (AVS) check.
104
+ # @return [String]
105
+ attr_accessor :avs_result
106
+
107
+ # Result of the AVS 'House Number' check.
108
+ # @return [String]
109
+ attr_accessor :avs_house_number_result
110
+
111
+ # Result of the AVS 'Post Code' check.
112
+ # @return [String]
113
+ attr_accessor :avs_postcode_result
114
+
115
+ # Result of the Cardholder Security Code (CSC) check.
116
+ # @return [String]
117
+ attr_accessor :csc_result
118
+
119
+ # Result of the Payer Authentication enrollment/authentication checks,
120
+ # format Enrollment/Authentication e.g. Y/A.
121
+ # @return [String]
122
+ attr_accessor :payer_authentication_result
123
+
124
+ # IP address of the consumer. Subject to GDPR confirmation; may be removed.
125
+ # @return [String]
126
+ attr_accessor :payer_ip
127
+
128
+ # Consumer name. Subject to GDPR confirmation; may be removed.
129
+ # @return [String]
130
+ attr_accessor :payer_name
131
+
132
+ # Email address of the consumer. Subject to GDPR confirmation; may be
133
+ # removed.
134
+ # @return [String]
135
+ attr_accessor :payer_email
136
+
137
+ # Phone number of the consumer. Subject to GDPR confirmation; may be
138
+ # removed.
139
+ # @return [String]
140
+ attr_accessor :payer_phone
141
+
142
+ # Country where the purchase was made. Subject to GDPR confirmation; may be
143
+ # removed.
144
+ # @return [String]
145
+ attr_accessor :ip_country
146
+
147
+ # City where the purchase was made. Subject to GDPR confirmation; may be
148
+ # removed.
149
+ # @return [String]
150
+ attr_accessor :ip_city
151
+
152
+ # Locational data – latitude. Subject to GDPR confirmation; may be removed.
153
+ # @return [Float]
154
+ attr_accessor :ip_latitude
155
+
156
+ # Locational data – longitude. Subject to GDPR confirmation; may be removed.
157
+ # @return [Float]
158
+ attr_accessor :ip_longitude
159
+
160
+ # Base64-encoded custom data supplied by the merchant with the transaction
161
+ # request. Max 1024 bytes. Not used for any processing, purely recorded.
162
+ # @return [String]
163
+ attr_accessor :merchant_custom_data
164
+
165
+ # Descriptive text passed in the Payment Request for the transaction.
166
+ # @return [String]
167
+ attr_accessor :description
168
+
169
+ # If the transaction is a full/partial refund, the transactionId of the
170
+ # original/linked sale.
171
+ # @return [String]
172
+ attr_accessor :parent_transaction_id
173
+
174
+ # A mapping from model property names to API property names.
175
+ def self.names
176
+ @_hash = {} if @_hash.nil?
177
+ @_hash['id'] = 'id'
178
+ @_hash['merchant_id'] = 'merchantId'
179
+ @_hash['merchant_name'] = 'merchantName'
180
+ @_hash['merchant_reference'] = 'merchantReference'
181
+ @_hash['amount'] = 'amount'
182
+ @_hash['currency'] = 'currency'
183
+ @_hash['created_date'] = 'createdDate'
184
+ @_hash['auth_date'] = 'authDate'
185
+ @_hash['confirm_date'] = 'confirmDate'
186
+ @_hash['processed_date'] = 'processedDate'
187
+ @_hash['processed_amount'] = 'processedAmount'
188
+ @_hash['type'] = 'type'
189
+ @_hash['status'] = 'status'
190
+ @_hash['payment_method'] = 'paymentMethod'
191
+ @_hash['card_type'] = 'cardType'
192
+ @_hash['card_scheme'] = 'cardScheme'
193
+ @_hash['card_mask'] = 'cardMask'
194
+ @_hash['issuer'] = 'issuer'
195
+ @_hash['issuer_country'] = 'issuerCountry'
196
+ @_hash['response_code'] = 'responseCode'
197
+ @_hash['auth_code'] = 'authCode'
198
+ @_hash['avs_result'] = 'avsResult'
199
+ @_hash['avs_house_number_result'] = 'avsHouseNumberResult'
200
+ @_hash['avs_postcode_result'] = 'avsPostcodeResult'
201
+ @_hash['csc_result'] = 'cscResult'
202
+ @_hash['payer_authentication_result'] = 'payerAuthenticationResult'
203
+ @_hash['payer_ip'] = 'payerIp'
204
+ @_hash['payer_name'] = 'payerName'
205
+ @_hash['payer_email'] = 'payerEmail'
206
+ @_hash['payer_phone'] = 'payerPhone'
207
+ @_hash['ip_country'] = 'ipCountry'
208
+ @_hash['ip_city'] = 'ipCity'
209
+ @_hash['ip_latitude'] = 'ipLatitude'
210
+ @_hash['ip_longitude'] = 'ipLongitude'
211
+ @_hash['merchant_custom_data'] = 'merchantCustomData'
212
+ @_hash['description'] = 'description'
213
+ @_hash['parent_transaction_id'] = 'parentTransactionId'
214
+ @_hash
215
+ end
216
+
217
+ # An array for optional fields
218
+ def self.optionals
219
+ %w[
220
+ id
221
+ merchant_id
222
+ merchant_name
223
+ merchant_reference
224
+ amount
225
+ currency
226
+ created_date
227
+ auth_date
228
+ confirm_date
229
+ processed_date
230
+ processed_amount
231
+ type
232
+ status
233
+ payment_method
234
+ card_type
235
+ card_scheme
236
+ card_mask
237
+ issuer
238
+ issuer_country
239
+ response_code
240
+ auth_code
241
+ avs_result
242
+ avs_house_number_result
243
+ avs_postcode_result
244
+ csc_result
245
+ payer_authentication_result
246
+ payer_ip
247
+ payer_name
248
+ payer_email
249
+ payer_phone
250
+ ip_country
251
+ ip_city
252
+ ip_latitude
253
+ ip_longitude
254
+ merchant_custom_data
255
+ description
256
+ parent_transaction_id
257
+ ]
258
+ end
259
+
260
+ # An array for nullable fields
261
+ def self.nullables
262
+ %w[
263
+ auth_date
264
+ confirm_date
265
+ processed_date
266
+ card_type
267
+ card_scheme
268
+ card_mask
269
+ issuer
270
+ issuer_country
271
+ response_code
272
+ auth_code
273
+ avs_result
274
+ avs_house_number_result
275
+ avs_postcode_result
276
+ csc_result
277
+ payer_authentication_result
278
+ payer_ip
279
+ payer_name
280
+ payer_email
281
+ payer_phone
282
+ ip_country
283
+ ip_city
284
+ ip_latitude
285
+ ip_longitude
286
+ merchant_custom_data
287
+ description
288
+ parent_transaction_id
289
+ ]
290
+ end
291
+
292
+ def initialize(id: SKIP, merchant_id: SKIP, merchant_name: SKIP,
293
+ merchant_reference: SKIP, amount: SKIP, currency: SKIP,
294
+ created_date: SKIP, auth_date: SKIP, confirm_date: SKIP,
295
+ processed_date: SKIP, processed_amount: SKIP, type: SKIP,
296
+ status: SKIP, payment_method: SKIP, card_type: SKIP,
297
+ card_scheme: SKIP, card_mask: SKIP, issuer: SKIP,
298
+ issuer_country: SKIP, response_code: SKIP, auth_code: SKIP,
299
+ avs_result: SKIP, avs_house_number_result: SKIP,
300
+ avs_postcode_result: SKIP, csc_result: SKIP,
301
+ payer_authentication_result: SKIP, payer_ip: SKIP,
302
+ payer_name: SKIP, payer_email: SKIP, payer_phone: SKIP,
303
+ ip_country: SKIP, ip_city: SKIP, ip_latitude: SKIP,
304
+ ip_longitude: SKIP, merchant_custom_data: SKIP,
305
+ description: SKIP, parent_transaction_id: SKIP,
306
+ additional_properties: nil)
307
+ # Add additional model properties to the instance
308
+ additional_properties = {} if additional_properties.nil?
309
+
310
+ @id = id unless id == SKIP
311
+ @merchant_id = merchant_id unless merchant_id == SKIP
312
+ @merchant_name = merchant_name unless merchant_name == SKIP
313
+ @merchant_reference = merchant_reference unless merchant_reference == SKIP
314
+ @amount = amount unless amount == SKIP
315
+ @currency = currency unless currency == SKIP
316
+ @created_date = created_date unless created_date == SKIP
317
+ @auth_date = auth_date unless auth_date == SKIP
318
+ @confirm_date = confirm_date unless confirm_date == SKIP
319
+ @processed_date = processed_date unless processed_date == SKIP
320
+ @processed_amount = processed_amount unless processed_amount == SKIP
321
+ @type = type unless type == SKIP
322
+ @status = status unless status == SKIP
323
+ @payment_method = payment_method unless payment_method == SKIP
324
+ @card_type = card_type unless card_type == SKIP
325
+ @card_scheme = card_scheme unless card_scheme == SKIP
326
+ @card_mask = card_mask unless card_mask == SKIP
327
+ @issuer = issuer unless issuer == SKIP
328
+ @issuer_country = issuer_country unless issuer_country == SKIP
329
+ @response_code = response_code unless response_code == SKIP
330
+ @auth_code = auth_code unless auth_code == SKIP
331
+ @avs_result = avs_result unless avs_result == SKIP
332
+ @avs_house_number_result = avs_house_number_result unless avs_house_number_result == SKIP
333
+ @avs_postcode_result = avs_postcode_result unless avs_postcode_result == SKIP
334
+ @csc_result = csc_result unless csc_result == SKIP
335
+ unless payer_authentication_result == SKIP
336
+ @payer_authentication_result =
337
+ payer_authentication_result
338
+ end
339
+ @payer_ip = payer_ip unless payer_ip == SKIP
340
+ @payer_name = payer_name unless payer_name == SKIP
341
+ @payer_email = payer_email unless payer_email == SKIP
342
+ @payer_phone = payer_phone unless payer_phone == SKIP
343
+ @ip_country = ip_country unless ip_country == SKIP
344
+ @ip_city = ip_city unless ip_city == SKIP
345
+ @ip_latitude = ip_latitude unless ip_latitude == SKIP
346
+ @ip_longitude = ip_longitude unless ip_longitude == SKIP
347
+ @merchant_custom_data = merchant_custom_data unless merchant_custom_data == SKIP
348
+ @description = description unless description == SKIP
349
+ @parent_transaction_id = parent_transaction_id unless parent_transaction_id == SKIP
350
+ @additional_properties = additional_properties
351
+ end
352
+
353
+ # Creates an instance of the object from a hash.
354
+ def self.from_hash(hash)
355
+ return nil unless hash
356
+
357
+ # Extract variables from the hash.
358
+ id = hash.key?('id') ? hash['id'] : SKIP
359
+ merchant_id = hash.key?('merchantId') ? hash['merchantId'] : SKIP
360
+ merchant_name = hash.key?('merchantName') ? hash['merchantName'] : SKIP
361
+ merchant_reference =
362
+ hash.key?('merchantReference') ? hash['merchantReference'] : SKIP
363
+ amount = hash.key?('amount') ? hash['amount'] : SKIP
364
+ currency = hash.key?('currency') ? hash['currency'] : SKIP
365
+ created_date = if hash.key?('createdDate')
366
+ (DateTimeHelper.from_rfc3339(hash['createdDate']) if hash['createdDate'])
367
+ else
368
+ SKIP
369
+ end
370
+ auth_date = if hash.key?('authDate')
371
+ (DateTimeHelper.from_rfc3339(hash['authDate']) if hash['authDate'])
372
+ else
373
+ SKIP
374
+ end
375
+ confirm_date = if hash.key?('confirmDate')
376
+ (DateTimeHelper.from_rfc3339(hash['confirmDate']) if hash['confirmDate'])
377
+ else
378
+ SKIP
379
+ end
380
+ processed_date = if hash.key?('processedDate')
381
+ (DateTimeHelper.from_rfc3339(hash['processedDate']) if hash['processedDate'])
382
+ else
383
+ SKIP
384
+ end
385
+ processed_amount =
386
+ hash.key?('processedAmount') ? hash['processedAmount'] : SKIP
387
+ type = hash.key?('type') ? hash['type'] : SKIP
388
+ status = hash.key?('status') ? hash['status'] : SKIP
389
+ payment_method = hash.key?('paymentMethod') ? hash['paymentMethod'] : SKIP
390
+ card_type = hash.key?('cardType') ? hash['cardType'] : SKIP
391
+ card_scheme = hash.key?('cardScheme') ? hash['cardScheme'] : SKIP
392
+ card_mask = hash.key?('cardMask') ? hash['cardMask'] : SKIP
393
+ issuer = hash.key?('issuer') ? hash['issuer'] : SKIP
394
+ issuer_country = hash.key?('issuerCountry') ? hash['issuerCountry'] : SKIP
395
+ response_code = hash.key?('responseCode') ? hash['responseCode'] : SKIP
396
+ auth_code = hash.key?('authCode') ? hash['authCode'] : SKIP
397
+ avs_result = hash.key?('avsResult') ? hash['avsResult'] : SKIP
398
+ avs_house_number_result =
399
+ hash.key?('avsHouseNumberResult') ? hash['avsHouseNumberResult'] : SKIP
400
+ avs_postcode_result =
401
+ hash.key?('avsPostcodeResult') ? hash['avsPostcodeResult'] : SKIP
402
+ csc_result = hash.key?('cscResult') ? hash['cscResult'] : SKIP
403
+ payer_authentication_result =
404
+ hash.key?('payerAuthenticationResult') ? hash['payerAuthenticationResult'] : SKIP
405
+ payer_ip = hash.key?('payerIp') ? hash['payerIp'] : SKIP
406
+ payer_name = hash.key?('payerName') ? hash['payerName'] : SKIP
407
+ payer_email = hash.key?('payerEmail') ? hash['payerEmail'] : SKIP
408
+ payer_phone = hash.key?('payerPhone') ? hash['payerPhone'] : SKIP
409
+ ip_country = hash.key?('ipCountry') ? hash['ipCountry'] : SKIP
410
+ ip_city = hash.key?('ipCity') ? hash['ipCity'] : SKIP
411
+ ip_latitude = hash.key?('ipLatitude') ? hash['ipLatitude'] : SKIP
412
+ ip_longitude = hash.key?('ipLongitude') ? hash['ipLongitude'] : SKIP
413
+ merchant_custom_data =
414
+ hash.key?('merchantCustomData') ? hash['merchantCustomData'] : SKIP
415
+ description = hash.key?('description') ? hash['description'] : SKIP
416
+ parent_transaction_id =
417
+ hash.key?('parentTransactionId') ? hash['parentTransactionId'] : SKIP
418
+
419
+ # Create a new hash for additional properties, removing known properties.
420
+ new_hash = hash.reject { |k, _| names.value?(k) }
421
+
422
+ additional_properties = APIHelper.get_additional_properties(
423
+ new_hash, proc { |value| value }
424
+ )
425
+
426
+ # Create object from extracted values.
427
+ EcommerceTransaction.new(id: id,
428
+ merchant_id: merchant_id,
429
+ merchant_name: merchant_name,
430
+ merchant_reference: merchant_reference,
431
+ amount: amount,
432
+ currency: currency,
433
+ created_date: created_date,
434
+ auth_date: auth_date,
435
+ confirm_date: confirm_date,
436
+ processed_date: processed_date,
437
+ processed_amount: processed_amount,
438
+ type: type,
439
+ status: status,
440
+ payment_method: payment_method,
441
+ card_type: card_type,
442
+ card_scheme: card_scheme,
443
+ card_mask: card_mask,
444
+ issuer: issuer,
445
+ issuer_country: issuer_country,
446
+ response_code: response_code,
447
+ auth_code: auth_code,
448
+ avs_result: avs_result,
449
+ avs_house_number_result: avs_house_number_result,
450
+ avs_postcode_result: avs_postcode_result,
451
+ csc_result: csc_result,
452
+ payer_authentication_result: payer_authentication_result,
453
+ payer_ip: payer_ip,
454
+ payer_name: payer_name,
455
+ payer_email: payer_email,
456
+ payer_phone: payer_phone,
457
+ ip_country: ip_country,
458
+ ip_city: ip_city,
459
+ ip_latitude: ip_latitude,
460
+ ip_longitude: ip_longitude,
461
+ merchant_custom_data: merchant_custom_data,
462
+ description: description,
463
+ parent_transaction_id: parent_transaction_id,
464
+ additional_properties: additional_properties)
465
+ end
466
+
467
+ def to_custom_created_date
468
+ DateTimeHelper.to_rfc3339(created_date)
469
+ end
470
+
471
+ def to_custom_auth_date
472
+ DateTimeHelper.to_rfc3339(auth_date)
473
+ end
474
+
475
+ def to_custom_confirm_date
476
+ DateTimeHelper.to_rfc3339(confirm_date)
477
+ end
478
+
479
+ def to_custom_processed_date
480
+ DateTimeHelper.to_rfc3339(processed_date)
481
+ end
482
+
483
+ # Provides a human-readable string representation of the object.
484
+ def to_s
485
+ class_name = self.class.name.split('::').last
486
+ "<#{class_name} id: #{@id}, merchant_id: #{@merchant_id}, merchant_name: #{@merchant_name},"\
487
+ " merchant_reference: #{@merchant_reference}, amount: #{@amount}, currency: #{@currency},"\
488
+ " created_date: #{@created_date}, auth_date: #{@auth_date}, confirm_date: #{@confirm_date},"\
489
+ " processed_date: #{@processed_date}, processed_amount: #{@processed_amount}, type:"\
490
+ " #{@type}, status: #{@status}, payment_method: #{@payment_method}, card_type:"\
491
+ " #{@card_type}, card_scheme: #{@card_scheme}, card_mask: #{@card_mask}, issuer: #{@issuer},"\
492
+ " issuer_country: #{@issuer_country}, response_code: #{@response_code}, auth_code:"\
493
+ " #{@auth_code}, avs_result: #{@avs_result}, avs_house_number_result:"\
494
+ " #{@avs_house_number_result}, avs_postcode_result: #{@avs_postcode_result}, csc_result:"\
495
+ " #{@csc_result}, payer_authentication_result: #{@payer_authentication_result}, payer_ip:"\
496
+ " #{@payer_ip}, payer_name: #{@payer_name}, payer_email: #{@payer_email}, payer_phone:"\
497
+ " #{@payer_phone}, ip_country: #{@ip_country}, ip_city: #{@ip_city}, ip_latitude:"\
498
+ " #{@ip_latitude}, ip_longitude: #{@ip_longitude}, merchant_custom_data:"\
499
+ " #{@merchant_custom_data}, description: #{@description}, parent_transaction_id:"\
500
+ " #{@parent_transaction_id}, additional_properties: #{@additional_properties}>"
501
+ end
502
+
503
+ # Provides a debugging-friendly string with detailed object information.
504
+ def inspect
505
+ class_name = self.class.name.split('::').last
506
+ "<#{class_name} id: #{@id.inspect}, merchant_id: #{@merchant_id.inspect}, merchant_name:"\
507
+ " #{@merchant_name.inspect}, merchant_reference: #{@merchant_reference.inspect}, amount:"\
508
+ " #{@amount.inspect}, currency: #{@currency.inspect}, created_date:"\
509
+ " #{@created_date.inspect}, auth_date: #{@auth_date.inspect}, confirm_date:"\
510
+ " #{@confirm_date.inspect}, processed_date: #{@processed_date.inspect}, processed_amount:"\
511
+ " #{@processed_amount.inspect}, type: #{@type.inspect}, status: #{@status.inspect},"\
512
+ " payment_method: #{@payment_method.inspect}, card_type: #{@card_type.inspect}, card_scheme:"\
513
+ " #{@card_scheme.inspect}, card_mask: #{@card_mask.inspect}, issuer: #{@issuer.inspect},"\
514
+ " issuer_country: #{@issuer_country.inspect}, response_code: #{@response_code.inspect},"\
515
+ " auth_code: #{@auth_code.inspect}, avs_result: #{@avs_result.inspect},"\
516
+ " avs_house_number_result: #{@avs_house_number_result.inspect}, avs_postcode_result:"\
517
+ " #{@avs_postcode_result.inspect}, csc_result: #{@csc_result.inspect},"\
518
+ " payer_authentication_result: #{@payer_authentication_result.inspect}, payer_ip:"\
519
+ " #{@payer_ip.inspect}, payer_name: #{@payer_name.inspect}, payer_email:"\
520
+ " #{@payer_email.inspect}, payer_phone: #{@payer_phone.inspect}, ip_country:"\
521
+ " #{@ip_country.inspect}, ip_city: #{@ip_city.inspect}, ip_latitude:"\
522
+ " #{@ip_latitude.inspect}, ip_longitude: #{@ip_longitude.inspect}, merchant_custom_data:"\
523
+ " #{@merchant_custom_data.inspect}, description: #{@description.inspect},"\
524
+ " parent_transaction_id: #{@parent_transaction_id.inspect}, additional_properties:"\
525
+ " #{@additional_properties}>"
526
+ end
527
+ end
528
+ end
@@ -0,0 +1,94 @@
1
+ # dna_payments_partner_reporting_settlement_ap_is
2
+ #
3
+ # This file was
4
+ # automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module DnaPaymentsPartnerReportingSettlementApIs
7
+ # EcommerceTransactionsResponse Model.
8
+ class EcommerceTransactionsResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # Total count of records for the requested time period.
13
+ # @return [Integer]
14
+ attr_accessor :total_count
15
+
16
+ # Total count of records for the requested time period.
17
+ # @return [Array[EcommerceTransaction]]
18
+ attr_accessor :data
19
+
20
+ # A mapping from model property names to API property names.
21
+ def self.names
22
+ @_hash = {} if @_hash.nil?
23
+ @_hash['total_count'] = 'totalCount'
24
+ @_hash['data'] = 'data'
25
+ @_hash
26
+ end
27
+
28
+ # An array for optional fields
29
+ def self.optionals
30
+ %w[
31
+ total_count
32
+ data
33
+ ]
34
+ end
35
+
36
+ # An array for nullable fields
37
+ def self.nullables
38
+ []
39
+ end
40
+
41
+ def initialize(total_count: SKIP, data: SKIP, additional_properties: nil)
42
+ # Add additional model properties to the instance
43
+ additional_properties = {} if additional_properties.nil?
44
+
45
+ @total_count = total_count unless total_count == SKIP
46
+ @data = data unless data == SKIP
47
+ @additional_properties = additional_properties
48
+ end
49
+
50
+ # Creates an instance of the object from a hash.
51
+ def self.from_hash(hash)
52
+ return nil unless hash
53
+
54
+ # Extract variables from the hash.
55
+ total_count = hash.key?('totalCount') ? hash['totalCount'] : SKIP
56
+ # Parameter is an array, so we need to iterate through it
57
+ data = nil
58
+ unless hash['data'].nil?
59
+ data = []
60
+ hash['data'].each do |structure|
61
+ data << (EcommerceTransaction.from_hash(structure) if structure)
62
+ end
63
+ end
64
+
65
+ data = SKIP unless hash.key?('data')
66
+
67
+ # Create a new hash for additional properties, removing known properties.
68
+ new_hash = hash.reject { |k, _| names.value?(k) }
69
+
70
+ additional_properties = APIHelper.get_additional_properties(
71
+ new_hash, proc { |value| value }
72
+ )
73
+
74
+ # Create object from extracted values.
75
+ EcommerceTransactionsResponse.new(total_count: total_count,
76
+ data: data,
77
+ additional_properties: additional_properties)
78
+ end
79
+
80
+ # Provides a human-readable string representation of the object.
81
+ def to_s
82
+ class_name = self.class.name.split('::').last
83
+ "<#{class_name} total_count: #{@total_count}, data: #{@data}, additional_properties:"\
84
+ " #{@additional_properties}>"
85
+ end
86
+
87
+ # Provides a debugging-friendly string with detailed object information.
88
+ def inspect
89
+ class_name = self.class.name.split('::').last
90
+ "<#{class_name} total_count: #{@total_count.inspect}, data: #{@data.inspect},"\
91
+ " additional_properties: #{@additional_properties}>"
92
+ end
93
+ end
94
+ end
@@ -0,0 +1,26 @@
1
+ # dna_payments_partner_reporting_settlement_ap_is
2
+ #
3
+ # This file was
4
+ # automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
5
+
6
+ module DnaPaymentsPartnerReportingSettlementApIs
7
+ # Authorisation type required to confirm the action required.
8
+ class GrantType
9
+ GRANT_TYPE = [
10
+ # TODO: Write general description for CLIENT_CREDENTIALS
11
+ CLIENT_CREDENTIALS = 'client_credentials'.freeze
12
+ ].freeze
13
+
14
+ def self.validate(value)
15
+ return false if value.nil?
16
+
17
+ GRANT_TYPE.include?(value)
18
+ end
19
+
20
+ def self.from_value(value, default_value = CLIENT_CREDENTIALS)
21
+ return default_value if value.nil?
22
+
23
+ default_value
24
+ end
25
+ end
26
+ end