tradenity 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +89 -77
  4. data/lib/tradenity/api_client.rb +408 -0
  5. data/lib/tradenity/api_error.rb +36 -0
  6. data/lib/tradenity/configuration.rb +205 -0
  7. data/lib/tradenity/exceptions.rb +5 -0
  8. data/lib/tradenity/rails/railtie.rb +20 -20
  9. data/lib/tradenity/resources/address.rb +729 -0
  10. data/lib/tradenity/resources/braintree_gateway.rb +804 -0
  11. data/lib/tradenity/resources/brand.rb +732 -0
  12. data/lib/tradenity/resources/cancel_operation.rb +675 -0
  13. data/lib/tradenity/resources/cart_settings.rb +219 -0
  14. data/lib/tradenity/resources/cash_on_delivery_payment.rb +746 -0
  15. data/lib/tradenity/resources/category.rb +763 -0
  16. data/lib/tradenity/resources/collection.rb +734 -0
  17. data/lib/tradenity/resources/contact_info.rb +306 -0
  18. data/lib/tradenity/resources/countries_geo_zone.rb +739 -0
  19. data/lib/tradenity/resources/country.rb +803 -0
  20. data/lib/tradenity/resources/coupon.rb +454 -0
  21. data/lib/tradenity/resources/credit_card_payment.rb +803 -0
  22. data/lib/tradenity/resources/currency.rb +762 -0
  23. data/lib/tradenity/resources/customer.rb +816 -0
  24. data/lib/tradenity/resources/customer_group.rb +723 -0
  25. data/lib/tradenity/resources/dimensions.rb +263 -0
  26. data/lib/tradenity/resources/discount_coupon.rb +811 -0
  27. data/lib/tradenity/resources/discount_promotion.rb +784 -0
  28. data/lib/tradenity/resources/fixed_rate_shipping.rb +837 -0
  29. data/lib/tradenity/resources/free_item_coupon.rb +793 -0
  30. data/lib/tradenity/resources/free_shipping.rb +806 -0
  31. data/lib/tradenity/resources/free_shipping_coupon.rb +788 -0
  32. data/lib/tradenity/resources/free_shipping_promotion.rb +744 -0
  33. data/lib/tradenity/resources/gateway.rb +435 -0
  34. data/lib/tradenity/resources/general_settings.rb +206 -0
  35. data/lib/tradenity/resources/geo_zone.rb +406 -0
  36. data/lib/tradenity/resources/instance_meta.rb +182 -0
  37. data/lib/tradenity/resources/inventory_settings.rb +197 -0
  38. data/lib/tradenity/resources/items_selector.rb +270 -0
  39. data/lib/tradenity/resources/line_item.rb +347 -0
  40. data/lib/tradenity/resources/mail_server_settings.rb +221 -0
  41. data/lib/tradenity/resources/measurement_settings.rb +253 -0
  42. data/lib/tradenity/resources/option.rb +787 -0
  43. data/lib/tradenity/resources/option_set.rb +734 -0
  44. data/lib/tradenity/resources/option_value.rb +680 -0
  45. data/lib/tradenity/resources/order.rb +929 -0
  46. data/lib/tradenity/resources/order_line_item.rb +777 -0
  47. data/lib/tradenity/resources/paging.rb +38 -0
  48. data/lib/tradenity/resources/payment.rb +429 -0
  49. data/lib/tradenity/resources/payment_card.rb +847 -0
  50. data/lib/tradenity/resources/payment_settings.rb +201 -0
  51. data/lib/tradenity/resources/payment_source.rb +392 -0
  52. data/lib/tradenity/resources/payment_token.rb +723 -0
  53. data/lib/tradenity/resources/payment_transaction.rb +740 -0
  54. data/lib/tradenity/resources/photo.rb +341 -0
  55. data/lib/tradenity/resources/product.rb +1156 -0
  56. data/lib/tradenity/resources/promotion.rb +427 -0
  57. data/lib/tradenity/resources/refund_operation.rb +358 -0
  58. data/lib/tradenity/resources/refund_transaction.rb +730 -0
  59. data/lib/tradenity/resources/return_line_item.rb +781 -0
  60. data/lib/tradenity/resources/return_operation.rb +686 -0
  61. data/lib/tradenity/resources/return_settings.rb +255 -0
  62. data/lib/tradenity/resources/shipping_method.rb +530 -0
  63. data/lib/tradenity/resources/shopping_cart.rb +647 -0
  64. data/lib/tradenity/resources/state.rb +675 -0
  65. data/lib/tradenity/resources/states_geo_zone.rb +748 -0
  66. data/lib/tradenity/resources/store_credit.rb +686 -0
  67. data/lib/tradenity/resources/store_credit_payment.rb +764 -0
  68. data/lib/tradenity/resources/store_credit_transaction.rb +730 -0
  69. data/lib/tradenity/resources/store_profile.rb +532 -0
  70. data/lib/tradenity/resources/stripe_gateway.rb +804 -0
  71. data/lib/tradenity/resources/table_rate_rule.rb +712 -0
  72. data/lib/tradenity/resources/table_rate_shipping.rb +834 -0
  73. data/lib/tradenity/resources/tax_class.rb +723 -0
  74. data/lib/tradenity/resources/tax_rate.rb +845 -0
  75. data/lib/tradenity/resources/tax_settings.rb +231 -0
  76. data/lib/tradenity/resources/test_gateway.rb +804 -0
  77. data/lib/tradenity/resources/transaction.rb +523 -0
  78. data/lib/tradenity/resources/utils.rb +7 -0
  79. data/lib/tradenity/resources/variant.rb +877 -0
  80. data/lib/tradenity/resources/web_hooks.rb +262 -0
  81. data/lib/tradenity/resources/weight.rb +235 -0
  82. data/lib/tradenity/resources/wish_list.rb +686 -0
  83. data/lib/tradenity/resources/zip_codes_geo_zone.rb +755 -0
  84. data/lib/tradenity/token_holder.rb +22 -0
  85. data/lib/tradenity/version.rb +13 -3
  86. data/lib/tradenity.rb +117 -7
  87. data/tradenity.gemspec +35 -30
  88. metadata +200 -34
  89. data/lib/tradenity/api.rb +0 -17
  90. data/lib/tradenity/error/exceptions.rb +0 -52
  91. data/lib/tradenity/error/message.rb +0 -38
  92. data/lib/tradenity/http/client.rb +0 -130
  93. data/lib/tradenity/model/base.rb +0 -100
  94. data/lib/tradenity/model/entities.rb +0 -390
  95. data/lib/tradenity/model/paging.rb +0 -23
@@ -0,0 +1,740 @@
1
+ =begin
2
+ #Tradenity API
3
+
4
+ #Tradenity eCommerce Rest API
5
+
6
+ Contact: support@tradenity.com
7
+ Generated by: https://github.com/tradenity
8
+
9
+ =end
10
+
11
+ require 'uri'
12
+
13
+ module Tradenity
14
+ class PaymentTransaction
15
+
16
+
17
+ def id=(id)
18
+ @id = id
19
+ end
20
+
21
+ def id
22
+ if instance_variable_defined?('@id') && @id != nil
23
+ @id
24
+ elsif __meta && __meta.href != nil
25
+ @id = __meta.href.split('/')[-1]
26
+ @id
27
+ else
28
+ nil
29
+ end
30
+ end
31
+
32
+ attr_accessor :__meta
33
+
34
+ attr_accessor :created_at
35
+
36
+ attr_accessor :updated_at
37
+
38
+ attr_accessor :status
39
+
40
+ attr_accessor :type
41
+
42
+ attr_accessor :payment
43
+
44
+ attr_accessor :order
45
+
46
+ class EnumAttributeValidator
47
+ attr_reader :datatype
48
+ attr_reader :allowable_values
49
+
50
+ def initialize(datatype, allowable_values)
51
+ @allowable_values = allowable_values.map do |value|
52
+ case datatype.to_s
53
+ when /Integer/i
54
+ value.to_i
55
+ when /Float/i
56
+ value.to_f
57
+ else
58
+ value
59
+ end
60
+ end
61
+ end
62
+
63
+ def valid?(value)
64
+ !value || allowable_values.include?(value)
65
+ end
66
+ end
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'id' => :'id',
72
+ :'__meta' => :'__meta',
73
+ :'created_at' => :'createdAt',
74
+ :'updated_at' => :'updatedAt',
75
+ :'status' => :'status',
76
+ :'type' => :'type',
77
+ :'payment' => :'payment',
78
+ :'order' => :'order'
79
+ }
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.swagger_types
84
+ {
85
+ :'id' => :'String',
86
+ :'__meta' => :'InstanceMeta',
87
+ :'created_at' => :'DateTime',
88
+ :'updated_at' => :'DateTime',
89
+ :'status' => :'String',
90
+ :'type' => :'String',
91
+ :'payment' => :'Payment',
92
+ :'order' => :'Order'
93
+ }
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ return unless attributes.is_a?(Hash)
100
+
101
+ # convert string to symbol for hash key
102
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
103
+ if attributes.has_key?(:'id')
104
+ self.id = attributes[:'id']
105
+ end
106
+
107
+ if attributes.has_key?(:'__meta')
108
+ self.__meta = attributes[:'__meta']
109
+ end
110
+
111
+ if attributes.has_key?(:'createdAt')
112
+ self.created_at = attributes[:'createdAt']
113
+ end
114
+
115
+ if attributes.has_key?(:'created_at')
116
+ self.created_at = attributes[:'created_at']
117
+ end
118
+
119
+ if attributes.has_key?(:'updatedAt')
120
+ self.updated_at = attributes[:'updatedAt']
121
+ end
122
+
123
+ if attributes.has_key?(:'updated_at')
124
+ self.updated_at = attributes[:'updated_at']
125
+ end
126
+
127
+ if attributes.has_key?(:'status')
128
+ self.status = attributes[:'status']
129
+ end
130
+
131
+ if attributes.has_key?(:'type')
132
+ self.type = attributes[:'type']
133
+ end
134
+
135
+ if attributes.has_key?(:'payment')
136
+ self.payment = attributes[:'payment']
137
+ end
138
+
139
+ if attributes.has_key?(:'order')
140
+ self.order = attributes[:'order']
141
+ end
142
+ end
143
+
144
+ # Show invalid properties with the reasons. Usually used together with valid?
145
+ # @return Array for valid properties with the reasons
146
+ def list_invalid_properties
147
+ invalid_properties = Array.new
148
+ if @status.nil?
149
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
150
+ end
151
+
152
+ if @type.nil?
153
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
154
+ end
155
+
156
+ if @payment.nil?
157
+ invalid_properties.push('invalid value for "payment", payment cannot be nil.')
158
+ end
159
+
160
+ if @order.nil?
161
+ invalid_properties.push('invalid value for "order", order cannot be nil.')
162
+ end
163
+
164
+ invalid_properties
165
+ end
166
+
167
+ # Check to see if the all the properties in the model are valid
168
+ # @return true if the model is valid
169
+ def valid?
170
+ return false if @status.nil?
171
+ status_validator = EnumAttributeValidator.new('String', ['completed', 'pending', 'failed'])
172
+ return false unless status_validator.valid?(@status)
173
+ return false if @type.nil?
174
+ type_validator = EnumAttributeValidator.new('String', ['payment', 'refund'])
175
+ return false unless type_validator.valid?(@type)
176
+ return false if @payment.nil?
177
+ return false if @order.nil?
178
+ true
179
+ end
180
+
181
+ # Custom attribute writer method checking allowed values (enum).
182
+ # @param [Object] status Object to be assigned
183
+ def status=(status)
184
+ validator = EnumAttributeValidator.new('String', ['completed', 'pending', 'failed'])
185
+ unless validator.valid?(status)
186
+ fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
187
+ end
188
+ @status = status
189
+ end
190
+
191
+ # Custom attribute writer method checking allowed values (enum).
192
+ # @param [Object] type Object to be assigned
193
+ def type=(type)
194
+ validator = EnumAttributeValidator.new('String', ['payment', 'refund'])
195
+ unless validator.valid?(type)
196
+ fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
197
+ end
198
+ @type = type
199
+ end
200
+
201
+ # Checks equality by comparing each attribute.
202
+ # @param [Object] Object to be compared
203
+ def ==(o)
204
+ return true if self.equal?(o)
205
+ self.class == o.class &&
206
+ __meta == o.__meta &&
207
+ created_at == o.created_at &&
208
+ updated_at == o.updated_at &&
209
+ status == o.status &&
210
+ type == o.type &&
211
+ payment == o.payment &&
212
+ order == o.order
213
+ end
214
+
215
+ # @see the `==` method
216
+ # @param [Object] Object to be compared
217
+ def eql?(o)
218
+ self == o
219
+ end
220
+
221
+ # Calculates hash code according to all attributes.
222
+ # @return [Fixnum] Hash code
223
+ def hash
224
+ [__meta, created_at, updated_at, status, type, payment, order].hash
225
+ end
226
+
227
+ # Builds the object from hash
228
+ # @param [Hash] attributes Model attributes in the form of hash
229
+ # @return [Object] Returns the model itself
230
+ def build_from_hash(attributes)
231
+ return nil unless attributes.is_a?(Hash)
232
+ self.class.swagger_types.each_pair do |key, type|
233
+ if type =~ /\AArray<(.*)>/i
234
+ # check to ensure the input is an array given that the the attribute
235
+ # is documented as an array but the input is not
236
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
237
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
238
+ end
239
+ elsif !attributes[self.class.attribute_map[key]].nil?
240
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
241
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
242
+ end
243
+
244
+ self
245
+ end
246
+
247
+ # Deserializes the data based on type
248
+ # @param string type Data type
249
+ # @param string value Value to be deserialized
250
+ # @return [Object] Deserialized data
251
+ def _deserialize(type, value)
252
+ case type.to_sym
253
+ when :DateTime
254
+ DateTime.parse(value)
255
+ when :Date
256
+ Date.parse(value)
257
+ when :String
258
+ value.to_s
259
+ when :Integer
260
+ value.to_i
261
+ when :Float
262
+ value.to_f
263
+ when :BOOLEAN
264
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
265
+ true
266
+ else
267
+ false
268
+ end
269
+ when :Object
270
+ # generic object (usually a Hash), return directly
271
+ value
272
+ when /\AArray<(?<inner_type>.+)>\z/
273
+ inner_type = Regexp.last_match[:inner_type]
274
+ value.map { |v| _deserialize(inner_type, v) }
275
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
276
+ k_type = Regexp.last_match[:k_type]
277
+ v_type = Regexp.last_match[:v_type]
278
+ {}.tap do |hash|
279
+ value.each do |k, v|
280
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
281
+ end
282
+ end
283
+ else # model
284
+ temp_model = Tradenity.const_get(type).new
285
+ temp_model.build_from_hash(value)
286
+ end
287
+ end
288
+
289
+ # Returns the string representation of the object
290
+ # @return [String] String presentation of the object
291
+ def to_s
292
+ to_hash.to_s
293
+ end
294
+
295
+ # to_body is an alias to to_hash (backward compatibility)
296
+ # @return [Hash] Returns the object in the form of hash
297
+ def to_body
298
+ to_hash
299
+ end
300
+
301
+ # Returns the object in the form of hash
302
+ # @return [Hash] Returns the object in the form of hash
303
+ def to_hash
304
+ hash = {}
305
+ self.class.attribute_map.each_pair do |attr, param|
306
+ value = self.send(attr)
307
+ next if value.nil?
308
+ hash[param] = _to_hash(value)
309
+ end
310
+ hash
311
+ end
312
+
313
+ # Outputs non-array value in the form of hash
314
+ # For object, use to_hash. Otherwise, just return the value
315
+ # @param [Object] value Any valid value
316
+ # @return [Hash] Returns the value in the form of hash
317
+ def _to_hash(value)
318
+ if value.is_a?(Array)
319
+ value.compact.map { |v| _to_hash(v) }
320
+ elsif value.is_a?(Hash)
321
+ {}.tap do |hash|
322
+ value.each { |k, v| hash[k] = _to_hash(v) }
323
+ end
324
+ elsif value.respond_to? :to_hash
325
+ value.to_hash
326
+ else
327
+ value
328
+ end
329
+ end
330
+
331
+
332
+ def self.api_client
333
+ ApiClient.default
334
+ end
335
+
336
+ # Create PaymentTransaction
337
+ # Create a new PaymentTransaction
338
+ def create
339
+ data = self.class.create_payment_transaction(self)
340
+ self.id = data.id
341
+ data
342
+ end
343
+
344
+ # Update PaymentTransaction
345
+ # Update attributes of PaymentTransaction
346
+ # @return [PaymentTransaction]
347
+ def update
348
+ self.class.update_payment_transaction_by_id(self.id, self)
349
+ end
350
+
351
+ # Delete PaymentTransaction
352
+ # Delete this instance of PaymentTransaction.
353
+ # @return [nil]
354
+ def delete
355
+ self.class.delete_payment_transaction_by_id(self.id)
356
+ end
357
+
358
+ class << self
359
+
360
+ # List PaymentTransactions
361
+ # Return a list of PaymentTransactions
362
+ # @param [Hash] opts the optional parameters
363
+ # @return [Page<PaymentTransaction>]
364
+ def find_all
365
+ list_all_payment_transactions
366
+ end
367
+
368
+ # Find List of PaymentTransaction
369
+ # Return multiple instances of PaymentTransaction by its attributes.
370
+ # @param [Hash] opts the search parameters
371
+ # @return [Page<Collection>]
372
+ def find_all_by(opts = {})
373
+ list_all_payment_transactions(opts)
374
+ end
375
+
376
+ # Find PaymentTransaction by its parameters
377
+ # Return single instance of Collection by its attributes.
378
+ # @param [Hash] opts search parameters
379
+ # @return [PaymentTransaction]
380
+ def find_one_by(opts = {})
381
+ list_all_payment_transactions(opts)[0]
382
+ end
383
+
384
+ # Find PaymentTransaction
385
+ # Return single instance of PaymentTransaction by its ID.
386
+ # @param id ID of PaymentTransaction to return
387
+ # @return [PaymentTransaction]
388
+ def find_by_id(id)
389
+ get_payment_transaction_by_id(id)
390
+ end
391
+
392
+ # Delete PaymentTransaction
393
+ # Delete an instance of PaymentTransaction by its ID.
394
+ # @param id ID of PaymentTransaction to delete.
395
+ # @return [nil]
396
+ def delete_by_id(id)
397
+ delete_payment_transaction_by_id(id)
398
+ end
399
+
400
+ # Create PaymentTransaction
401
+ # Create a new PaymentTransaction
402
+ # @param payment_transaction Attributes of paymentTransaction to create
403
+ # @param [Hash] opts the optional parameters
404
+ # @return [PaymentTransaction]
405
+ def create_payment_transaction(payment_transaction, opts = {})
406
+ data, _status_code, _headers = create_payment_transaction_with_http_info(payment_transaction, opts)
407
+ data
408
+ end
409
+
410
+ # Create PaymentTransaction
411
+ # Create a new PaymentTransaction
412
+ # @param payment_transaction Attributes of paymentTransaction to create
413
+ # @param [Hash] opts the optional parameters
414
+ # @return [Array<(PaymentTransaction, Fixnum, Hash)>] PaymentTransaction data, response status code and response headers
415
+ def create_payment_transaction_with_http_info(payment_transaction, opts = {})
416
+ if api_client.config.debugging
417
+ api_client.config.logger.debug 'Calling API: PaymentTransaction.create_payment_transaction ...'
418
+ end
419
+ # verify the required parameter 'payment_transaction' is set
420
+ if api_client.config.client_side_validation && payment_transaction.nil?
421
+ fail ArgumentError, "Missing the required parameter 'payment_transaction' when calling PaymentTransaction.create_payment_transaction"
422
+ end
423
+ # resource path
424
+ local_var_path = '/paymentTransactions'
425
+
426
+ # query parameters
427
+ query_params = opts
428
+
429
+ # header parameters
430
+ header_params = {}
431
+ # HTTP header 'Accept' (if needed)
432
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
433
+ # HTTP header 'Content-Type'
434
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
435
+
436
+ # form parameters
437
+ form_params = {}
438
+
439
+ # http body (model)
440
+ post_body = api_client.object_to_http_body(payment_transaction)
441
+ auth_names = []
442
+ data, status_code, headers = api_client.call_api(:POST, local_var_path,
443
+ :header_params => header_params,
444
+ :query_params => query_params,
445
+ :form_params => form_params,
446
+ :body => post_body,
447
+ :auth_names => auth_names,
448
+ :return_type => 'PaymentTransaction')
449
+ if api_client.config.debugging
450
+ api_client.config.logger.debug "API called: PaymentTransaction#create_payment_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
451
+ end
452
+ return data, status_code, headers
453
+ end
454
+ # Delete PaymentTransaction
455
+ # Delete an instance of PaymentTransaction by its ID.
456
+ # @param payment_transaction_id ID of paymentTransaction to delete.
457
+ # @param [Hash] opts the optional parameters
458
+ # @return [nil]
459
+ def delete_payment_transaction_by_id(payment_transaction_id, opts = {})
460
+ delete_payment_transaction_by_id_with_http_info(payment_transaction_id, opts)
461
+ nil
462
+ end
463
+
464
+ # Delete PaymentTransaction
465
+ # Delete an instance of PaymentTransaction by its ID.
466
+ # @param payment_transaction_id ID of paymentTransaction to delete.
467
+ # @param [Hash] opts the optional parameters
468
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
469
+ def delete_payment_transaction_by_id_with_http_info(payment_transaction_id, opts = {})
470
+ if api_client.config.debugging
471
+ api_client.config.logger.debug 'Calling API: PaymentTransaction.delete_payment_transaction_by_id ...'
472
+ end
473
+ # verify the required parameter 'payment_transaction_id' is set
474
+ if api_client.config.client_side_validation && payment_transaction_id.nil?
475
+ fail ArgumentError, "Missing the required parameter 'payment_transaction_id' when calling PaymentTransaction.delete_payment_transaction_by_id"
476
+ end
477
+ # resource path
478
+ local_var_path = '/paymentTransactions/{paymentTransactionId}'.sub('{' + 'paymentTransactionId' + '}', payment_transaction_id.to_s)
479
+
480
+ # query parameters
481
+ query_params = opts
482
+
483
+ # header parameters
484
+ header_params = {}
485
+ # HTTP header 'Accept' (if needed)
486
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
487
+ # HTTP header 'Content-Type'
488
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
489
+
490
+ # form parameters
491
+ form_params = {}
492
+
493
+ # http body (model)
494
+ post_body = nil
495
+ auth_names = []
496
+ data, status_code, headers = api_client.call_api(:DELETE, local_var_path,
497
+ :header_params => header_params,
498
+ :query_params => query_params,
499
+ :form_params => form_params,
500
+ :body => post_body,
501
+ :auth_names => auth_names)
502
+ if api_client.config.debugging
503
+ api_client.config.logger.debug "API called: PaymentTransaction#delete_payment_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
504
+ end
505
+ return data, status_code, headers
506
+ end
507
+ # Find PaymentTransaction
508
+ # Return single instance of PaymentTransaction by its ID.
509
+ # @param payment_transaction_id ID of paymentTransaction to return
510
+ # @param [Hash] opts the optional parameters
511
+ # @return [PaymentTransaction]
512
+ def get_payment_transaction_by_id(payment_transaction_id, opts = {})
513
+ data, _status_code, _headers = get_payment_transaction_by_id_with_http_info(payment_transaction_id, opts)
514
+ data
515
+ end
516
+
517
+ # Find PaymentTransaction
518
+ # Return single instance of PaymentTransaction by its ID.
519
+ # @param payment_transaction_id ID of paymentTransaction to return
520
+ # @param [Hash] opts the optional parameters
521
+ # @return [Array<(PaymentTransaction, Fixnum, Hash)>] PaymentTransaction data, response status code and response headers
522
+ def get_payment_transaction_by_id_with_http_info(payment_transaction_id, opts = {})
523
+ if api_client.config.debugging
524
+ api_client.config.logger.debug 'Calling API: PaymentTransaction.get_payment_transaction_by_id ...'
525
+ end
526
+ # verify the required parameter 'payment_transaction_id' is set
527
+ if api_client.config.client_side_validation && payment_transaction_id.nil?
528
+ fail ArgumentError, "Missing the required parameter 'payment_transaction_id' when calling PaymentTransaction.get_payment_transaction_by_id"
529
+ end
530
+ # resource path
531
+ local_var_path = '/paymentTransactions/{paymentTransactionId}'.sub('{' + 'paymentTransactionId' + '}', payment_transaction_id.to_s)
532
+
533
+ # query parameters
534
+ query_params = opts
535
+
536
+ # header parameters
537
+ header_params = {}
538
+ # HTTP header 'Accept' (if needed)
539
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
540
+ # HTTP header 'Content-Type'
541
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
542
+
543
+ # form parameters
544
+ form_params = {}
545
+
546
+ # http body (model)
547
+ post_body = nil
548
+ auth_names = []
549
+ data, status_code, headers = api_client.call_api(:GET, local_var_path,
550
+ :header_params => header_params,
551
+ :query_params => query_params,
552
+ :form_params => form_params,
553
+ :body => post_body,
554
+ :auth_names => auth_names,
555
+ :return_type => 'PaymentTransaction')
556
+ if api_client.config.debugging
557
+ api_client.config.logger.debug "API called: PaymentTransaction#get_payment_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
558
+ end
559
+ return data, status_code, headers
560
+ end
561
+ # List PaymentTransactions
562
+ # Return a list of PaymentTransactions
563
+ # @param [Hash] opts the optional parameters
564
+ # @option opts [Integer] :page page number
565
+ # @option opts [Integer] :size page size
566
+ # @option opts [String] :sort page order
567
+ # @return [Page<PaymentTransaction>]
568
+ def list_all_payment_transactions(opts = {})
569
+ data, _status_code, _headers = list_all_payment_transactions_with_http_info(opts)
570
+ data
571
+ end
572
+
573
+ # List PaymentTransactions
574
+ # Return a list of PaymentTransactions
575
+ # @param [Hash] opts the optional parameters
576
+ # @option opts [Integer] :page page number
577
+ # @option opts [Integer] :size page size
578
+ # @option opts [String] :sort page order
579
+ # @return [Array<(Page<PaymentTransaction>, Fixnum, Hash)>] Page<PaymentTransaction> data, response status code and response headers
580
+ def list_all_payment_transactions_with_http_info(opts = {})
581
+ if api_client.config.debugging
582
+ api_client.config.logger.debug 'Calling API: PaymentTransaction.list_all_payment_transactions ...'
583
+ end
584
+ # resource path
585
+ local_var_path = '/paymentTransactions'
586
+
587
+ # query parameters
588
+ query_params = opts
589
+ # query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
590
+ # query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
591
+ # query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
592
+
593
+ # header parameters
594
+ header_params = {}
595
+ # HTTP header 'Accept' (if needed)
596
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
597
+ # HTTP header 'Content-Type'
598
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
599
+
600
+ # form parameters
601
+ form_params = {}
602
+
603
+ # http body (model)
604
+ post_body = nil
605
+ auth_names = []
606
+ data, status_code, headers = api_client.call_api(:GET, local_var_path,
607
+ :header_params => header_params,
608
+ :query_params => query_params,
609
+ :form_params => form_params,
610
+ :body => post_body,
611
+ :auth_names => auth_names,
612
+ :return_type => 'Page<PaymentTransaction>')
613
+ if api_client.config.debugging
614
+ api_client.config.logger.debug "API called: PaymentTransaction#list_all_payment_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
615
+ end
616
+ return data, status_code, headers
617
+ end
618
+ # Replace PaymentTransaction
619
+ # Replace all attributes of PaymentTransaction
620
+ # @param payment_transaction_id ID of paymentTransaction to replace
621
+ # @param payment_transaction Attributes of paymentTransaction to replace
622
+ # @param [Hash] opts the optional parameters
623
+ # @return [PaymentTransaction]
624
+ def replace_payment_transaction_by_id(payment_transaction_id, payment_transaction, opts = {})
625
+ data, _status_code, _headers = replace_payment_transaction_by_id_with_http_info(payment_transaction_id, payment_transaction, opts)
626
+ data
627
+ end
628
+
629
+ # Replace PaymentTransaction
630
+ # Replace all attributes of PaymentTransaction
631
+ # @param payment_transaction_id ID of paymentTransaction to replace
632
+ # @param payment_transaction Attributes of paymentTransaction to replace
633
+ # @param [Hash] opts the optional parameters
634
+ # @return [Array<(PaymentTransaction, Fixnum, Hash)>] PaymentTransaction data, response status code and response headers
635
+ def replace_payment_transaction_by_id_with_http_info(payment_transaction_id, payment_transaction, opts = {})
636
+ if api_client.config.debugging
637
+ api_client.config.logger.debug 'Calling API: PaymentTransaction.replace_payment_transaction_by_id ...'
638
+ end
639
+ # verify the required parameter 'payment_transaction_id' is set
640
+ if api_client.config.client_side_validation && payment_transaction_id.nil?
641
+ fail ArgumentError, "Missing the required parameter 'payment_transaction_id' when calling PaymentTransaction.replace_payment_transaction_by_id"
642
+ end
643
+ # verify the required parameter 'payment_transaction' is set
644
+ if api_client.config.client_side_validation && payment_transaction.nil?
645
+ fail ArgumentError, "Missing the required parameter 'payment_transaction' when calling PaymentTransaction.replace_payment_transaction_by_id"
646
+ end
647
+ # resource path
648
+ local_var_path = '/paymentTransactions/{paymentTransactionId}'.sub('{' + 'paymentTransactionId' + '}', payment_transaction_id.to_s)
649
+
650
+ # query parameters
651
+ query_params = opts
652
+
653
+ # header parameters
654
+ header_params = {}
655
+ # HTTP header 'Accept' (if needed)
656
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
657
+ # HTTP header 'Content-Type'
658
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
659
+
660
+ # form parameters
661
+ form_params = {}
662
+
663
+ # http body (model)
664
+ post_body = api_client.object_to_http_body(payment_transaction)
665
+ auth_names = []
666
+ data, status_code, headers = api_client.call_api(:PUT, local_var_path,
667
+ :header_params => header_params,
668
+ :query_params => query_params,
669
+ :form_params => form_params,
670
+ :body => post_body,
671
+ :auth_names => auth_names,
672
+ :return_type => 'PaymentTransaction')
673
+ if api_client.config.debugging
674
+ api_client.config.logger.debug "API called: PaymentTransaction#replace_payment_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
675
+ end
676
+ return data, status_code, headers
677
+ end
678
+ # Update PaymentTransaction
679
+ # Update attributes of PaymentTransaction
680
+ # @param payment_transaction_id ID of paymentTransaction to update.
681
+ # @param payment_transaction Attributes of paymentTransaction to update.
682
+ # @param [Hash] opts the optional parameters
683
+ # @return [PaymentTransaction]
684
+ def update_payment_transaction_by_id(payment_transaction_id, payment_transaction, opts = {})
685
+ data, _status_code, _headers = update_payment_transaction_by_id_with_http_info(payment_transaction_id, payment_transaction, opts)
686
+ data
687
+ end
688
+
689
+ # Update PaymentTransaction
690
+ # Update attributes of PaymentTransaction
691
+ # @param payment_transaction_id ID of paymentTransaction to update.
692
+ # @param payment_transaction Attributes of paymentTransaction to update.
693
+ # @param [Hash] opts the optional parameters
694
+ # @return [Array<(PaymentTransaction, Fixnum, Hash)>] PaymentTransaction data, response status code and response headers
695
+ def update_payment_transaction_by_id_with_http_info(payment_transaction_id, payment_transaction, opts = {})
696
+ if api_client.config.debugging
697
+ api_client.config.logger.debug 'Calling API: PaymentTransaction.update_payment_transaction_by_id ...'
698
+ end
699
+ # verify the required parameter 'payment_transaction_id' is set
700
+ if api_client.config.client_side_validation && payment_transaction_id.nil?
701
+ fail ArgumentError, "Missing the required parameter 'payment_transaction_id' when calling PaymentTransaction.update_payment_transaction_by_id"
702
+ end
703
+ # verify the required parameter 'payment_transaction' is set
704
+ if api_client.config.client_side_validation && payment_transaction.nil?
705
+ fail ArgumentError, "Missing the required parameter 'payment_transaction' when calling PaymentTransaction.update_payment_transaction_by_id"
706
+ end
707
+ # resource path
708
+ local_var_path = '/paymentTransactions/{paymentTransactionId}'.sub('{' + 'paymentTransactionId' + '}', payment_transaction_id.to_s)
709
+
710
+ # query parameters
711
+ query_params = opts
712
+
713
+ # header parameters
714
+ header_params = {}
715
+ # HTTP header 'Accept' (if needed)
716
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
717
+ # HTTP header 'Content-Type'
718
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
719
+
720
+ # form parameters
721
+ form_params = {}
722
+
723
+ # http body (model)
724
+ post_body = api_client.object_to_http_body(payment_transaction)
725
+ auth_names = []
726
+ data, status_code, headers = api_client.call_api(:PATCH, local_var_path,
727
+ :header_params => header_params,
728
+ :query_params => query_params,
729
+ :form_params => form_params,
730
+ :body => post_body,
731
+ :auth_names => auth_names,
732
+ :return_type => 'PaymentTransaction')
733
+ if api_client.config.debugging
734
+ api_client.config.logger.debug "API called: PaymentTransaction#update_payment_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
735
+ end
736
+ return data, status_code, headers
737
+ end
738
+ end
739
+ end
740
+ end