apimatic-gp-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 (97) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +155 -0
  4. data/bin/console +15 -0
  5. data/lib/batches/api_helper.rb +10 -0
  6. data/lib/batches/apis/base_api.rb +67 -0
  7. data/lib/batches/apis/close_a_batch_api.rb +111 -0
  8. data/lib/batches/apis/get_a_batch_api.rb +70 -0
  9. data/lib/batches/apis/get_transactions_within_a_batch_api.rb +69 -0
  10. data/lib/batches/client.rb +72 -0
  11. data/lib/batches/configuration.rb +166 -0
  12. data/lib/batches/exceptions/api_exception.rb +21 -0
  13. data/lib/batches/exceptions/batches400_error_exception.rb +61 -0
  14. data/lib/batches/exceptions/batches401_error_exception.rb +61 -0
  15. data/lib/batches/exceptions/batches403_error_exception.rb +61 -0
  16. data/lib/batches/exceptions/batches500_error_exception.rb +61 -0
  17. data/lib/batches/exceptions/batches501_error_exception.rb +61 -0
  18. data/lib/batches/exceptions/batches502_error_exception.rb +62 -0
  19. data/lib/batches/exceptions/batches504_error_exception.rb +61 -0
  20. data/lib/batches/exceptions/batches_transactions400_error_exception.rb +61 -0
  21. data/lib/batches/exceptions/batches_transactions401_error_exception.rb +61 -0
  22. data/lib/batches/exceptions/batches_transactions403_error_exception.rb +61 -0
  23. data/lib/batches/exceptions/batches_transactions500_error_exception.rb +61 -0
  24. data/lib/batches/exceptions/batches_transactions501_error_exception.rb +61 -0
  25. data/lib/batches/exceptions/batches_transactions502_error_exception.rb +62 -0
  26. data/lib/batches/exceptions/batches_transactions504_error_exception.rb +61 -0
  27. data/lib/batches/http/api_response.rb +19 -0
  28. data/lib/batches/http/http_call_back.rb +10 -0
  29. data/lib/batches/http/http_method_enum.rb +10 -0
  30. data/lib/batches/http/http_request.rb +10 -0
  31. data/lib/batches/http/http_response.rb +10 -0
  32. data/lib/batches/http/proxy_settings.rb +22 -0
  33. data/lib/batches/logging/configuration/api_logging_configuration.rb +186 -0
  34. data/lib/batches/logging/sdk_logger.rb +17 -0
  35. data/lib/batches/models/action.rb +125 -0
  36. data/lib/batches/models/authentication_invalid401.rb +102 -0
  37. data/lib/batches/models/avs_address_result_batches_transactions_payment_method_card_avs_address_result.rb +40 -0
  38. data/lib/batches/models/avs_postal_code_result_batches_transactions_payment_method_card_avs_postal_code_result.rb +40 -0
  39. data/lib/batches/models/base_model.rb +110 -0
  40. data/lib/batches/models/batches_request.rb +142 -0
  41. data/lib/batches/models/brand_batches_brand_breakdown_brand.rb +56 -0
  42. data/lib/batches/models/brand_batches_transactions_payment_method_card_brand.rb +56 -0
  43. data/lib/batches/models/brand_breakdown_item.rb +159 -0
  44. data/lib/batches/models/card.rb +170 -0
  45. data/lib/batches/models/channel_batches_channel.rb +44 -0
  46. data/lib/batches/models/close_response.rb +356 -0
  47. data/lib/batches/models/currency_batches_transactions_currency.rb +60 -0
  48. data/lib/batches/models/cvv_result_batches_transactions_payment_method_card_cvv_result.rb +40 -0
  49. data/lib/batches/models/detailed_error_code.rb +26 -0
  50. data/lib/batches/models/detailed_error_code1.rb +36 -0
  51. data/lib/batches/models/detailed_error_code2.rb +36 -0
  52. data/lib/batches/models/detailed_error_code3.rb +26 -0
  53. data/lib/batches/models/detailed_error_code4.rb +26 -0
  54. data/lib/batches/models/detailed_error_code5.rb +26 -0
  55. data/lib/batches/models/detailed_error_code6.rb +26 -0
  56. data/lib/batches/models/entry_mode_batches_transactions_payment_method_entry_mode.rb +104 -0
  57. data/lib/batches/models/error_code.rb +52 -0
  58. data/lib/batches/models/error_code1.rb +26 -0
  59. data/lib/batches/models/error_code2.rb +26 -0
  60. data/lib/batches/models/error_code3.rb +26 -0
  61. data/lib/batches/models/error_code4.rb +26 -0
  62. data/lib/batches/models/error_code5.rb +27 -0
  63. data/lib/batches/models/error_code6.rb +26 -0
  64. data/lib/batches/models/filter.rb +76 -0
  65. data/lib/batches/models/funding_batches_transactions_payment_method_card_funding.rb +59 -0
  66. data/lib/batches/models/funding_credit.rb +85 -0
  67. data/lib/batches/models/funding_credit1.rb +85 -0
  68. data/lib/batches/models/funding_credit5.rb +85 -0
  69. data/lib/batches/models/funding_debit.rb +85 -0
  70. data/lib/batches/models/funding_debit1.rb +85 -0
  71. data/lib/batches/models/funding_debit5.rb +85 -0
  72. data/lib/batches/models/get_response.rb +331 -0
  73. data/lib/batches/models/host_breakdown_item.rb +128 -0
  74. data/lib/batches/models/not_authorized403.rb +102 -0
  75. data/lib/batches/models/obj_request_invalid400.rb +102 -0
  76. data/lib/batches/models/payment_method.rb +167 -0
  77. data/lib/batches/models/payment_method2.rb +52 -0
  78. data/lib/batches/models/payment_methods_batches_payment_method.rb +52 -0
  79. data/lib/batches/models/refunds.rb +85 -0
  80. data/lib/batches/models/refunds1.rb +85 -0
  81. data/lib/batches/models/result_code_batches_action_result_code.rb +26 -0
  82. data/lib/batches/models/sales.rb +85 -0
  83. data/lib/batches/models/sales1.rb +85 -0
  84. data/lib/batches/models/server_error500.rb +102 -0
  85. data/lib/batches/models/server_timeout504.rb +102 -0
  86. data/lib/batches/models/status_batches_status.rb +38 -0
  87. data/lib/batches/models/status_batches_transactions_status.rb +39 -0
  88. data/lib/batches/models/transaction.rb +205 -0
  89. data/lib/batches/models/transaction_batch_response.rb +198 -0
  90. data/lib/batches/models/type_batches_action_type.rb +40 -0
  91. data/lib/batches/models/type_batches_transactions_type.rb +40 -0
  92. data/lib/batches/models/unknown_platform_error502.rb +103 -0
  93. data/lib/batches/models/unknown_server_error501.rb +102 -0
  94. data/lib/batches/utilities/date_time_helper.rb +11 -0
  95. data/lib/batches/utilities/file_wrapper.rb +28 -0
  96. data/lib/batches.rb +128 -0
  97. metadata +180 -0
@@ -0,0 +1,356 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # CloseResponse Model.
8
+ class CloseResponse < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # A unique identifier for the object created by Global Payments. The first 3
13
+ # characters identifies the resource an id relates to.
14
+ # @return [String]
15
+ attr_accessor :id
16
+
17
+ # Indicates where a batch is in its life cycle. *`OPEN` - Batch is open and
18
+ # can accept more transactions.
19
+ # *`CLOSED` - Batch is closed and cannot accept more transactions.
20
+ # @return [StatusBatchesStatus]
21
+ attr_accessor :status
22
+
23
+ # Time indicating when the batch was created in ISO-8601 format..
24
+ # @return [String]
25
+ attr_accessor :time_created
26
+
27
+ # Global Payments time indicating when the batch was last updated in
28
+ # ISO-8601 format..
29
+ # @return [String]
30
+ attr_accessor :time_last_updated
31
+
32
+ # Time indicating when the batch was closed
33
+ # @return [String]
34
+ attr_accessor :time_closed
35
+
36
+ # An identifier generated by Global Payments to uniquely identify the action
37
+ # that opened the batch.
38
+ # @return [String]
39
+ attr_accessor :open_action_id
40
+
41
+ # An identifier generated by Global Payments to uniquely identify the action
42
+ # that closed the batch.
43
+ # @return [String]
44
+ attr_accessor :close_action_id
45
+
46
+ # A unique identifier that is used to identify and reference an instance of
47
+ # this resource. This id is used when actioning or referencing a specific
48
+ # merchant. Begins with the three letters, MER.
49
+ # @return [String]
50
+ attr_accessor :merchant_id
51
+
52
+ # A meaningful label that better identifies the merchant.
53
+ # @return [String]
54
+ attr_accessor :merchant_name
55
+
56
+ # A unique identifier that is used to identify and reference an instance of
57
+ # this resource. This id is used when actioning or referencing a specific
58
+ # account. Begins with the three letters, TRA.
59
+ # @return [String]
60
+ attr_accessor :account_id
61
+
62
+ # A meaningful label that better identifies the account.
63
+ # @return [String]
64
+ attr_accessor :account_name
65
+
66
+ # A reference for the location that created the batch.
67
+ # @return [String]
68
+ attr_accessor :site_reference
69
+
70
+ # A reference for the device that created the batch
71
+ # @return [String]
72
+ attr_accessor :device_reference
73
+
74
+ # The number of transactions in the batch.
75
+ # @return [Float]
76
+ attr_accessor :transaction_count
77
+
78
+ # The batch amount that is an aggregation of all the transactions' amounts
79
+ # in the batch. It is always represented in the lowest denomination of the
80
+ # related currency.
81
+ # @return [String]
82
+ attr_accessor :amount
83
+
84
+ # The currency of the amount in ISO-4217(alpha-3)
85
+ # @return [String]
86
+ attr_accessor :currency
87
+
88
+ # The amount that is an aggregation of all the transactions' gratuity
89
+ # amounts in the batch. It is always represented in the lowest denomination
90
+ # of the related currency.
91
+ # @return [String]
92
+ attr_accessor :gratuity_amount
93
+
94
+ # The amount that is an aggregation of all the transactions' gratuity
95
+ # amounts in the batch. It is always represented in the lowest denomination
96
+ # of the related currency.
97
+ # @return [Sales]
98
+ attr_accessor :sales
99
+
100
+ # The amount that is an aggregation of all the transactions' gratuity
101
+ # amounts in the batch. It is always represented in the lowest denomination
102
+ # of the related currency.
103
+ # @return [Refunds]
104
+ attr_accessor :refunds
105
+
106
+ # The amount that is an aggregation of all the transactions' gratuity
107
+ # amounts in the batch. It is always represented in the lowest denomination
108
+ # of the related currency.
109
+ # @return [FundingDebit]
110
+ attr_accessor :funding_debit
111
+
112
+ # The amount that is an aggregation of all the transactions' gratuity
113
+ # amounts in the batch. It is always represented in the lowest denomination
114
+ # of the related currency.
115
+ # @return [FundingCredit]
116
+ attr_accessor :funding_credit
117
+
118
+ # The amount that is an aggregation of all the transactions' gratuity
119
+ # amounts in the batch. It is always represented in the lowest denomination
120
+ # of the related currency.
121
+ # @return [Array[BrandBreakdownItem]]
122
+ attr_accessor :brand_breakdown
123
+
124
+ # The amount that is an aggregation of all the transactions' gratuity
125
+ # amounts in the batch. It is always represented in the lowest denomination
126
+ # of the related currency.
127
+ # @return [HostBreakdownItem]
128
+ attr_accessor :host_breakdown
129
+
130
+ # The amount that is an aggregation of all the transactions' gratuity
131
+ # amounts in the batch. It is always represented in the lowest denomination
132
+ # of the related currency.
133
+ # @return [Action]
134
+ attr_accessor :action
135
+
136
+ # A mapping from model property names to API property names.
137
+ def self.names
138
+ @_hash = {} if @_hash.nil?
139
+ @_hash['id'] = 'id'
140
+ @_hash['status'] = 'status'
141
+ @_hash['time_created'] = 'time_created'
142
+ @_hash['time_last_updated'] = 'time_last_updated'
143
+ @_hash['time_closed'] = 'time_closed'
144
+ @_hash['open_action_id'] = 'open_action_id'
145
+ @_hash['close_action_id'] = 'close_action_id'
146
+ @_hash['merchant_id'] = 'merchant_id'
147
+ @_hash['merchant_name'] = 'merchant_name'
148
+ @_hash['account_id'] = 'account_id'
149
+ @_hash['account_name'] = 'account_name'
150
+ @_hash['site_reference'] = 'site_reference'
151
+ @_hash['device_reference'] = 'device_reference'
152
+ @_hash['transaction_count'] = 'transaction_count'
153
+ @_hash['amount'] = 'amount'
154
+ @_hash['currency'] = 'currency'
155
+ @_hash['gratuity_amount'] = 'gratuity_amount'
156
+ @_hash['sales'] = 'sales'
157
+ @_hash['refunds'] = 'refunds'
158
+ @_hash['funding_debit'] = 'funding_debit'
159
+ @_hash['funding_credit'] = 'funding_credit'
160
+ @_hash['brand_breakdown'] = 'brand_breakdown'
161
+ @_hash['host_breakdown'] = 'host_breakdown'
162
+ @_hash['action'] = 'action'
163
+ @_hash
164
+ end
165
+
166
+ # An array for optional fields
167
+ def self.optionals
168
+ %w[
169
+ id
170
+ status
171
+ time_created
172
+ time_last_updated
173
+ time_closed
174
+ open_action_id
175
+ close_action_id
176
+ merchant_id
177
+ merchant_name
178
+ account_id
179
+ account_name
180
+ site_reference
181
+ device_reference
182
+ transaction_count
183
+ amount
184
+ currency
185
+ gratuity_amount
186
+ sales
187
+ refunds
188
+ funding_debit
189
+ funding_credit
190
+ brand_breakdown
191
+ host_breakdown
192
+ action
193
+ ]
194
+ end
195
+
196
+ # An array for nullable fields
197
+ def self.nullables
198
+ []
199
+ end
200
+
201
+ def initialize(id: SKIP, status: SKIP, time_created: SKIP,
202
+ time_last_updated: SKIP, time_closed: SKIP,
203
+ open_action_id: SKIP, close_action_id: SKIP,
204
+ merchant_id: SKIP, merchant_name: SKIP, account_id: SKIP,
205
+ account_name: SKIP, site_reference: SKIP,
206
+ device_reference: SKIP, transaction_count: SKIP,
207
+ amount: SKIP, currency: SKIP, gratuity_amount: SKIP,
208
+ sales: SKIP, refunds: SKIP, funding_debit: SKIP,
209
+ funding_credit: SKIP, brand_breakdown: SKIP,
210
+ host_breakdown: SKIP, action: SKIP,
211
+ additional_properties: nil)
212
+ # Add additional model properties to the instance
213
+ additional_properties = {} if additional_properties.nil?
214
+
215
+ @id = id unless id == SKIP
216
+ @status = status unless status == SKIP
217
+ @time_created = time_created unless time_created == SKIP
218
+ @time_last_updated = time_last_updated unless time_last_updated == SKIP
219
+ @time_closed = time_closed unless time_closed == SKIP
220
+ @open_action_id = open_action_id unless open_action_id == SKIP
221
+ @close_action_id = close_action_id unless close_action_id == SKIP
222
+ @merchant_id = merchant_id unless merchant_id == SKIP
223
+ @merchant_name = merchant_name unless merchant_name == SKIP
224
+ @account_id = account_id unless account_id == SKIP
225
+ @account_name = account_name unless account_name == SKIP
226
+ @site_reference = site_reference unless site_reference == SKIP
227
+ @device_reference = device_reference unless device_reference == SKIP
228
+ @transaction_count = transaction_count unless transaction_count == SKIP
229
+ @amount = amount unless amount == SKIP
230
+ @currency = currency unless currency == SKIP
231
+ @gratuity_amount = gratuity_amount unless gratuity_amount == SKIP
232
+ @sales = sales unless sales == SKIP
233
+ @refunds = refunds unless refunds == SKIP
234
+ @funding_debit = funding_debit unless funding_debit == SKIP
235
+ @funding_credit = funding_credit unless funding_credit == SKIP
236
+ @brand_breakdown = brand_breakdown unless brand_breakdown == SKIP
237
+ @host_breakdown = host_breakdown unless host_breakdown == SKIP
238
+ @action = action unless action == SKIP
239
+ @additional_properties = additional_properties
240
+ end
241
+
242
+ # Creates an instance of the object from a hash.
243
+ def self.from_hash(hash)
244
+ return nil unless hash
245
+
246
+ # Extract variables from the hash.
247
+ id = hash.key?('id') ? hash['id'] : SKIP
248
+ status = hash.key?('status') ? hash['status'] : SKIP
249
+ time_created = hash.key?('time_created') ? hash['time_created'] : SKIP
250
+ time_last_updated =
251
+ hash.key?('time_last_updated') ? hash['time_last_updated'] : SKIP
252
+ time_closed = hash.key?('time_closed') ? hash['time_closed'] : SKIP
253
+ open_action_id =
254
+ hash.key?('open_action_id') ? hash['open_action_id'] : SKIP
255
+ close_action_id =
256
+ hash.key?('close_action_id') ? hash['close_action_id'] : SKIP
257
+ merchant_id = hash.key?('merchant_id') ? hash['merchant_id'] : SKIP
258
+ merchant_name = hash.key?('merchant_name') ? hash['merchant_name'] : SKIP
259
+ account_id = hash.key?('account_id') ? hash['account_id'] : SKIP
260
+ account_name = hash.key?('account_name') ? hash['account_name'] : SKIP
261
+ site_reference =
262
+ hash.key?('site_reference') ? hash['site_reference'] : SKIP
263
+ device_reference =
264
+ hash.key?('device_reference') ? hash['device_reference'] : SKIP
265
+ transaction_count =
266
+ hash.key?('transaction_count') ? hash['transaction_count'] : SKIP
267
+ amount = hash.key?('amount') ? hash['amount'] : SKIP
268
+ currency = hash.key?('currency') ? hash['currency'] : SKIP
269
+ gratuity_amount =
270
+ hash.key?('gratuity_amount') ? hash['gratuity_amount'] : SKIP
271
+ sales = Sales.from_hash(hash['sales']) if hash['sales']
272
+ refunds = Refunds.from_hash(hash['refunds']) if hash['refunds']
273
+ funding_debit = FundingDebit.from_hash(hash['funding_debit']) if hash['funding_debit']
274
+ funding_credit = FundingCredit.from_hash(hash['funding_credit']) if hash['funding_credit']
275
+ # Parameter is an array, so we need to iterate through it
276
+ brand_breakdown = nil
277
+ unless hash['brand_breakdown'].nil?
278
+ brand_breakdown = []
279
+ hash['brand_breakdown'].each do |structure|
280
+ brand_breakdown << (BrandBreakdownItem.from_hash(structure) if structure)
281
+ end
282
+ end
283
+
284
+ brand_breakdown = SKIP unless hash.key?('brand_breakdown')
285
+ host_breakdown = HostBreakdownItem.from_hash(hash['host_breakdown']) if
286
+ hash['host_breakdown']
287
+ action = Action.from_hash(hash['action']) if hash['action']
288
+
289
+ # Create a new hash for additional properties, removing known properties.
290
+ new_hash = hash.reject { |k, _| names.value?(k) }
291
+
292
+ additional_properties = APIHelper.get_additional_properties(
293
+ new_hash, proc { |value| value }
294
+ )
295
+
296
+ # Create object from extracted values.
297
+ CloseResponse.new(id: id,
298
+ status: status,
299
+ time_created: time_created,
300
+ time_last_updated: time_last_updated,
301
+ time_closed: time_closed,
302
+ open_action_id: open_action_id,
303
+ close_action_id: close_action_id,
304
+ merchant_id: merchant_id,
305
+ merchant_name: merchant_name,
306
+ account_id: account_id,
307
+ account_name: account_name,
308
+ site_reference: site_reference,
309
+ device_reference: device_reference,
310
+ transaction_count: transaction_count,
311
+ amount: amount,
312
+ currency: currency,
313
+ gratuity_amount: gratuity_amount,
314
+ sales: sales,
315
+ refunds: refunds,
316
+ funding_debit: funding_debit,
317
+ funding_credit: funding_credit,
318
+ brand_breakdown: brand_breakdown,
319
+ host_breakdown: host_breakdown,
320
+ action: action,
321
+ additional_properties: additional_properties)
322
+ end
323
+
324
+ # Provides a human-readable string representation of the object.
325
+ def to_s
326
+ class_name = self.class.name.split('::').last
327
+ "<#{class_name} id: #{@id}, status: #{@status}, time_created: #{@time_created},"\
328
+ " time_last_updated: #{@time_last_updated}, time_closed: #{@time_closed}, open_action_id:"\
329
+ " #{@open_action_id}, close_action_id: #{@close_action_id}, merchant_id: #{@merchant_id},"\
330
+ " merchant_name: #{@merchant_name}, account_id: #{@account_id}, account_name:"\
331
+ " #{@account_name}, site_reference: #{@site_reference}, device_reference:"\
332
+ " #{@device_reference}, transaction_count: #{@transaction_count}, amount: #{@amount},"\
333
+ " currency: #{@currency}, gratuity_amount: #{@gratuity_amount}, sales: #{@sales}, refunds:"\
334
+ " #{@refunds}, funding_debit: #{@funding_debit}, funding_credit: #{@funding_credit},"\
335
+ " brand_breakdown: #{@brand_breakdown}, host_breakdown: #{@host_breakdown}, action:"\
336
+ " #{@action}, additional_properties: #{@additional_properties}>"
337
+ end
338
+
339
+ # Provides a debugging-friendly string with detailed object information.
340
+ def inspect
341
+ class_name = self.class.name.split('::').last
342
+ "<#{class_name} id: #{@id.inspect}, status: #{@status.inspect}, time_created:"\
343
+ " #{@time_created.inspect}, time_last_updated: #{@time_last_updated.inspect}, time_closed:"\
344
+ " #{@time_closed.inspect}, open_action_id: #{@open_action_id.inspect}, close_action_id:"\
345
+ " #{@close_action_id.inspect}, merchant_id: #{@merchant_id.inspect}, merchant_name:"\
346
+ " #{@merchant_name.inspect}, account_id: #{@account_id.inspect}, account_name:"\
347
+ " #{@account_name.inspect}, site_reference: #{@site_reference.inspect}, device_reference:"\
348
+ " #{@device_reference.inspect}, transaction_count: #{@transaction_count.inspect}, amount:"\
349
+ " #{@amount.inspect}, currency: #{@currency.inspect}, gratuity_amount:"\
350
+ " #{@gratuity_amount.inspect}, sales: #{@sales.inspect}, refunds: #{@refunds.inspect},"\
351
+ " funding_debit: #{@funding_debit.inspect}, funding_credit: #{@funding_credit.inspect},"\
352
+ " brand_breakdown: #{@brand_breakdown.inspect}, host_breakdown: #{@host_breakdown.inspect},"\
353
+ " action: #{@action.inspect}, additional_properties: #{@additional_properties}>"
354
+ end
355
+ end
356
+ end
@@ -0,0 +1,60 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # The currency of the amount in ISO-4217(alpha-3).
8
+ class CurrencyBatchesTransactionsCurrency
9
+ CURRENCY_BATCHES_TRANSACTIONS_CURRENCY = [
10
+ # TODO: Write general description for USD
11
+ USD = 'USD'.freeze,
12
+
13
+ # TODO: Write general description for EUR
14
+ EUR = 'EUR'.freeze,
15
+
16
+ # TODO: Write general description for GBP
17
+ GBP = 'GBP'.freeze,
18
+
19
+ # TODO: Write general description for CAD
20
+ CAD = 'CAD'.freeze,
21
+
22
+ # TODO: Write general description for CHF
23
+ CHF = 'CHF'.freeze,
24
+
25
+ # TODO: Write general description for HKD
26
+ HKD = 'HKD'.freeze,
27
+
28
+ # TODO: Write general description for SGD
29
+ SGD = 'SGD'.freeze,
30
+
31
+ # TODO: Write general description for ENUM_MOP_ETC
32
+ ENUM_MOP_ETC = 'MOP etc.'.freeze
33
+ ].freeze
34
+
35
+ def self.validate(value)
36
+ return false if value.nil?
37
+
38
+ CURRENCY_BATCHES_TRANSACTIONS_CURRENCY.include?(value)
39
+ end
40
+
41
+ def self.from_value(value, default_value = USD)
42
+ return default_value if value.nil?
43
+
44
+ str = value.to_s.strip
45
+
46
+ case str.downcase
47
+ when 'usd' then USD
48
+ when 'eur' then EUR
49
+ when 'gbp' then GBP
50
+ when 'cad' then CAD
51
+ when 'chf' then CHF
52
+ when 'hkd' then HKD
53
+ when 'sgd' then SGD
54
+ when 'enum_mop_etc' then ENUM_MOP_ETC
55
+ else
56
+ default_value
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,40 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # The result of the CVV check.
8
+ class CvvResultBatchesTransactionsPaymentMethodCardCvvResult
9
+ CVV_RESULT_BATCHES_TRANSACTIONS_PAYMENT_METHOD_CARD_CVV_RESULT = [
10
+ # TODO: Write general description for MATCHED
11
+ MATCHED = 'MATCHED'.freeze,
12
+
13
+ # TODO: Write general description for NOT_MATCHED
14
+ NOT_MATCHED = 'NOT_MATCHED'.freeze,
15
+
16
+ # TODO: Write general description for NOT_CHECKED
17
+ NOT_CHECKED = 'NOT_CHECKED'.freeze
18
+ ].freeze
19
+
20
+ def self.validate(value)
21
+ return false if value.nil?
22
+
23
+ CVV_RESULT_BATCHES_TRANSACTIONS_PAYMENT_METHOD_CARD_CVV_RESULT.include?(value)
24
+ end
25
+
26
+ def self.from_value(value, default_value = MATCHED)
27
+ return default_value if value.nil?
28
+
29
+ str = value.to_s.strip
30
+
31
+ case str.downcase
32
+ when 'matched' then MATCHED
33
+ when 'not_matched' then NOT_MATCHED
34
+ when 'not_checked' then NOT_CHECKED
35
+ else
36
+ default_value
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,26 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # Unique reference to identify the error.
8
+ class DetailedErrorCode
9
+ DETAILED_ERROR_CODE = [
10
+ # TODO: Write general description for ENUM_40016
11
+ ENUM_40016 = '40016'.freeze
12
+ ].freeze
13
+
14
+ def self.validate(value)
15
+ return false if value.nil?
16
+
17
+ DETAILED_ERROR_CODE.include?(value)
18
+ end
19
+
20
+ def self.from_value(value, default_value = ENUM_40016)
21
+ return default_value if value.nil?
22
+
23
+ default_value
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,36 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # Unique reference to identify the error.
8
+ class DetailedErrorCode1
9
+ DETAILED_ERROR_CODE1 = [
10
+ # TODO: Write general description for ENUM_40001
11
+ ENUM_40001 = '40001'.freeze,
12
+
13
+ # TODO: Write general description for ENUM_40002
14
+ ENUM_40002 = '40002'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ DETAILED_ERROR_CODE1.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = ENUM_40001)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'enum_40001' then ENUM_40001
30
+ when 'enum_40002' then ENUM_40002
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,36 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # Unique reference to identify the error.
8
+ class DetailedErrorCode2
9
+ DETAILED_ERROR_CODE2 = [
10
+ # TODO: Write general description for ENUM_40003
11
+ ENUM_40003 = '40003'.freeze,
12
+
13
+ # TODO: Write general description for ENUM_40004
14
+ ENUM_40004 = '40004'.freeze
15
+ ].freeze
16
+
17
+ def self.validate(value)
18
+ return false if value.nil?
19
+
20
+ DETAILED_ERROR_CODE2.include?(value)
21
+ end
22
+
23
+ def self.from_value(value, default_value = ENUM_40003)
24
+ return default_value if value.nil?
25
+
26
+ str = value.to_s.strip
27
+
28
+ case str.downcase
29
+ when 'enum_40003' then ENUM_40003
30
+ when 'enum_40004' then ENUM_40004
31
+ else
32
+ default_value
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,26 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # Unique reference to identify the error.
8
+ class DetailedErrorCode3
9
+ DETAILED_ERROR_CODE3 = [
10
+ # TODO: Write general description for ENUM_50011
11
+ ENUM_50011 = '50011'.freeze
12
+ ].freeze
13
+
14
+ def self.validate(value)
15
+ return false if value.nil?
16
+
17
+ DETAILED_ERROR_CODE3.include?(value)
18
+ end
19
+
20
+ def self.from_value(value, default_value = ENUM_50011)
21
+ return default_value if value.nil?
22
+
23
+ default_value
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # Unique reference to identify the error.
8
+ class DetailedErrorCode4
9
+ DETAILED_ERROR_CODE4 = [
10
+ # TODO: Write general description for ENUM_50012
11
+ ENUM_50012 = '50012'.freeze
12
+ ].freeze
13
+
14
+ def self.validate(value)
15
+ return false if value.nil?
16
+
17
+ DETAILED_ERROR_CODE4.include?(value)
18
+ end
19
+
20
+ def self.from_value(value, default_value = ENUM_50012)
21
+ return default_value if value.nil?
22
+
23
+ default_value
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # Unique reference to identify the error.
8
+ class DetailedErrorCode5
9
+ DETAILED_ERROR_CODE5 = [
10
+ # TODO: Write general description for ENUM_50002
11
+ ENUM_50002 = '50002'.freeze
12
+ ].freeze
13
+
14
+ def self.validate(value)
15
+ return false if value.nil?
16
+
17
+ DETAILED_ERROR_CODE5.include?(value)
18
+ end
19
+
20
+ def self.from_value(value, default_value = ENUM_50002)
21
+ return default_value if value.nil?
22
+
23
+ default_value
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # batches
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Batches
7
+ # Unique reference to identify the error.
8
+ class DetailedErrorCode6
9
+ DETAILED_ERROR_CODE6 = [
10
+ # TODO: Write general description for ENUM_50008
11
+ ENUM_50008 = '50008'.freeze
12
+ ].freeze
13
+
14
+ def self.validate(value)
15
+ return false if value.nil?
16
+
17
+ DETAILED_ERROR_CODE6.include?(value)
18
+ end
19
+
20
+ def self.from_value(value, default_value = ENUM_50008)
21
+ return default_value if value.nil?
22
+
23
+ default_value
24
+ end
25
+ end
26
+ end