lago-ruby-client 1.0.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lago/api/resources/billable_metric.rb +1 -0
- data/lib/lago/api/resources/invoice.rb +7 -0
- data/lib/lago/api/resources/plan.rb +13 -0
- data/lib/lago/version.rb +1 -1
- 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: 74c3fdca4d03460c2c27122c72299f31793fb39bd5e198626e6c399190d2163a
|
4
|
+
data.tar.gz: 95d6385f5dc43465dd2139a2a629e345175b0318d6bc3404797a3e5994b907f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad89e21632bf477ced956f38e2406017673d67c80f02d669c03f176cab200b8987f2f06f285c090a083e83ae34ed40f2de4bcee791a2c743c1ad7670c9261848
|
7
|
+
data.tar.gz: 3eb0bc30ce569b0c26a72c4b997dc8e7900fa2bb397b1ee61327f572a430ce54e2c27eec21fc3327ce4612f816d20c50a5dbfbaed386989a6726abcd7a932cd4
|
@@ -42,6 +42,13 @@ module Lago
|
|
42
42
|
JSON.parse(response.to_json, object_class: OpenStruct).invoice
|
43
43
|
end
|
44
44
|
|
45
|
+
def lose_dispute(invoice_id)
|
46
|
+
path = "/api/v1/invoices/#{invoice_id}/lose_dispute"
|
47
|
+
response = connection.put(path, identifier: nil, body: {})
|
48
|
+
|
49
|
+
JSON.parse(response.to_json, object_class: OpenStruct).invoice
|
50
|
+
end
|
51
|
+
|
45
52
|
def retry_payment(invoice_id)
|
46
53
|
path = "/api/v1/invoices/#{invoice_id}/retry_payment"
|
47
54
|
response = connection.post({}, path)
|
@@ -31,9 +31,21 @@ module Lago
|
|
31
31
|
result_hash[:charges] = charges unless charges.empty?
|
32
32
|
end
|
33
33
|
|
34
|
+
whitelist_minimum_commitment(params[:minimum_commitment]).tap do |minimum_commitment|
|
35
|
+
result_hash[:minimum_commitment] = minimum_commitment
|
36
|
+
end
|
37
|
+
|
34
38
|
{ root_name => result_hash }
|
35
39
|
end
|
36
40
|
|
41
|
+
def whitelist_minimum_commitment(minimum_commitment)
|
42
|
+
minimum_commitment&.slice(
|
43
|
+
:amount_cents,
|
44
|
+
:invoice_display_name,
|
45
|
+
:tax_codes,
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
37
49
|
def whitelist_charges(charges)
|
38
50
|
processed_charges = []
|
39
51
|
|
@@ -48,6 +60,7 @@ module Lago
|
|
48
60
|
:min_amount_cents,
|
49
61
|
:properties,
|
50
62
|
:group_properties,
|
63
|
+
:filters,
|
51
64
|
:tax_codes,
|
52
65
|
)
|
53
66
|
|
data/lib/lago/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lago-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lovro Colic
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|