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,523 @@
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 Transaction
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
+ class EnumAttributeValidator
43
+ attr_reader :datatype
44
+ attr_reader :allowable_values
45
+
46
+ def initialize(datatype, allowable_values)
47
+ @allowable_values = allowable_values.map do |value|
48
+ case datatype.to_s
49
+ when /Integer/i
50
+ value.to_i
51
+ when /Float/i
52
+ value.to_f
53
+ else
54
+ value
55
+ end
56
+ end
57
+ end
58
+
59
+ def valid?(value)
60
+ !value || allowable_values.include?(value)
61
+ end
62
+ end
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ :'id' => :'id',
68
+ :'__meta' => :'__meta',
69
+ :'created_at' => :'createdAt',
70
+ :'updated_at' => :'updatedAt',
71
+ :'status' => :'status',
72
+ :'type' => :'type'
73
+ }
74
+ end
75
+
76
+ # Attribute type mapping.
77
+ def self.swagger_types
78
+ {
79
+ :'id' => :'String',
80
+ :'__meta' => :'InstanceMeta',
81
+ :'created_at' => :'DateTime',
82
+ :'updated_at' => :'DateTime',
83
+ :'status' => :'String',
84
+ :'type' => :'String'
85
+ }
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ return unless attributes.is_a?(Hash)
92
+
93
+ # convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
95
+ if attributes.has_key?(:'id')
96
+ self.id = attributes[:'id']
97
+ end
98
+
99
+ if attributes.has_key?(:'__meta')
100
+ self.__meta = attributes[:'__meta']
101
+ end
102
+
103
+ if attributes.has_key?(:'createdAt')
104
+ self.created_at = attributes[:'createdAt']
105
+ end
106
+
107
+ if attributes.has_key?(:'created_at')
108
+ self.created_at = attributes[:'created_at']
109
+ end
110
+
111
+ if attributes.has_key?(:'updatedAt')
112
+ self.updated_at = attributes[:'updatedAt']
113
+ end
114
+
115
+ if attributes.has_key?(:'updated_at')
116
+ self.updated_at = attributes[:'updated_at']
117
+ end
118
+
119
+ if attributes.has_key?(:'status')
120
+ self.status = attributes[:'status']
121
+ end
122
+
123
+ if attributes.has_key?(:'type')
124
+ self.type = attributes[:'type']
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ invalid_properties = Array.new
132
+ if @status.nil?
133
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
134
+ end
135
+
136
+ if @type.nil?
137
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
138
+ end
139
+
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ return false if @status.nil?
147
+ status_validator = EnumAttributeValidator.new('String', ['completed', 'pending', 'failed'])
148
+ return false unless status_validator.valid?(@status)
149
+ return false if @type.nil?
150
+ type_validator = EnumAttributeValidator.new('String', ['payment', 'refund'])
151
+ return false unless type_validator.valid?(@type)
152
+ true
153
+ end
154
+
155
+ # Custom attribute writer method checking allowed values (enum).
156
+ # @param [Object] status Object to be assigned
157
+ def status=(status)
158
+ validator = EnumAttributeValidator.new('String', ['completed', 'pending', 'failed'])
159
+ unless validator.valid?(status)
160
+ fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
161
+ end
162
+ @status = status
163
+ end
164
+
165
+ # Custom attribute writer method checking allowed values (enum).
166
+ # @param [Object] type Object to be assigned
167
+ def type=(type)
168
+ validator = EnumAttributeValidator.new('String', ['payment', 'refund'])
169
+ unless validator.valid?(type)
170
+ fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.'
171
+ end
172
+ @type = type
173
+ end
174
+
175
+ # Checks equality by comparing each attribute.
176
+ # @param [Object] Object to be compared
177
+ def ==(o)
178
+ return true if self.equal?(o)
179
+ self.class == o.class &&
180
+ __meta == o.__meta &&
181
+ created_at == o.created_at &&
182
+ updated_at == o.updated_at &&
183
+ status == o.status &&
184
+ type == o.type
185
+ end
186
+
187
+ # @see the `==` method
188
+ # @param [Object] Object to be compared
189
+ def eql?(o)
190
+ self == o
191
+ end
192
+
193
+ # Calculates hash code according to all attributes.
194
+ # @return [Fixnum] Hash code
195
+ def hash
196
+ [__meta, created_at, updated_at, status, type].hash
197
+ end
198
+
199
+ # Builds the object from hash
200
+ # @param [Hash] attributes Model attributes in the form of hash
201
+ # @return [Object] Returns the model itself
202
+ def build_from_hash(attributes)
203
+ return nil unless attributes.is_a?(Hash)
204
+ self.class.swagger_types.each_pair do |key, type|
205
+ if type =~ /\AArray<(.*)>/i
206
+ # check to ensure the input is an array given that the the attribute
207
+ # is documented as an array but the input is not
208
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
209
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
210
+ end
211
+ elsif !attributes[self.class.attribute_map[key]].nil?
212
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
213
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
214
+ end
215
+
216
+ self
217
+ end
218
+
219
+ # Deserializes the data based on type
220
+ # @param string type Data type
221
+ # @param string value Value to be deserialized
222
+ # @return [Object] Deserialized data
223
+ def _deserialize(type, value)
224
+ case type.to_sym
225
+ when :DateTime
226
+ DateTime.parse(value)
227
+ when :Date
228
+ Date.parse(value)
229
+ when :String
230
+ value.to_s
231
+ when :Integer
232
+ value.to_i
233
+ when :Float
234
+ value.to_f
235
+ when :BOOLEAN
236
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
237
+ true
238
+ else
239
+ false
240
+ end
241
+ when :Object
242
+ # generic object (usually a Hash), return directly
243
+ value
244
+ when /\AArray<(?<inner_type>.+)>\z/
245
+ inner_type = Regexp.last_match[:inner_type]
246
+ value.map { |v| _deserialize(inner_type, v) }
247
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
248
+ k_type = Regexp.last_match[:k_type]
249
+ v_type = Regexp.last_match[:v_type]
250
+ {}.tap do |hash|
251
+ value.each do |k, v|
252
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
253
+ end
254
+ end
255
+ else # model
256
+ temp_model = Tradenity.const_get(type).new
257
+ temp_model.build_from_hash(value)
258
+ end
259
+ end
260
+
261
+ # Returns the string representation of the object
262
+ # @return [String] String presentation of the object
263
+ def to_s
264
+ to_hash.to_s
265
+ end
266
+
267
+ # to_body is an alias to to_hash (backward compatibility)
268
+ # @return [Hash] Returns the object in the form of hash
269
+ def to_body
270
+ to_hash
271
+ end
272
+
273
+ # Returns the object in the form of hash
274
+ # @return [Hash] Returns the object in the form of hash
275
+ def to_hash
276
+ hash = {}
277
+ self.class.attribute_map.each_pair do |attr, param|
278
+ value = self.send(attr)
279
+ next if value.nil?
280
+ hash[param] = _to_hash(value)
281
+ end
282
+ hash
283
+ end
284
+
285
+ # Outputs non-array value in the form of hash
286
+ # For object, use to_hash. Otherwise, just return the value
287
+ # @param [Object] value Any valid value
288
+ # @return [Hash] Returns the value in the form of hash
289
+ def _to_hash(value)
290
+ if value.is_a?(Array)
291
+ value.compact.map { |v| _to_hash(v) }
292
+ elsif value.is_a?(Hash)
293
+ {}.tap do |hash|
294
+ value.each { |k, v| hash[k] = _to_hash(v) }
295
+ end
296
+ elsif value.respond_to? :to_hash
297
+ value.to_hash
298
+ else
299
+ value
300
+ end
301
+ end
302
+
303
+
304
+ def self.api_client
305
+ ApiClient.default
306
+ end
307
+
308
+ # Delete Transaction
309
+ # Delete this instance of Transaction.
310
+ # @return [nil]
311
+ def delete
312
+ self.class.delete_transaction_by_id(self.id)
313
+ end
314
+
315
+ class << self
316
+
317
+ # List Transactions
318
+ # Return a list of Transactions
319
+ # @param [Hash] opts the optional parameters
320
+ # @return [Page<Transaction>]
321
+ def find_all
322
+ list_all_transactions
323
+ end
324
+
325
+ # Find List of Transaction
326
+ # Return multiple instances of Transaction by its attributes.
327
+ # @param [Hash] opts the search parameters
328
+ # @return [Page<Collection>]
329
+ def find_all_by(opts = {})
330
+ list_all_transactions(opts)
331
+ end
332
+
333
+ # Find Transaction by its parameters
334
+ # Return single instance of Collection by its attributes.
335
+ # @param [Hash] opts search parameters
336
+ # @return [Transaction]
337
+ def find_one_by(opts = {})
338
+ list_all_transactions(opts)[0]
339
+ end
340
+
341
+ # Find Transaction
342
+ # Return single instance of Transaction by its ID.
343
+ # @param id ID of Transaction to return
344
+ # @return [Transaction]
345
+ def find_by_id(id)
346
+ get_transaction_by_id(id)
347
+ end
348
+
349
+ # Delete Transaction
350
+ # Delete an instance of Transaction by its ID.
351
+ # @param id ID of Transaction to delete.
352
+ # @return [nil]
353
+ def delete_by_id(id)
354
+ delete_transaction_by_id(id)
355
+ end
356
+
357
+ # Delete Transaction
358
+ # Delete an instance of Transaction by its ID.
359
+ # @param transaction_id ID of transaction to delete.
360
+ # @param [Hash] opts the optional parameters
361
+ # @return [nil]
362
+ def delete_transaction_by_id(transaction_id, opts = {})
363
+ delete_transaction_by_id_with_http_info(transaction_id, opts)
364
+ nil
365
+ end
366
+
367
+ # Delete Transaction
368
+ # Delete an instance of Transaction by its ID.
369
+ # @param transaction_id ID of transaction to delete.
370
+ # @param [Hash] opts the optional parameters
371
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
372
+ def delete_transaction_by_id_with_http_info(transaction_id, opts = {})
373
+ if api_client.config.debugging
374
+ api_client.config.logger.debug 'Calling API: Transaction.delete_transaction_by_id ...'
375
+ end
376
+ # verify the required parameter 'transaction_id' is set
377
+ if api_client.config.client_side_validation && transaction_id.nil?
378
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling Transaction.delete_transaction_by_id"
379
+ end
380
+ # resource path
381
+ local_var_path = '/transactions/{transactionId}'.sub('{' + 'transactionId' + '}', transaction_id.to_s)
382
+
383
+ # query parameters
384
+ query_params = opts
385
+
386
+ # header parameters
387
+ header_params = {}
388
+ # HTTP header 'Accept' (if needed)
389
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
390
+ # HTTP header 'Content-Type'
391
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
392
+
393
+ # form parameters
394
+ form_params = {}
395
+
396
+ # http body (model)
397
+ post_body = nil
398
+ auth_names = []
399
+ data, status_code, headers = api_client.call_api(:DELETE, local_var_path,
400
+ :header_params => header_params,
401
+ :query_params => query_params,
402
+ :form_params => form_params,
403
+ :body => post_body,
404
+ :auth_names => auth_names)
405
+ if api_client.config.debugging
406
+ api_client.config.logger.debug "API called: Transaction#delete_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
407
+ end
408
+ return data, status_code, headers
409
+ end
410
+ # Find Transaction
411
+ # Return single instance of Transaction by its ID.
412
+ # @param transaction_id ID of transaction to return
413
+ # @param [Hash] opts the optional parameters
414
+ # @return [Transaction]
415
+ def get_transaction_by_id(transaction_id, opts = {})
416
+ data, _status_code, _headers = get_transaction_by_id_with_http_info(transaction_id, opts)
417
+ data
418
+ end
419
+
420
+ # Find Transaction
421
+ # Return single instance of Transaction by its ID.
422
+ # @param transaction_id ID of transaction to return
423
+ # @param [Hash] opts the optional parameters
424
+ # @return [Array<(Transaction, Fixnum, Hash)>] Transaction data, response status code and response headers
425
+ def get_transaction_by_id_with_http_info(transaction_id, opts = {})
426
+ if api_client.config.debugging
427
+ api_client.config.logger.debug 'Calling API: Transaction.get_transaction_by_id ...'
428
+ end
429
+ # verify the required parameter 'transaction_id' is set
430
+ if api_client.config.client_side_validation && transaction_id.nil?
431
+ fail ArgumentError, "Missing the required parameter 'transaction_id' when calling Transaction.get_transaction_by_id"
432
+ end
433
+ # resource path
434
+ local_var_path = '/transactions/{transactionId}'.sub('{' + 'transactionId' + '}', transaction_id.to_s)
435
+
436
+ # query parameters
437
+ query_params = opts
438
+
439
+ # header parameters
440
+ header_params = {}
441
+ # HTTP header 'Accept' (if needed)
442
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
443
+ # HTTP header 'Content-Type'
444
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
445
+
446
+ # form parameters
447
+ form_params = {}
448
+
449
+ # http body (model)
450
+ post_body = nil
451
+ auth_names = []
452
+ data, status_code, headers = api_client.call_api(:GET, local_var_path,
453
+ :header_params => header_params,
454
+ :query_params => query_params,
455
+ :form_params => form_params,
456
+ :body => post_body,
457
+ :auth_names => auth_names,
458
+ :return_type => 'Transaction')
459
+ if api_client.config.debugging
460
+ api_client.config.logger.debug "API called: Transaction#get_transaction_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
461
+ end
462
+ return data, status_code, headers
463
+ end
464
+ # List Transactions
465
+ # Return a list of Transactions
466
+ # @param [Hash] opts the optional parameters
467
+ # @option opts [Integer] :page page number
468
+ # @option opts [Integer] :size page size
469
+ # @option opts [String] :sort page order
470
+ # @return [Page<Transaction>]
471
+ def list_all_transactions(opts = {})
472
+ data, _status_code, _headers = list_all_transactions_with_http_info(opts)
473
+ data
474
+ end
475
+
476
+ # List Transactions
477
+ # Return a list of Transactions
478
+ # @param [Hash] opts the optional parameters
479
+ # @option opts [Integer] :page page number
480
+ # @option opts [Integer] :size page size
481
+ # @option opts [String] :sort page order
482
+ # @return [Array<(Page<Transaction>, Fixnum, Hash)>] Page<Transaction> data, response status code and response headers
483
+ def list_all_transactions_with_http_info(opts = {})
484
+ if api_client.config.debugging
485
+ api_client.config.logger.debug 'Calling API: Transaction.list_all_transactions ...'
486
+ end
487
+ # resource path
488
+ local_var_path = '/transactions'
489
+
490
+ # query parameters
491
+ query_params = opts
492
+ # query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
493
+ # query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
494
+ # query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
495
+
496
+ # header parameters
497
+ header_params = {}
498
+ # HTTP header 'Accept' (if needed)
499
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
500
+ # HTTP header 'Content-Type'
501
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
502
+
503
+ # form parameters
504
+ form_params = {}
505
+
506
+ # http body (model)
507
+ post_body = nil
508
+ auth_names = []
509
+ data, status_code, headers = api_client.call_api(:GET, local_var_path,
510
+ :header_params => header_params,
511
+ :query_params => query_params,
512
+ :form_params => form_params,
513
+ :body => post_body,
514
+ :auth_names => auth_names,
515
+ :return_type => 'Page<Transaction>')
516
+ if api_client.config.debugging
517
+ api_client.config.logger.debug "API called: Transaction#list_all_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
518
+ end
519
+ return data, status_code, headers
520
+ end
521
+ end
522
+ end
523
+ end
@@ -0,0 +1,7 @@
1
+ require 'bcrypt'
2
+
3
+ module Tradenity
4
+ def valid_password?(password, test_password)
5
+ BCrypt::Password.new(password) == test_password
6
+ end
7
+ end