lago-ruby-client 0.19.4.pre.alpha → 0.21.0.pre.beta
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/credit_note.rb +2 -2
- data/lib/lago/api/resources/customer.rb +1 -0
- data/lib/lago/api/resources/invoice.rb +21 -0
- data/lib/lago/api/resources/organization.rb +1 -0
- data/lib/lago/api/resources/wallet_transaction.rb +7 -0
- data/lib/lago/api/resources/webhook.rb +10 -3
- 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: 50da6daf8291cbd8dea4c486649226024d34f60bdbb9a6dfbb82813e78377a26
|
4
|
+
data.tar.gz: 67f45771c036caeb601d9ff8acf2403bf8311a66a447f0e888e3d818163086eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cce95dada793b774a27a3c53662d0ebc7ee5ea5eb1d118bc8cea64dfe08a8de63285099afe091d113196e22a11d8a260c180f55314b3dfef3212bbc2906b9a80
|
7
|
+
data.tar.gz: 1b6793bfae4e8b9a7bc46fa69056fc4b41470edbc08033e083369f1446450a070c6100b05055f02c6ba8485dc67f1e446fbfc1d8b9c2ba58f2dd1cb27ce4a736
|
@@ -40,7 +40,7 @@ module Lago
|
|
40
40
|
path = "/api/v1/credit_notes/#{credit_note_id}/download"
|
41
41
|
response = connection.post({}, path)
|
42
42
|
|
43
|
-
JSON.parse(response.to_json, object_class: OpenStruct)
|
43
|
+
JSON.parse(response.to_json, object_class: OpenStruct).credit_note
|
44
44
|
end
|
45
45
|
|
46
46
|
def void(credit_note_id)
|
@@ -51,7 +51,7 @@ module Lago
|
|
51
51
|
body: {}
|
52
52
|
)
|
53
53
|
|
54
|
-
JSON.parse(response.to_json, object_class: OpenStruct)
|
54
|
+
JSON.parse(response.to_json, object_class: OpenStruct).credit_note
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -16,6 +16,27 @@ module Lago
|
|
16
16
|
path = "/api/v1/invoices/#{invoice_id}/download"
|
17
17
|
response = connection.post({}, path)
|
18
18
|
|
19
|
+
JSON.parse(response.to_json, object_class: OpenStruct).invoice
|
20
|
+
end
|
21
|
+
|
22
|
+
def refresh(invoice_id)
|
23
|
+
path = "/api/v1/invoices/#{invoice_id}/refresh"
|
24
|
+
response = connection.put(path, identifier: nil, body: {})
|
25
|
+
|
26
|
+
JSON.parse(response.to_json, object_class: OpenStruct).invoice
|
27
|
+
end
|
28
|
+
|
29
|
+
def finalize(invoice_id)
|
30
|
+
path = "/api/v1/invoices/#{invoice_id}/finalize"
|
31
|
+
response = connection.put(path, identifier: nil, body: {})
|
32
|
+
|
33
|
+
JSON.parse(response.to_json, object_class: OpenStruct).invoice
|
34
|
+
end
|
35
|
+
|
36
|
+
def retry_payment(invoice_id)
|
37
|
+
path = "/api/v1/invoices/#{invoice_id}/retry_payment"
|
38
|
+
response = connection.post({}, path)
|
39
|
+
|
19
40
|
JSON.parse(response.to_json, object_class: OpenStruct)
|
20
41
|
end
|
21
42
|
|
@@ -12,6 +12,13 @@ module Lago
|
|
12
12
|
'wallet_transactions'
|
13
13
|
end
|
14
14
|
|
15
|
+
def get_all(wallet_id, options = {})
|
16
|
+
path = "/api/v1/wallets/#{wallet_id}/wallet_transactions"
|
17
|
+
response = connection.get_all(options, path)
|
18
|
+
|
19
|
+
JSON.parse(response.to_json, object_class: OpenStruct)
|
20
|
+
end
|
21
|
+
|
15
22
|
def whitelist_params(params)
|
16
23
|
{
|
17
24
|
'wallet_transaction' => {
|
@@ -8,11 +8,18 @@ module Lago
|
|
8
8
|
'webhooks'
|
9
9
|
end
|
10
10
|
|
11
|
+
def root_name
|
12
|
+
'webhook'
|
13
|
+
end
|
14
|
+
|
11
15
|
def public_key
|
12
|
-
path = '/api/v1/webhooks/
|
16
|
+
path = '/api/v1/webhooks/json_public_key'
|
17
|
+
|
18
|
+
response = connection.get(path, identifier: nil)[root_name]
|
19
|
+
|
20
|
+
webhook_details = JSON.parse(response.to_json, object_class: OpenStruct)
|
13
21
|
|
14
|
-
|
15
|
-
OpenSSL::PKey::RSA.new(Base64.decode64(webhooks_public_key))
|
22
|
+
OpenSSL::PKey::RSA.new(Base64.decode64(webhook_details.public_key))
|
16
23
|
end
|
17
24
|
|
18
25
|
def valid_signature?(signature, webhook_payload, cached_key = public_key)
|
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: 0.
|
4
|
+
version: 0.21.0.pre.beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lovro Colic
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|