maytes-api-client-rb 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/Checkout.md +2 -0
- data/lib/maytes_api_client/models/checkout.rb +36 -1
- data/lib/maytes_api_client/version.rb +1 -1
- data/spec/models/checkout_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '095b65d3415436b5fc79d2635ec7462cb394e76f051dc3c92949509b7b92f08e'
|
|
4
|
+
data.tar.gz: 538856d9b6882781db6744a367b847341889cb985b9aa52b1e2701d6c006cc55
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 855a277253d3b44001f11b0170a1f5a9f2d3faa1610befc5c2fab3481b1c3509466082653cdf88e0d6c56a715c22b41941ca5f0c514f9b1eeb01066e1f6dbb88
|
|
7
|
+
data.tar.gz: d4af41571ad26567d8c39ab69ca793142d725ca6e811d88713e317e375bbd5200899f8ed4bc3acbe6c5eac20563c0ecabbdbdadf7042f5e1cf2a5ae8210ff718
|
data/docs/Checkout.md
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
| **currency** | **String** | | |
|
|
18
18
|
| **service_fee** | [**Fee**](Fee.md) | | |
|
|
19
19
|
| **refunded_amount** | **Integer** | | |
|
|
20
|
+
| **remaining_amount** | **Integer** | | |
|
|
20
21
|
| **merchant_processor_fee** | **Integer** | | |
|
|
21
22
|
| **merchant_service_fee** | **Integer** | | |
|
|
22
23
|
| **last_refund_at** | **Time** | | |
|
|
@@ -40,6 +41,7 @@ instance = MaytesApiClient::Checkout.new(
|
|
|
40
41
|
currency: null,
|
|
41
42
|
service_fee: null,
|
|
42
43
|
refunded_amount: null,
|
|
44
|
+
remaining_amount: null,
|
|
43
45
|
merchant_processor_fee: null,
|
|
44
46
|
merchant_service_fee: null,
|
|
45
47
|
last_refund_at: null
|
|
@@ -41,6 +41,8 @@ module MaytesApiClient
|
|
|
41
41
|
|
|
42
42
|
attr_accessor :refunded_amount
|
|
43
43
|
|
|
44
|
+
attr_accessor :remaining_amount
|
|
45
|
+
|
|
44
46
|
attr_accessor :merchant_processor_fee
|
|
45
47
|
|
|
46
48
|
attr_accessor :merchant_service_fee
|
|
@@ -63,6 +65,7 @@ module MaytesApiClient
|
|
|
63
65
|
:'currency' => :'currency',
|
|
64
66
|
:'service_fee' => :'service_fee',
|
|
65
67
|
:'refunded_amount' => :'refunded_amount',
|
|
68
|
+
:'remaining_amount' => :'remaining_amount',
|
|
66
69
|
:'merchant_processor_fee' => :'merchant_processor_fee',
|
|
67
70
|
:'merchant_service_fee' => :'merchant_service_fee',
|
|
68
71
|
:'last_refund_at' => :'last_refund_at'
|
|
@@ -95,6 +98,7 @@ module MaytesApiClient
|
|
|
95
98
|
:'currency' => :'String',
|
|
96
99
|
:'service_fee' => :'Fee',
|
|
97
100
|
:'refunded_amount' => :'Integer',
|
|
101
|
+
:'remaining_amount' => :'Integer',
|
|
98
102
|
:'merchant_processor_fee' => :'Integer',
|
|
99
103
|
:'merchant_service_fee' => :'Integer',
|
|
100
104
|
:'last_refund_at' => :'Time'
|
|
@@ -208,6 +212,12 @@ module MaytesApiClient
|
|
|
208
212
|
self.refunded_amount = nil
|
|
209
213
|
end
|
|
210
214
|
|
|
215
|
+
if attributes.key?(:'remaining_amount')
|
|
216
|
+
self.remaining_amount = attributes[:'remaining_amount']
|
|
217
|
+
else
|
|
218
|
+
self.remaining_amount = nil
|
|
219
|
+
end
|
|
220
|
+
|
|
211
221
|
if attributes.key?(:'merchant_processor_fee')
|
|
212
222
|
self.merchant_processor_fee = attributes[:'merchant_processor_fee']
|
|
213
223
|
else
|
|
@@ -264,6 +274,14 @@ module MaytesApiClient
|
|
|
264
274
|
invalid_properties.push('invalid value for "refunded_amount", must be greater than or equal to 0.')
|
|
265
275
|
end
|
|
266
276
|
|
|
277
|
+
if @remaining_amount.nil?
|
|
278
|
+
invalid_properties.push('invalid value for "remaining_amount", remaining_amount cannot be nil.')
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
if @remaining_amount < 0
|
|
282
|
+
invalid_properties.push('invalid value for "remaining_amount", must be greater than or equal to 0.')
|
|
283
|
+
end
|
|
284
|
+
|
|
267
285
|
if @merchant_processor_fee.nil?
|
|
268
286
|
invalid_properties.push('invalid value for "merchant_processor_fee", merchant_processor_fee cannot be nil.')
|
|
269
287
|
end
|
|
@@ -295,6 +313,8 @@ module MaytesApiClient
|
|
|
295
313
|
return false if @service_fee.nil?
|
|
296
314
|
return false if @refunded_amount.nil?
|
|
297
315
|
return false if @refunded_amount < 0
|
|
316
|
+
return false if @remaining_amount.nil?
|
|
317
|
+
return false if @remaining_amount < 0
|
|
298
318
|
return false if @merchant_processor_fee.nil?
|
|
299
319
|
return false if @merchant_processor_fee < 0
|
|
300
320
|
return false if @merchant_service_fee.nil?
|
|
@@ -376,6 +396,20 @@ module MaytesApiClient
|
|
|
376
396
|
@refunded_amount = refunded_amount
|
|
377
397
|
end
|
|
378
398
|
|
|
399
|
+
# Custom attribute writer method with validation
|
|
400
|
+
# @param [Object] remaining_amount Value to be assigned
|
|
401
|
+
def remaining_amount=(remaining_amount)
|
|
402
|
+
if remaining_amount.nil?
|
|
403
|
+
fail ArgumentError, 'remaining_amount cannot be nil'
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
if remaining_amount < 0
|
|
407
|
+
fail ArgumentError, 'invalid value for "remaining_amount", must be greater than or equal to 0.'
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
@remaining_amount = remaining_amount
|
|
411
|
+
end
|
|
412
|
+
|
|
379
413
|
# Custom attribute writer method with validation
|
|
380
414
|
# @param [Object] merchant_processor_fee Value to be assigned
|
|
381
415
|
def merchant_processor_fee=(merchant_processor_fee)
|
|
@@ -422,6 +456,7 @@ module MaytesApiClient
|
|
|
422
456
|
currency == o.currency &&
|
|
423
457
|
service_fee == o.service_fee &&
|
|
424
458
|
refunded_amount == o.refunded_amount &&
|
|
459
|
+
remaining_amount == o.remaining_amount &&
|
|
425
460
|
merchant_processor_fee == o.merchant_processor_fee &&
|
|
426
461
|
merchant_service_fee == o.merchant_service_fee &&
|
|
427
462
|
last_refund_at == o.last_refund_at
|
|
@@ -436,7 +471,7 @@ module MaytesApiClient
|
|
|
436
471
|
# Calculates hash code according to all attributes.
|
|
437
472
|
# @return [Integer] Hash code
|
|
438
473
|
def hash
|
|
439
|
-
[checkout_uuid, merchant_order_id, status, transaction_ref, checkout_url, merchant_expires_at, captured_at, return_url, cancel_url, amount, currency, service_fee, refunded_amount, merchant_processor_fee, merchant_service_fee, last_refund_at].hash
|
|
474
|
+
[checkout_uuid, merchant_order_id, status, transaction_ref, checkout_url, merchant_expires_at, captured_at, return_url, cancel_url, amount, currency, service_fee, refunded_amount, remaining_amount, merchant_processor_fee, merchant_service_fee, last_refund_at].hash
|
|
440
475
|
end
|
|
441
476
|
|
|
442
477
|
# Builds the object from hash
|
|
@@ -105,6 +105,12 @@ describe MaytesApiClient::Checkout do
|
|
|
105
105
|
end
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
+
describe 'test attribute "remaining_amount"' do
|
|
109
|
+
it 'should work' do
|
|
110
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
108
114
|
describe 'test attribute "merchant_processor_fee"' do
|
|
109
115
|
it 'should work' do
|
|
110
116
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: maytes-api-client-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maytes
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|