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,803 @@
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 CreditCardPayment
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 :amount
39
+
40
+ attr_accessor :order
41
+
42
+ attr_accessor :payment_source
43
+
44
+ attr_accessor :currency
45
+
46
+ attr_accessor :status
47
+
48
+ attr_accessor :gateway
49
+
50
+ attr_accessor :payment_mode
51
+
52
+ attr_accessor :gateway_operation_id
53
+
54
+ class EnumAttributeValidator
55
+ attr_reader :datatype
56
+ attr_reader :allowable_values
57
+
58
+ def initialize(datatype, allowable_values)
59
+ @allowable_values = allowable_values.map do |value|
60
+ case datatype.to_s
61
+ when /Integer/i
62
+ value.to_i
63
+ when /Float/i
64
+ value.to_f
65
+ else
66
+ value
67
+ end
68
+ end
69
+ end
70
+
71
+ def valid?(value)
72
+ !value || allowable_values.include?(value)
73
+ end
74
+ end
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'id' => :'id',
80
+ :'__meta' => :'__meta',
81
+ :'created_at' => :'createdAt',
82
+ :'updated_at' => :'updatedAt',
83
+ :'amount' => :'amount',
84
+ :'order' => :'order',
85
+ :'payment_source' => :'paymentSource',
86
+ :'currency' => :'currency',
87
+ :'status' => :'status',
88
+ :'gateway' => :'gateway',
89
+ :'payment_mode' => :'paymentMode',
90
+ :'gateway_operation_id' => :'gatewayOperationId'
91
+ }
92
+ end
93
+
94
+ # Attribute type mapping.
95
+ def self.swagger_types
96
+ {
97
+ :'id' => :'String',
98
+ :'__meta' => :'InstanceMeta',
99
+ :'created_at' => :'DateTime',
100
+ :'updated_at' => :'DateTime',
101
+ :'amount' => :'Integer',
102
+ :'order' => :'Order',
103
+ :'payment_source' => :'PaymentSource',
104
+ :'currency' => :'Currency',
105
+ :'status' => :'String',
106
+ :'gateway' => :'Gateway',
107
+ :'payment_mode' => :'String',
108
+ :'gateway_operation_id' => :'String'
109
+ }
110
+ end
111
+
112
+ # Initializes the object
113
+ # @param [Hash] attributes Model attributes in the form of hash
114
+ def initialize(attributes = {})
115
+ return unless attributes.is_a?(Hash)
116
+
117
+ # convert string to symbol for hash key
118
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
119
+ if attributes.has_key?(:'id')
120
+ self.id = attributes[:'id']
121
+ end
122
+
123
+ if attributes.has_key?(:'__meta')
124
+ self.__meta = attributes[:'__meta']
125
+ end
126
+
127
+ if attributes.has_key?(:'createdAt')
128
+ self.created_at = attributes[:'createdAt']
129
+ end
130
+
131
+ if attributes.has_key?(:'created_at')
132
+ self.created_at = attributes[:'created_at']
133
+ end
134
+
135
+ if attributes.has_key?(:'updatedAt')
136
+ self.updated_at = attributes[:'updatedAt']
137
+ end
138
+
139
+ if attributes.has_key?(:'updated_at')
140
+ self.updated_at = attributes[:'updated_at']
141
+ end
142
+
143
+ if attributes.has_key?(:'amount')
144
+ self.amount = attributes[:'amount']
145
+ end
146
+
147
+ if attributes.has_key?(:'order')
148
+ self.order = attributes[:'order']
149
+ end
150
+
151
+ if attributes.has_key?(:'paymentSource')
152
+ self.payment_source = attributes[:'paymentSource']
153
+ end
154
+
155
+ if attributes.has_key?(:'payment_source')
156
+ self.payment_source = attributes[:'payment_source']
157
+ end
158
+
159
+ if attributes.has_key?(:'currency')
160
+ self.currency = attributes[:'currency']
161
+ end
162
+
163
+ if attributes.has_key?(:'status')
164
+ self.status = attributes[:'status']
165
+ end
166
+
167
+ if attributes.has_key?(:'gateway')
168
+ self.gateway = attributes[:'gateway']
169
+ end
170
+
171
+ if attributes.has_key?(:'paymentMode')
172
+ self.payment_mode = attributes[:'paymentMode']
173
+ end
174
+
175
+ if attributes.has_key?(:'payment_mode')
176
+ self.payment_mode = attributes[:'payment_mode']
177
+ end
178
+
179
+ if attributes.has_key?(:'gatewayOperationId')
180
+ self.gateway_operation_id = attributes[:'gatewayOperationId']
181
+ end
182
+
183
+ if attributes.has_key?(:'gateway_operation_id')
184
+ self.gateway_operation_id = attributes[:'gateway_operation_id']
185
+ end
186
+ end
187
+
188
+ # Show invalid properties with the reasons. Usually used together with valid?
189
+ # @return Array for valid properties with the reasons
190
+ def list_invalid_properties
191
+ invalid_properties = Array.new
192
+ if @amount.nil?
193
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
194
+ end
195
+
196
+ if @order.nil?
197
+ invalid_properties.push('invalid value for "order", order cannot be nil.')
198
+ end
199
+
200
+ if @payment_source.nil?
201
+ invalid_properties.push('invalid value for "payment_source", payment_source cannot be nil.')
202
+ end
203
+
204
+ if @currency.nil?
205
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
206
+ end
207
+
208
+ if @status.nil?
209
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
210
+ end
211
+
212
+ if @gateway.nil?
213
+ invalid_properties.push('invalid value for "gateway", gateway cannot be nil.')
214
+ end
215
+
216
+ if @gateway_operation_id.nil?
217
+ invalid_properties.push('invalid value for "gateway_operation_id", gateway_operation_id cannot be nil.')
218
+ end
219
+
220
+ invalid_properties
221
+ end
222
+
223
+ # Check to see if the all the properties in the model are valid
224
+ # @return true if the model is valid
225
+ def valid?
226
+ return false if @amount.nil?
227
+ return false if @order.nil?
228
+ return false if @payment_source.nil?
229
+ return false if @currency.nil?
230
+ return false if @status.nil?
231
+ status_validator = EnumAttributeValidator.new('String', ['pending', 'awaitingRetry', 'successful', 'failed'])
232
+ return false unless status_validator.valid?(@status)
233
+ return false if @gateway.nil?
234
+ payment_mode_validator = EnumAttributeValidator.new('String', ['authorize', 'capture'])
235
+ return false unless payment_mode_validator.valid?(@payment_mode)
236
+ return false if @gateway_operation_id.nil?
237
+ true
238
+ end
239
+
240
+ # Custom attribute writer method checking allowed values (enum).
241
+ # @param [Object] status Object to be assigned
242
+ def status=(status)
243
+ validator = EnumAttributeValidator.new('String', ['pending', 'awaitingRetry', 'successful', 'failed'])
244
+ unless validator.valid?(status)
245
+ fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
246
+ end
247
+ @status = status
248
+ end
249
+
250
+ # Custom attribute writer method checking allowed values (enum).
251
+ # @param [Object] payment_mode Object to be assigned
252
+ def payment_mode=(payment_mode)
253
+ validator = EnumAttributeValidator.new('String', ['authorize', 'capture'])
254
+ unless validator.valid?(payment_mode)
255
+ fail ArgumentError, 'invalid value for "payment_mode", must be one of #{validator.allowable_values}.'
256
+ end
257
+ @payment_mode = payment_mode
258
+ end
259
+
260
+ # Checks equality by comparing each attribute.
261
+ # @param [Object] Object to be compared
262
+ def ==(o)
263
+ return true if self.equal?(o)
264
+ self.class == o.class &&
265
+ __meta == o.__meta &&
266
+ created_at == o.created_at &&
267
+ updated_at == o.updated_at &&
268
+ amount == o.amount &&
269
+ order == o.order &&
270
+ payment_source == o.payment_source &&
271
+ currency == o.currency &&
272
+ status == o.status &&
273
+ gateway == o.gateway &&
274
+ payment_mode == o.payment_mode &&
275
+ gateway_operation_id == o.gateway_operation_id
276
+ end
277
+
278
+ # @see the `==` method
279
+ # @param [Object] Object to be compared
280
+ def eql?(o)
281
+ self == o
282
+ end
283
+
284
+ # Calculates hash code according to all attributes.
285
+ # @return [Fixnum] Hash code
286
+ def hash
287
+ [__meta, created_at, updated_at, amount, order, payment_source, currency, status, gateway, payment_mode, gateway_operation_id].hash
288
+ end
289
+
290
+ # Builds the object from hash
291
+ # @param [Hash] attributes Model attributes in the form of hash
292
+ # @return [Object] Returns the model itself
293
+ def build_from_hash(attributes)
294
+ return nil unless attributes.is_a?(Hash)
295
+ self.class.swagger_types.each_pair do |key, type|
296
+ if type =~ /\AArray<(.*)>/i
297
+ # check to ensure the input is an array given that the the attribute
298
+ # is documented as an array but the input is not
299
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
300
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
301
+ end
302
+ elsif !attributes[self.class.attribute_map[key]].nil?
303
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
304
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
305
+ end
306
+
307
+ self
308
+ end
309
+
310
+ # Deserializes the data based on type
311
+ # @param string type Data type
312
+ # @param string value Value to be deserialized
313
+ # @return [Object] Deserialized data
314
+ def _deserialize(type, value)
315
+ case type.to_sym
316
+ when :DateTime
317
+ DateTime.parse(value)
318
+ when :Date
319
+ Date.parse(value)
320
+ when :String
321
+ value.to_s
322
+ when :Integer
323
+ value.to_i
324
+ when :Float
325
+ value.to_f
326
+ when :BOOLEAN
327
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
328
+ true
329
+ else
330
+ false
331
+ end
332
+ when :Object
333
+ # generic object (usually a Hash), return directly
334
+ value
335
+ when /\AArray<(?<inner_type>.+)>\z/
336
+ inner_type = Regexp.last_match[:inner_type]
337
+ value.map { |v| _deserialize(inner_type, v) }
338
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
339
+ k_type = Regexp.last_match[:k_type]
340
+ v_type = Regexp.last_match[:v_type]
341
+ {}.tap do |hash|
342
+ value.each do |k, v|
343
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
344
+ end
345
+ end
346
+ else # model
347
+ temp_model = Tradenity.const_get(type).new
348
+ temp_model.build_from_hash(value)
349
+ end
350
+ end
351
+
352
+ # Returns the string representation of the object
353
+ # @return [String] String presentation of the object
354
+ def to_s
355
+ to_hash.to_s
356
+ end
357
+
358
+ # to_body is an alias to to_hash (backward compatibility)
359
+ # @return [Hash] Returns the object in the form of hash
360
+ def to_body
361
+ to_hash
362
+ end
363
+
364
+ # Returns the object in the form of hash
365
+ # @return [Hash] Returns the object in the form of hash
366
+ def to_hash
367
+ hash = {}
368
+ self.class.attribute_map.each_pair do |attr, param|
369
+ value = self.send(attr)
370
+ next if value.nil?
371
+ hash[param] = _to_hash(value)
372
+ end
373
+ hash
374
+ end
375
+
376
+ # Outputs non-array value in the form of hash
377
+ # For object, use to_hash. Otherwise, just return the value
378
+ # @param [Object] value Any valid value
379
+ # @return [Hash] Returns the value in the form of hash
380
+ def _to_hash(value)
381
+ if value.is_a?(Array)
382
+ value.compact.map { |v| _to_hash(v) }
383
+ elsif value.is_a?(Hash)
384
+ {}.tap do |hash|
385
+ value.each { |k, v| hash[k] = _to_hash(v) }
386
+ end
387
+ elsif value.respond_to? :to_hash
388
+ value.to_hash
389
+ else
390
+ value
391
+ end
392
+ end
393
+
394
+
395
+ def self.api_client
396
+ ApiClient.default
397
+ end
398
+
399
+ # Create CreditCardPayment
400
+ # Create a new CreditCardPayment
401
+ def create
402
+ data = self.class.create_credit_card_payment(self)
403
+ self.id = data.id
404
+ data
405
+ end
406
+
407
+ # Update CreditCardPayment
408
+ # Update attributes of CreditCardPayment
409
+ # @return [CreditCardPayment]
410
+ def update
411
+ self.class.update_credit_card_payment_by_id(self.id, self)
412
+ end
413
+
414
+ # Delete CreditCardPayment
415
+ # Delete this instance of CreditCardPayment.
416
+ # @return [nil]
417
+ def delete
418
+ self.class.delete_credit_card_payment_by_id(self.id)
419
+ end
420
+
421
+ class << self
422
+
423
+ # List CreditCardPayments
424
+ # Return a list of CreditCardPayments
425
+ # @param [Hash] opts the optional parameters
426
+ # @return [Page<CreditCardPayment>]
427
+ def find_all
428
+ list_all_credit_card_payments
429
+ end
430
+
431
+ # Find List of CreditCardPayment
432
+ # Return multiple instances of CreditCardPayment by its attributes.
433
+ # @param [Hash] opts the search parameters
434
+ # @return [Page<Collection>]
435
+ def find_all_by(opts = {})
436
+ list_all_credit_card_payments(opts)
437
+ end
438
+
439
+ # Find CreditCardPayment by its parameters
440
+ # Return single instance of Collection by its attributes.
441
+ # @param [Hash] opts search parameters
442
+ # @return [CreditCardPayment]
443
+ def find_one_by(opts = {})
444
+ list_all_credit_card_payments(opts)[0]
445
+ end
446
+
447
+ # Find CreditCardPayment
448
+ # Return single instance of CreditCardPayment by its ID.
449
+ # @param id ID of CreditCardPayment to return
450
+ # @return [CreditCardPayment]
451
+ def find_by_id(id)
452
+ get_credit_card_payment_by_id(id)
453
+ end
454
+
455
+ # Delete CreditCardPayment
456
+ # Delete an instance of CreditCardPayment by its ID.
457
+ # @param id ID of CreditCardPayment to delete.
458
+ # @return [nil]
459
+ def delete_by_id(id)
460
+ delete_credit_card_payment_by_id(id)
461
+ end
462
+
463
+ # Create CreditCardPayment
464
+ # Create a new CreditCardPayment
465
+ # @param credit_card_payment Attributes of creditCardPayment to create
466
+ # @param [Hash] opts the optional parameters
467
+ # @return [CreditCardPayment]
468
+ def create_credit_card_payment(credit_card_payment, opts = {})
469
+ data, _status_code, _headers = create_credit_card_payment_with_http_info(credit_card_payment, opts)
470
+ data
471
+ end
472
+
473
+ # Create CreditCardPayment
474
+ # Create a new CreditCardPayment
475
+ # @param credit_card_payment Attributes of creditCardPayment to create
476
+ # @param [Hash] opts the optional parameters
477
+ # @return [Array<(CreditCardPayment, Fixnum, Hash)>] CreditCardPayment data, response status code and response headers
478
+ def create_credit_card_payment_with_http_info(credit_card_payment, opts = {})
479
+ if api_client.config.debugging
480
+ api_client.config.logger.debug 'Calling API: CreditCardPayment.create_credit_card_payment ...'
481
+ end
482
+ # verify the required parameter 'credit_card_payment' is set
483
+ if api_client.config.client_side_validation && credit_card_payment.nil?
484
+ fail ArgumentError, "Missing the required parameter 'credit_card_payment' when calling CreditCardPayment.create_credit_card_payment"
485
+ end
486
+ # resource path
487
+ local_var_path = '/creditCardPayments'
488
+
489
+ # query parameters
490
+ query_params = opts
491
+
492
+ # header parameters
493
+ header_params = {}
494
+ # HTTP header 'Accept' (if needed)
495
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
496
+ # HTTP header 'Content-Type'
497
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
498
+
499
+ # form parameters
500
+ form_params = {}
501
+
502
+ # http body (model)
503
+ post_body = api_client.object_to_http_body(credit_card_payment)
504
+ auth_names = []
505
+ data, status_code, headers = api_client.call_api(:POST, local_var_path,
506
+ :header_params => header_params,
507
+ :query_params => query_params,
508
+ :form_params => form_params,
509
+ :body => post_body,
510
+ :auth_names => auth_names,
511
+ :return_type => 'CreditCardPayment')
512
+ if api_client.config.debugging
513
+ api_client.config.logger.debug "API called: CreditCardPayment#create_credit_card_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
514
+ end
515
+ return data, status_code, headers
516
+ end
517
+ # Delete CreditCardPayment
518
+ # Delete an instance of CreditCardPayment by its ID.
519
+ # @param credit_card_payment_id ID of creditCardPayment to delete.
520
+ # @param [Hash] opts the optional parameters
521
+ # @return [nil]
522
+ def delete_credit_card_payment_by_id(credit_card_payment_id, opts = {})
523
+ delete_credit_card_payment_by_id_with_http_info(credit_card_payment_id, opts)
524
+ nil
525
+ end
526
+
527
+ # Delete CreditCardPayment
528
+ # Delete an instance of CreditCardPayment by its ID.
529
+ # @param credit_card_payment_id ID of creditCardPayment to delete.
530
+ # @param [Hash] opts the optional parameters
531
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
532
+ def delete_credit_card_payment_by_id_with_http_info(credit_card_payment_id, opts = {})
533
+ if api_client.config.debugging
534
+ api_client.config.logger.debug 'Calling API: CreditCardPayment.delete_credit_card_payment_by_id ...'
535
+ end
536
+ # verify the required parameter 'credit_card_payment_id' is set
537
+ if api_client.config.client_side_validation && credit_card_payment_id.nil?
538
+ fail ArgumentError, "Missing the required parameter 'credit_card_payment_id' when calling CreditCardPayment.delete_credit_card_payment_by_id"
539
+ end
540
+ # resource path
541
+ local_var_path = '/creditCardPayments/{creditCardPaymentId}'.sub('{' + 'creditCardPaymentId' + '}', credit_card_payment_id.to_s)
542
+
543
+ # query parameters
544
+ query_params = opts
545
+
546
+ # header parameters
547
+ header_params = {}
548
+ # HTTP header 'Accept' (if needed)
549
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
550
+ # HTTP header 'Content-Type'
551
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
552
+
553
+ # form parameters
554
+ form_params = {}
555
+
556
+ # http body (model)
557
+ post_body = nil
558
+ auth_names = []
559
+ data, status_code, headers = api_client.call_api(:DELETE, local_var_path,
560
+ :header_params => header_params,
561
+ :query_params => query_params,
562
+ :form_params => form_params,
563
+ :body => post_body,
564
+ :auth_names => auth_names)
565
+ if api_client.config.debugging
566
+ api_client.config.logger.debug "API called: CreditCardPayment#delete_credit_card_payment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
567
+ end
568
+ return data, status_code, headers
569
+ end
570
+ # Find CreditCardPayment
571
+ # Return single instance of CreditCardPayment by its ID.
572
+ # @param credit_card_payment_id ID of creditCardPayment to return
573
+ # @param [Hash] opts the optional parameters
574
+ # @return [CreditCardPayment]
575
+ def get_credit_card_payment_by_id(credit_card_payment_id, opts = {})
576
+ data, _status_code, _headers = get_credit_card_payment_by_id_with_http_info(credit_card_payment_id, opts)
577
+ data
578
+ end
579
+
580
+ # Find CreditCardPayment
581
+ # Return single instance of CreditCardPayment by its ID.
582
+ # @param credit_card_payment_id ID of creditCardPayment to return
583
+ # @param [Hash] opts the optional parameters
584
+ # @return [Array<(CreditCardPayment, Fixnum, Hash)>] CreditCardPayment data, response status code and response headers
585
+ def get_credit_card_payment_by_id_with_http_info(credit_card_payment_id, opts = {})
586
+ if api_client.config.debugging
587
+ api_client.config.logger.debug 'Calling API: CreditCardPayment.get_credit_card_payment_by_id ...'
588
+ end
589
+ # verify the required parameter 'credit_card_payment_id' is set
590
+ if api_client.config.client_side_validation && credit_card_payment_id.nil?
591
+ fail ArgumentError, "Missing the required parameter 'credit_card_payment_id' when calling CreditCardPayment.get_credit_card_payment_by_id"
592
+ end
593
+ # resource path
594
+ local_var_path = '/creditCardPayments/{creditCardPaymentId}'.sub('{' + 'creditCardPaymentId' + '}', credit_card_payment_id.to_s)
595
+
596
+ # query parameters
597
+ query_params = opts
598
+
599
+ # header parameters
600
+ header_params = {}
601
+ # HTTP header 'Accept' (if needed)
602
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
603
+ # HTTP header 'Content-Type'
604
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
605
+
606
+ # form parameters
607
+ form_params = {}
608
+
609
+ # http body (model)
610
+ post_body = nil
611
+ auth_names = []
612
+ data, status_code, headers = api_client.call_api(:GET, local_var_path,
613
+ :header_params => header_params,
614
+ :query_params => query_params,
615
+ :form_params => form_params,
616
+ :body => post_body,
617
+ :auth_names => auth_names,
618
+ :return_type => 'CreditCardPayment')
619
+ if api_client.config.debugging
620
+ api_client.config.logger.debug "API called: CreditCardPayment#get_credit_card_payment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
621
+ end
622
+ return data, status_code, headers
623
+ end
624
+ # List CreditCardPayments
625
+ # Return a list of CreditCardPayments
626
+ # @param [Hash] opts the optional parameters
627
+ # @option opts [Integer] :page page number
628
+ # @option opts [Integer] :size page size
629
+ # @option opts [String] :sort page order
630
+ # @return [Page<CreditCardPayment>]
631
+ def list_all_credit_card_payments(opts = {})
632
+ data, _status_code, _headers = list_all_credit_card_payments_with_http_info(opts)
633
+ data
634
+ end
635
+
636
+ # List CreditCardPayments
637
+ # Return a list of CreditCardPayments
638
+ # @param [Hash] opts the optional parameters
639
+ # @option opts [Integer] :page page number
640
+ # @option opts [Integer] :size page size
641
+ # @option opts [String] :sort page order
642
+ # @return [Array<(Page<CreditCardPayment>, Fixnum, Hash)>] Page<CreditCardPayment> data, response status code and response headers
643
+ def list_all_credit_card_payments_with_http_info(opts = {})
644
+ if api_client.config.debugging
645
+ api_client.config.logger.debug 'Calling API: CreditCardPayment.list_all_credit_card_payments ...'
646
+ end
647
+ # resource path
648
+ local_var_path = '/creditCardPayments'
649
+
650
+ # query parameters
651
+ query_params = opts
652
+ # query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
653
+ # query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
654
+ # query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
655
+
656
+ # header parameters
657
+ header_params = {}
658
+ # HTTP header 'Accept' (if needed)
659
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
660
+ # HTTP header 'Content-Type'
661
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
662
+
663
+ # form parameters
664
+ form_params = {}
665
+
666
+ # http body (model)
667
+ post_body = nil
668
+ auth_names = []
669
+ data, status_code, headers = api_client.call_api(:GET, local_var_path,
670
+ :header_params => header_params,
671
+ :query_params => query_params,
672
+ :form_params => form_params,
673
+ :body => post_body,
674
+ :auth_names => auth_names,
675
+ :return_type => 'Page<CreditCardPayment>')
676
+ if api_client.config.debugging
677
+ api_client.config.logger.debug "API called: CreditCardPayment#list_all_credit_card_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
678
+ end
679
+ return data, status_code, headers
680
+ end
681
+ # Replace CreditCardPayment
682
+ # Replace all attributes of CreditCardPayment
683
+ # @param credit_card_payment_id ID of creditCardPayment to replace
684
+ # @param credit_card_payment Attributes of creditCardPayment to replace
685
+ # @param [Hash] opts the optional parameters
686
+ # @return [CreditCardPayment]
687
+ def replace_credit_card_payment_by_id(credit_card_payment_id, credit_card_payment, opts = {})
688
+ data, _status_code, _headers = replace_credit_card_payment_by_id_with_http_info(credit_card_payment_id, credit_card_payment, opts)
689
+ data
690
+ end
691
+
692
+ # Replace CreditCardPayment
693
+ # Replace all attributes of CreditCardPayment
694
+ # @param credit_card_payment_id ID of creditCardPayment to replace
695
+ # @param credit_card_payment Attributes of creditCardPayment to replace
696
+ # @param [Hash] opts the optional parameters
697
+ # @return [Array<(CreditCardPayment, Fixnum, Hash)>] CreditCardPayment data, response status code and response headers
698
+ def replace_credit_card_payment_by_id_with_http_info(credit_card_payment_id, credit_card_payment, opts = {})
699
+ if api_client.config.debugging
700
+ api_client.config.logger.debug 'Calling API: CreditCardPayment.replace_credit_card_payment_by_id ...'
701
+ end
702
+ # verify the required parameter 'credit_card_payment_id' is set
703
+ if api_client.config.client_side_validation && credit_card_payment_id.nil?
704
+ fail ArgumentError, "Missing the required parameter 'credit_card_payment_id' when calling CreditCardPayment.replace_credit_card_payment_by_id"
705
+ end
706
+ # verify the required parameter 'credit_card_payment' is set
707
+ if api_client.config.client_side_validation && credit_card_payment.nil?
708
+ fail ArgumentError, "Missing the required parameter 'credit_card_payment' when calling CreditCardPayment.replace_credit_card_payment_by_id"
709
+ end
710
+ # resource path
711
+ local_var_path = '/creditCardPayments/{creditCardPaymentId}'.sub('{' + 'creditCardPaymentId' + '}', credit_card_payment_id.to_s)
712
+
713
+ # query parameters
714
+ query_params = opts
715
+
716
+ # header parameters
717
+ header_params = {}
718
+ # HTTP header 'Accept' (if needed)
719
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
720
+ # HTTP header 'Content-Type'
721
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
722
+
723
+ # form parameters
724
+ form_params = {}
725
+
726
+ # http body (model)
727
+ post_body = api_client.object_to_http_body(credit_card_payment)
728
+ auth_names = []
729
+ data, status_code, headers = api_client.call_api(:PUT, local_var_path,
730
+ :header_params => header_params,
731
+ :query_params => query_params,
732
+ :form_params => form_params,
733
+ :body => post_body,
734
+ :auth_names => auth_names,
735
+ :return_type => 'CreditCardPayment')
736
+ if api_client.config.debugging
737
+ api_client.config.logger.debug "API called: CreditCardPayment#replace_credit_card_payment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
738
+ end
739
+ return data, status_code, headers
740
+ end
741
+ # Update CreditCardPayment
742
+ # Update attributes of CreditCardPayment
743
+ # @param credit_card_payment_id ID of creditCardPayment to update.
744
+ # @param credit_card_payment Attributes of creditCardPayment to update.
745
+ # @param [Hash] opts the optional parameters
746
+ # @return [CreditCardPayment]
747
+ def update_credit_card_payment_by_id(credit_card_payment_id, credit_card_payment, opts = {})
748
+ data, _status_code, _headers = update_credit_card_payment_by_id_with_http_info(credit_card_payment_id, credit_card_payment, opts)
749
+ data
750
+ end
751
+
752
+ # Update CreditCardPayment
753
+ # Update attributes of CreditCardPayment
754
+ # @param credit_card_payment_id ID of creditCardPayment to update.
755
+ # @param credit_card_payment Attributes of creditCardPayment to update.
756
+ # @param [Hash] opts the optional parameters
757
+ # @return [Array<(CreditCardPayment, Fixnum, Hash)>] CreditCardPayment data, response status code and response headers
758
+ def update_credit_card_payment_by_id_with_http_info(credit_card_payment_id, credit_card_payment, opts = {})
759
+ if api_client.config.debugging
760
+ api_client.config.logger.debug 'Calling API: CreditCardPayment.update_credit_card_payment_by_id ...'
761
+ end
762
+ # verify the required parameter 'credit_card_payment_id' is set
763
+ if api_client.config.client_side_validation && credit_card_payment_id.nil?
764
+ fail ArgumentError, "Missing the required parameter 'credit_card_payment_id' when calling CreditCardPayment.update_credit_card_payment_by_id"
765
+ end
766
+ # verify the required parameter 'credit_card_payment' is set
767
+ if api_client.config.client_side_validation && credit_card_payment.nil?
768
+ fail ArgumentError, "Missing the required parameter 'credit_card_payment' when calling CreditCardPayment.update_credit_card_payment_by_id"
769
+ end
770
+ # resource path
771
+ local_var_path = '/creditCardPayments/{creditCardPaymentId}'.sub('{' + 'creditCardPaymentId' + '}', credit_card_payment_id.to_s)
772
+
773
+ # query parameters
774
+ query_params = opts
775
+
776
+ # header parameters
777
+ header_params = {}
778
+ # HTTP header 'Accept' (if needed)
779
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
780
+ # HTTP header 'Content-Type'
781
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
782
+
783
+ # form parameters
784
+ form_params = {}
785
+
786
+ # http body (model)
787
+ post_body = api_client.object_to_http_body(credit_card_payment)
788
+ auth_names = []
789
+ data, status_code, headers = api_client.call_api(:PATCH, local_var_path,
790
+ :header_params => header_params,
791
+ :query_params => query_params,
792
+ :form_params => form_params,
793
+ :body => post_body,
794
+ :auth_names => auth_names,
795
+ :return_type => 'CreditCardPayment')
796
+ if api_client.config.debugging
797
+ api_client.config.logger.debug "API called: CreditCardPayment#update_credit_card_payment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
798
+ end
799
+ return data, status_code, headers
800
+ end
801
+ end
802
+ end
803
+ end