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