maytes-api-client-rb 0.1.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 (163) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +47 -0
  5. data/Rakefile +10 -0
  6. data/docs/CancelCheckout409Response.md +24 -0
  7. data/docs/CancelCheckoutRequest.md +18 -0
  8. data/docs/CancelCheckoutResponse.md +18 -0
  9. data/docs/CaptureCheckout409Response.md +24 -0
  10. data/docs/CaptureCheckout422Response.md +24 -0
  11. data/docs/CaptureCheckoutRequest.md +24 -0
  12. data/docs/CaptureCheckoutResponse.md +18 -0
  13. data/docs/Checkout.md +48 -0
  14. data/docs/CheckoutCancelled.md +22 -0
  15. data/docs/CheckoutCaptured.md +28 -0
  16. data/docs/CheckoutCreated.md +24 -0
  17. data/docs/CheckoutDiscount.md +30 -0
  18. data/docs/CheckoutFee.md +32 -0
  19. data/docs/CreateCheckout401Response.md +24 -0
  20. data/docs/CreateCheckout409Response.md +24 -0
  21. data/docs/CreateCheckout422Response.md +24 -0
  22. data/docs/CreateCheckoutRequest.md +44 -0
  23. data/docs/CreateCheckoutResponse.md +18 -0
  24. data/docs/CreateRefundRequest.md +20 -0
  25. data/docs/CustomerData.md +22 -0
  26. data/docs/DefaultApi.md +633 -0
  27. data/docs/DigitalGoodsCustomData.md +18 -0
  28. data/docs/DigitalGoodsLineItem.md +38 -0
  29. data/docs/DonationLineItem.md +36 -0
  30. data/docs/ErrorResponseDto.md +24 -0
  31. data/docs/Fee.md +24 -0
  32. data/docs/FeeBreakdownLine.md +24 -0
  33. data/docs/FoodBeverageLineItem.md +36 -0
  34. data/docs/GetCheckout404Response.md +24 -0
  35. data/docs/GetCheckout422Response.md +24 -0
  36. data/docs/GetCheckoutResponse.md +18 -0
  37. data/docs/GetSettlementResponse.md +18 -0
  38. data/docs/HealthResponse.md +18 -0
  39. data/docs/LineItem.md +94 -0
  40. data/docs/ListSettlementsResponse.md +18 -0
  41. data/docs/OAuthTokenRequest.md +30 -0
  42. data/docs/OAuthTokenResponse.md +26 -0
  43. data/docs/OtherLineItem.md +36 -0
  44. data/docs/PhysicalGoodsCustomData.md +20 -0
  45. data/docs/PhysicalGoodsLineItem.md +38 -0
  46. data/docs/RefundCheckout402Response.md +24 -0
  47. data/docs/RefundCheckout409Response.md +24 -0
  48. data/docs/ServiceCustomData.md +18 -0
  49. data/docs/ServiceLineItem.md +38 -0
  50. data/docs/Settlement.md +52 -0
  51. data/docs/Tax.md +22 -0
  52. data/docs/TicketCustomData.md +40 -0
  53. data/docs/TicketLineItem.md +38 -0
  54. data/docs/TicketSeating.md +24 -0
  55. data/lib/maytes_api_client/api/default_api.rb +642 -0
  56. data/lib/maytes_api_client/api_client.rb +397 -0
  57. data/lib/maytes_api_client/api_error.rb +58 -0
  58. data/lib/maytes_api_client/api_model_base.rb +88 -0
  59. data/lib/maytes_api_client/configuration.rb +316 -0
  60. data/lib/maytes_api_client/managed_client.rb +140 -0
  61. data/lib/maytes_api_client/models/cancel_checkout409_response.rb +258 -0
  62. data/lib/maytes_api_client/models/cancel_checkout_request.rb +147 -0
  63. data/lib/maytes_api_client/models/cancel_checkout_response.rb +164 -0
  64. data/lib/maytes_api_client/models/capture_checkout409_response.rb +258 -0
  65. data/lib/maytes_api_client/models/capture_checkout422_response.rb +258 -0
  66. data/lib/maytes_api_client/models/capture_checkout_request.rb +218 -0
  67. data/lib/maytes_api_client/models/capture_checkout_response.rb +164 -0
  68. data/lib/maytes_api_client/models/checkout.rb +483 -0
  69. data/lib/maytes_api_client/models/checkout_cancelled.rb +202 -0
  70. data/lib/maytes_api_client/models/checkout_captured.rb +266 -0
  71. data/lib/maytes_api_client/models/checkout_created.rb +242 -0
  72. data/lib/maytes_api_client/models/checkout_discount.rb +329 -0
  73. data/lib/maytes_api_client/models/checkout_fee.rb +351 -0
  74. data/lib/maytes_api_client/models/create_checkout401_response.rb +258 -0
  75. data/lib/maytes_api_client/models/create_checkout409_response.rb +258 -0
  76. data/lib/maytes_api_client/models/create_checkout422_response.rb +258 -0
  77. data/lib/maytes_api_client/models/create_checkout_request.rb +444 -0
  78. data/lib/maytes_api_client/models/create_checkout_response.rb +164 -0
  79. data/lib/maytes_api_client/models/create_refund_request.rb +212 -0
  80. data/lib/maytes_api_client/models/customer_data.rb +168 -0
  81. data/lib/maytes_api_client/models/digital_goods_custom_data.rb +148 -0
  82. data/lib/maytes_api_client/models/digital_goods_line_item.rb +414 -0
  83. data/lib/maytes_api_client/models/donation_line_item.rb +405 -0
  84. data/lib/maytes_api_client/models/error_response_dto.rb +227 -0
  85. data/lib/maytes_api_client/models/fee.rb +271 -0
  86. data/lib/maytes_api_client/models/fee_breakdown_line.rb +266 -0
  87. data/lib/maytes_api_client/models/food_beverage_line_item.rb +405 -0
  88. data/lib/maytes_api_client/models/get_checkout404_response.rb +258 -0
  89. data/lib/maytes_api_client/models/get_checkout422_response.rb +258 -0
  90. data/lib/maytes_api_client/models/get_checkout_response.rb +164 -0
  91. data/lib/maytes_api_client/models/get_settlement_response.rb +164 -0
  92. data/lib/maytes_api_client/models/health_response.rb +164 -0
  93. data/lib/maytes_api_client/models/line_item.rb +65 -0
  94. data/lib/maytes_api_client/models/list_settlements_response.rb +166 -0
  95. data/lib/maytes_api_client/models/o_auth_token_request.rb +244 -0
  96. data/lib/maytes_api_client/models/o_auth_token_response.rb +251 -0
  97. data/lib/maytes_api_client/models/other_line_item.rb +405 -0
  98. data/lib/maytes_api_client/models/physical_goods_custom_data.rb +173 -0
  99. data/lib/maytes_api_client/models/physical_goods_line_item.rb +431 -0
  100. data/lib/maytes_api_client/models/refund_checkout402_response.rb +258 -0
  101. data/lib/maytes_api_client/models/refund_checkout409_response.rb +258 -0
  102. data/lib/maytes_api_client/models/service_custom_data.rb +148 -0
  103. data/lib/maytes_api_client/models/service_line_item.rb +414 -0
  104. data/lib/maytes_api_client/models/settlement.rb +526 -0
  105. data/lib/maytes_api_client/models/tax.rb +202 -0
  106. data/lib/maytes_api_client/models/ticket_custom_data.rb +333 -0
  107. data/lib/maytes_api_client/models/ticket_line_item.rb +431 -0
  108. data/lib/maytes_api_client/models/ticket_seating.rb +176 -0
  109. data/lib/maytes_api_client/version.rb +15 -0
  110. data/lib/maytes_api_client/webhook_verifier.rb +212 -0
  111. data/lib/maytes_api_client.rb +95 -0
  112. data/maytes_api_client.gemspec +39 -0
  113. data/spec/api/default_api_spec.rb +145 -0
  114. data/spec/models/cancel_checkout409_response_spec.rb +58 -0
  115. data/spec/models/cancel_checkout_request_spec.rb +36 -0
  116. data/spec/models/cancel_checkout_response_spec.rb +36 -0
  117. data/spec/models/capture_checkout409_response_spec.rb +58 -0
  118. data/spec/models/capture_checkout422_response_spec.rb +58 -0
  119. data/spec/models/capture_checkout_request_spec.rb +54 -0
  120. data/spec/models/capture_checkout_response_spec.rb +36 -0
  121. data/spec/models/checkout_cancelled_spec.rb +48 -0
  122. data/spec/models/checkout_captured_spec.rb +66 -0
  123. data/spec/models/checkout_created_spec.rb +54 -0
  124. data/spec/models/checkout_discount_spec.rb +76 -0
  125. data/spec/models/checkout_fee_spec.rb +86 -0
  126. data/spec/models/checkout_spec.rb +126 -0
  127. data/spec/models/create_checkout401_response_spec.rb +58 -0
  128. data/spec/models/create_checkout409_response_spec.rb +58 -0
  129. data/spec/models/create_checkout422_response_spec.rb +58 -0
  130. data/spec/models/create_checkout_request_spec.rb +118 -0
  131. data/spec/models/create_checkout_response_spec.rb +36 -0
  132. data/spec/models/create_refund_request_spec.rb +42 -0
  133. data/spec/models/customer_data_spec.rb +48 -0
  134. data/spec/models/digital_goods_custom_data_spec.rb +36 -0
  135. data/spec/models/digital_goods_line_item_spec.rb +100 -0
  136. data/spec/models/donation_line_item_spec.rb +94 -0
  137. data/spec/models/error_response_dto_spec.rb +54 -0
  138. data/spec/models/fee_breakdown_line_spec.rb +58 -0
  139. data/spec/models/fee_spec.rb +54 -0
  140. data/spec/models/food_beverage_line_item_spec.rb +94 -0
  141. data/spec/models/get_checkout404_response_spec.rb +58 -0
  142. data/spec/models/get_checkout422_response_spec.rb +58 -0
  143. data/spec/models/get_checkout_response_spec.rb +36 -0
  144. data/spec/models/get_settlement_response_spec.rb +36 -0
  145. data/spec/models/health_response_spec.rb +36 -0
  146. data/spec/models/line_item_spec.rb +44 -0
  147. data/spec/models/list_settlements_response_spec.rb +36 -0
  148. data/spec/models/o_auth_token_request_spec.rb +72 -0
  149. data/spec/models/o_auth_token_response_spec.rb +60 -0
  150. data/spec/models/other_line_item_spec.rb +94 -0
  151. data/spec/models/physical_goods_custom_data_spec.rb +42 -0
  152. data/spec/models/physical_goods_line_item_spec.rb +100 -0
  153. data/spec/models/refund_checkout402_response_spec.rb +58 -0
  154. data/spec/models/refund_checkout409_response_spec.rb +58 -0
  155. data/spec/models/service_custom_data_spec.rb +36 -0
  156. data/spec/models/service_line_item_spec.rb +100 -0
  157. data/spec/models/settlement_spec.rb +138 -0
  158. data/spec/models/tax_spec.rb +48 -0
  159. data/spec/models/ticket_custom_data_spec.rb +106 -0
  160. data/spec/models/ticket_line_item_spec.rb +100 -0
  161. data/spec/models/ticket_seating_spec.rb +54 -0
  162. data/spec/spec_helper.rb +111 -0
  163. metadata +295 -0
@@ -0,0 +1,483 @@
1
+ =begin
2
+ #Maytes API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MaytesApiClient
17
+ class Checkout < ApiModelBase
18
+ attr_accessor :checkout_uuid
19
+
20
+ attr_accessor :merchant_order_id
21
+
22
+ attr_accessor :status
23
+
24
+ attr_accessor :transaction_ref
25
+
26
+ attr_accessor :checkout_url
27
+
28
+ attr_accessor :merchant_expires_at
29
+
30
+ attr_accessor :captured_at
31
+
32
+ attr_accessor :return_url
33
+
34
+ attr_accessor :cancel_url
35
+
36
+ attr_accessor :amount
37
+
38
+ attr_accessor :currency
39
+
40
+ attr_accessor :service_fee
41
+
42
+ attr_accessor :refunded_amount
43
+
44
+ attr_accessor :merchant_processor_fee
45
+
46
+ attr_accessor :merchant_service_fee
47
+
48
+ attr_accessor :last_refund_at
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'checkout_uuid' => :'checkout_uuid',
54
+ :'merchant_order_id' => :'merchant_order_id',
55
+ :'status' => :'status',
56
+ :'transaction_ref' => :'transaction_ref',
57
+ :'checkout_url' => :'checkout_url',
58
+ :'merchant_expires_at' => :'merchant_expires_at',
59
+ :'captured_at' => :'captured_at',
60
+ :'return_url' => :'return_url',
61
+ :'cancel_url' => :'cancel_url',
62
+ :'amount' => :'amount',
63
+ :'currency' => :'currency',
64
+ :'service_fee' => :'service_fee',
65
+ :'refunded_amount' => :'refunded_amount',
66
+ :'merchant_processor_fee' => :'merchant_processor_fee',
67
+ :'merchant_service_fee' => :'merchant_service_fee',
68
+ :'last_refund_at' => :'last_refund_at'
69
+ }
70
+ end
71
+
72
+ # Returns attribute mapping this model knows about
73
+ def self.acceptable_attribute_map
74
+ attribute_map
75
+ end
76
+
77
+ # Returns all the JSON keys this model knows about
78
+ def self.acceptable_attributes
79
+ acceptable_attribute_map.values
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.openapi_types
84
+ {
85
+ :'checkout_uuid' => :'String',
86
+ :'merchant_order_id' => :'String',
87
+ :'status' => :'String',
88
+ :'transaction_ref' => :'String',
89
+ :'checkout_url' => :'String',
90
+ :'merchant_expires_at' => :'Time',
91
+ :'captured_at' => :'Time',
92
+ :'return_url' => :'String',
93
+ :'cancel_url' => :'String',
94
+ :'amount' => :'Integer',
95
+ :'currency' => :'String',
96
+ :'service_fee' => :'Fee',
97
+ :'refunded_amount' => :'Integer',
98
+ :'merchant_processor_fee' => :'Integer',
99
+ :'merchant_service_fee' => :'Integer',
100
+ :'last_refund_at' => :'Time'
101
+ }
102
+ end
103
+
104
+ # List of attributes with nullable: true
105
+ def self.openapi_nullable
106
+ Set.new([
107
+ :'merchant_order_id',
108
+ :'transaction_ref',
109
+ :'merchant_expires_at',
110
+ :'captured_at',
111
+ :'return_url',
112
+ :'cancel_url',
113
+ :'last_refund_at'
114
+ ])
115
+ end
116
+
117
+ # Initializes the object
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ def initialize(attributes = {})
120
+ if (!attributes.is_a?(Hash))
121
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MaytesApiClient::Checkout` initialize method"
122
+ end
123
+
124
+ # check to see if the attribute exists and convert string to symbol for hash key
125
+ acceptable_attribute_map = self.class.acceptable_attribute_map
126
+ attributes = attributes.each_with_object({}) { |(k, v), h|
127
+ if (!acceptable_attribute_map.key?(k.to_sym))
128
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MaytesApiClient::Checkout`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
129
+ end
130
+ h[k.to_sym] = v
131
+ }
132
+
133
+ if attributes.key?(:'checkout_uuid')
134
+ self.checkout_uuid = attributes[:'checkout_uuid']
135
+ else
136
+ self.checkout_uuid = nil
137
+ end
138
+
139
+ if attributes.key?(:'merchant_order_id')
140
+ self.merchant_order_id = attributes[:'merchant_order_id']
141
+ else
142
+ self.merchant_order_id = nil
143
+ end
144
+
145
+ if attributes.key?(:'status')
146
+ self.status = attributes[:'status']
147
+ else
148
+ self.status = nil
149
+ end
150
+
151
+ if attributes.key?(:'transaction_ref')
152
+ self.transaction_ref = attributes[:'transaction_ref']
153
+ else
154
+ self.transaction_ref = nil
155
+ end
156
+
157
+ if attributes.key?(:'checkout_url')
158
+ self.checkout_url = attributes[:'checkout_url']
159
+ else
160
+ self.checkout_url = nil
161
+ end
162
+
163
+ if attributes.key?(:'merchant_expires_at')
164
+ self.merchant_expires_at = attributes[:'merchant_expires_at']
165
+ else
166
+ self.merchant_expires_at = nil
167
+ end
168
+
169
+ if attributes.key?(:'captured_at')
170
+ self.captured_at = attributes[:'captured_at']
171
+ else
172
+ self.captured_at = nil
173
+ end
174
+
175
+ if attributes.key?(:'return_url')
176
+ self.return_url = attributes[:'return_url']
177
+ else
178
+ self.return_url = nil
179
+ end
180
+
181
+ if attributes.key?(:'cancel_url')
182
+ self.cancel_url = attributes[:'cancel_url']
183
+ else
184
+ self.cancel_url = nil
185
+ end
186
+
187
+ if attributes.key?(:'amount')
188
+ self.amount = attributes[:'amount']
189
+ else
190
+ self.amount = nil
191
+ end
192
+
193
+ if attributes.key?(:'currency')
194
+ self.currency = attributes[:'currency']
195
+ else
196
+ self.currency = nil
197
+ end
198
+
199
+ if attributes.key?(:'service_fee')
200
+ self.service_fee = attributes[:'service_fee']
201
+ else
202
+ self.service_fee = nil
203
+ end
204
+
205
+ if attributes.key?(:'refunded_amount')
206
+ self.refunded_amount = attributes[:'refunded_amount']
207
+ else
208
+ self.refunded_amount = nil
209
+ end
210
+
211
+ if attributes.key?(:'merchant_processor_fee')
212
+ self.merchant_processor_fee = attributes[:'merchant_processor_fee']
213
+ else
214
+ self.merchant_processor_fee = nil
215
+ end
216
+
217
+ if attributes.key?(:'merchant_service_fee')
218
+ self.merchant_service_fee = attributes[:'merchant_service_fee']
219
+ else
220
+ self.merchant_service_fee = nil
221
+ end
222
+
223
+ if attributes.key?(:'last_refund_at')
224
+ self.last_refund_at = attributes[:'last_refund_at']
225
+ else
226
+ self.last_refund_at = nil
227
+ end
228
+ end
229
+
230
+ # Show invalid properties with the reasons. Usually used together with valid?
231
+ # @return Array for valid properties with the reasons
232
+ def list_invalid_properties
233
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
234
+ invalid_properties = Array.new
235
+ if @checkout_uuid.nil?
236
+ invalid_properties.push('invalid value for "checkout_uuid", checkout_uuid cannot be nil.')
237
+ end
238
+
239
+ if @status.nil?
240
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
241
+ end
242
+
243
+ if @checkout_url.nil?
244
+ invalid_properties.push('invalid value for "checkout_url", checkout_url cannot be nil.')
245
+ end
246
+
247
+ if @amount.nil?
248
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
249
+ end
250
+
251
+ if @currency.nil?
252
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
253
+ end
254
+
255
+ if @service_fee.nil?
256
+ invalid_properties.push('invalid value for "service_fee", service_fee cannot be nil.')
257
+ end
258
+
259
+ if @refunded_amount.nil?
260
+ invalid_properties.push('invalid value for "refunded_amount", refunded_amount cannot be nil.')
261
+ end
262
+
263
+ if @refunded_amount < 0
264
+ invalid_properties.push('invalid value for "refunded_amount", must be greater than or equal to 0.')
265
+ end
266
+
267
+ if @merchant_processor_fee.nil?
268
+ invalid_properties.push('invalid value for "merchant_processor_fee", merchant_processor_fee cannot be nil.')
269
+ end
270
+
271
+ if @merchant_processor_fee < 0
272
+ invalid_properties.push('invalid value for "merchant_processor_fee", must be greater than or equal to 0.')
273
+ end
274
+
275
+ if @merchant_service_fee.nil?
276
+ invalid_properties.push('invalid value for "merchant_service_fee", merchant_service_fee cannot be nil.')
277
+ end
278
+
279
+ if @merchant_service_fee < 0
280
+ invalid_properties.push('invalid value for "merchant_service_fee", must be greater than or equal to 0.')
281
+ end
282
+
283
+ invalid_properties
284
+ end
285
+
286
+ # Check to see if the all the properties in the model are valid
287
+ # @return true if the model is valid
288
+ def valid?
289
+ warn '[DEPRECATED] the `valid?` method is obsolete'
290
+ return false if @checkout_uuid.nil?
291
+ return false if @status.nil?
292
+ return false if @checkout_url.nil?
293
+ return false if @amount.nil?
294
+ return false if @currency.nil?
295
+ return false if @service_fee.nil?
296
+ return false if @refunded_amount.nil?
297
+ return false if @refunded_amount < 0
298
+ return false if @merchant_processor_fee.nil?
299
+ return false if @merchant_processor_fee < 0
300
+ return false if @merchant_service_fee.nil?
301
+ return false if @merchant_service_fee < 0
302
+ true
303
+ end
304
+
305
+ # Custom attribute writer method with validation
306
+ # @param [Object] checkout_uuid Value to be assigned
307
+ def checkout_uuid=(checkout_uuid)
308
+ if checkout_uuid.nil?
309
+ fail ArgumentError, 'checkout_uuid cannot be nil'
310
+ end
311
+
312
+ @checkout_uuid = checkout_uuid
313
+ end
314
+
315
+ # Custom attribute writer method with validation
316
+ # @param [Object] status Value to be assigned
317
+ def status=(status)
318
+ if status.nil?
319
+ fail ArgumentError, 'status cannot be nil'
320
+ end
321
+
322
+ @status = status
323
+ end
324
+
325
+ # Custom attribute writer method with validation
326
+ # @param [Object] checkout_url Value to be assigned
327
+ def checkout_url=(checkout_url)
328
+ if checkout_url.nil?
329
+ fail ArgumentError, 'checkout_url cannot be nil'
330
+ end
331
+
332
+ @checkout_url = checkout_url
333
+ end
334
+
335
+ # Custom attribute writer method with validation
336
+ # @param [Object] amount Value to be assigned
337
+ def amount=(amount)
338
+ if amount.nil?
339
+ fail ArgumentError, 'amount cannot be nil'
340
+ end
341
+
342
+ @amount = amount
343
+ end
344
+
345
+ # Custom attribute writer method with validation
346
+ # @param [Object] currency Value to be assigned
347
+ def currency=(currency)
348
+ if currency.nil?
349
+ fail ArgumentError, 'currency cannot be nil'
350
+ end
351
+
352
+ @currency = currency
353
+ end
354
+
355
+ # Custom attribute writer method with validation
356
+ # @param [Object] service_fee Value to be assigned
357
+ def service_fee=(service_fee)
358
+ if service_fee.nil?
359
+ fail ArgumentError, 'service_fee cannot be nil'
360
+ end
361
+
362
+ @service_fee = service_fee
363
+ end
364
+
365
+ # Custom attribute writer method with validation
366
+ # @param [Object] refunded_amount Value to be assigned
367
+ def refunded_amount=(refunded_amount)
368
+ if refunded_amount.nil?
369
+ fail ArgumentError, 'refunded_amount cannot be nil'
370
+ end
371
+
372
+ if refunded_amount < 0
373
+ fail ArgumentError, 'invalid value for "refunded_amount", must be greater than or equal to 0.'
374
+ end
375
+
376
+ @refunded_amount = refunded_amount
377
+ end
378
+
379
+ # Custom attribute writer method with validation
380
+ # @param [Object] merchant_processor_fee Value to be assigned
381
+ def merchant_processor_fee=(merchant_processor_fee)
382
+ if merchant_processor_fee.nil?
383
+ fail ArgumentError, 'merchant_processor_fee cannot be nil'
384
+ end
385
+
386
+ if merchant_processor_fee < 0
387
+ fail ArgumentError, 'invalid value for "merchant_processor_fee", must be greater than or equal to 0.'
388
+ end
389
+
390
+ @merchant_processor_fee = merchant_processor_fee
391
+ end
392
+
393
+ # Custom attribute writer method with validation
394
+ # @param [Object] merchant_service_fee Value to be assigned
395
+ def merchant_service_fee=(merchant_service_fee)
396
+ if merchant_service_fee.nil?
397
+ fail ArgumentError, 'merchant_service_fee cannot be nil'
398
+ end
399
+
400
+ if merchant_service_fee < 0
401
+ fail ArgumentError, 'invalid value for "merchant_service_fee", must be greater than or equal to 0.'
402
+ end
403
+
404
+ @merchant_service_fee = merchant_service_fee
405
+ end
406
+
407
+ # Checks equality by comparing each attribute.
408
+ # @param [Object] Object to be compared
409
+ def ==(o)
410
+ return true if self.equal?(o)
411
+ self.class == o.class &&
412
+ checkout_uuid == o.checkout_uuid &&
413
+ merchant_order_id == o.merchant_order_id &&
414
+ status == o.status &&
415
+ transaction_ref == o.transaction_ref &&
416
+ checkout_url == o.checkout_url &&
417
+ merchant_expires_at == o.merchant_expires_at &&
418
+ captured_at == o.captured_at &&
419
+ return_url == o.return_url &&
420
+ cancel_url == o.cancel_url &&
421
+ amount == o.amount &&
422
+ currency == o.currency &&
423
+ service_fee == o.service_fee &&
424
+ refunded_amount == o.refunded_amount &&
425
+ merchant_processor_fee == o.merchant_processor_fee &&
426
+ merchant_service_fee == o.merchant_service_fee &&
427
+ last_refund_at == o.last_refund_at
428
+ end
429
+
430
+ # @see the `==` method
431
+ # @param [Object] Object to be compared
432
+ def eql?(o)
433
+ self == o
434
+ end
435
+
436
+ # Calculates hash code according to all attributes.
437
+ # @return [Integer] Hash code
438
+ def hash
439
+ [checkout_uuid, merchant_order_id, status, transaction_ref, checkout_url, merchant_expires_at, captured_at, return_url, cancel_url, amount, currency, service_fee, refunded_amount, merchant_processor_fee, merchant_service_fee, last_refund_at].hash
440
+ end
441
+
442
+ # Builds the object from hash
443
+ # @param [Hash] attributes Model attributes in the form of hash
444
+ # @return [Object] Returns the model itself
445
+ def self.build_from_hash(attributes)
446
+ return nil unless attributes.is_a?(Hash)
447
+ attributes = attributes.transform_keys(&:to_sym)
448
+ transformed_hash = {}
449
+ openapi_types.each_pair do |key, type|
450
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
451
+ transformed_hash["#{key}"] = nil
452
+ elsif type =~ /\AArray<(.*)>/i
453
+ # check to ensure the input is an array given that the attribute
454
+ # is documented as an array but the input is not
455
+ if attributes[attribute_map[key]].is_a?(Array)
456
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
457
+ end
458
+ elsif !attributes[attribute_map[key]].nil?
459
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
460
+ end
461
+ end
462
+ new(transformed_hash)
463
+ end
464
+
465
+ # Returns the object in the form of hash
466
+ # @return [Hash] Returns the object in the form of hash
467
+ def to_hash
468
+ hash = {}
469
+ self.class.attribute_map.each_pair do |attr, param|
470
+ value = self.send(attr)
471
+ if value.nil?
472
+ is_nullable = self.class.openapi_nullable.include?(attr)
473
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
474
+ end
475
+
476
+ hash[param] = _to_hash(value)
477
+ end
478
+ hash
479
+ end
480
+
481
+ end
482
+
483
+ end
@@ -0,0 +1,202 @@
1
+ =begin
2
+ #Maytes API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module MaytesApiClient
17
+ class CheckoutCancelled < ApiModelBase
18
+ attr_accessor :checkout_uuid
19
+
20
+ attr_accessor :merchant_order_id
21
+
22
+ attr_accessor :status
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'checkout_uuid' => :'checkout_uuid',
28
+ :'merchant_order_id' => :'merchant_order_id',
29
+ :'status' => :'status'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'checkout_uuid' => :'String',
47
+ :'merchant_order_id' => :'String',
48
+ :'status' => :'String'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ :'merchant_order_id',
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `MaytesApiClient::CheckoutCancelled` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `MaytesApiClient::CheckoutCancelled`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'checkout_uuid')
76
+ self.checkout_uuid = attributes[:'checkout_uuid']
77
+ else
78
+ self.checkout_uuid = nil
79
+ end
80
+
81
+ if attributes.key?(:'merchant_order_id')
82
+ self.merchant_order_id = attributes[:'merchant_order_id']
83
+ else
84
+ self.merchant_order_id = nil
85
+ end
86
+
87
+ if attributes.key?(:'status')
88
+ self.status = attributes[:'status']
89
+ else
90
+ self.status = nil
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
98
+ invalid_properties = Array.new
99
+ if @checkout_uuid.nil?
100
+ invalid_properties.push('invalid value for "checkout_uuid", checkout_uuid cannot be nil.')
101
+ end
102
+
103
+ if @status.nil?
104
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
105
+ end
106
+
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ warn '[DEPRECATED] the `valid?` method is obsolete'
114
+ return false if @checkout_uuid.nil?
115
+ return false if @status.nil?
116
+ true
117
+ end
118
+
119
+ # Custom attribute writer method with validation
120
+ # @param [Object] checkout_uuid Value to be assigned
121
+ def checkout_uuid=(checkout_uuid)
122
+ if checkout_uuid.nil?
123
+ fail ArgumentError, 'checkout_uuid cannot be nil'
124
+ end
125
+
126
+ @checkout_uuid = checkout_uuid
127
+ end
128
+
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] status Value to be assigned
131
+ def status=(status)
132
+ if status.nil?
133
+ fail ArgumentError, 'status cannot be nil'
134
+ end
135
+
136
+ @status = status
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ checkout_uuid == o.checkout_uuid &&
145
+ merchant_order_id == o.merchant_order_id &&
146
+ status == o.status
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [checkout_uuid, merchant_order_id, status].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ end
201
+
202
+ end