lago-ruby-client 0.50.0.pre.beta → 0.51.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 +19 -0
- data/lib/lago/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 498d6b5147ab708bbc13406f1b316af58ff461db03dc97065bc010643539afca
|
4
|
+
data.tar.gz: 2f346aa3288af414d787958bcbe941784065fd367f1c44ed301e2ec15aa68533
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74ae5d6737ce4b643aadedd30ff4ab3ba0e3de3fa422ed24d36e71f92e9a76bde03b87a3a642ffcebfd400c336480fbc55f6ba1fd97826a5631e167d0c96c8b9
|
7
|
+
data.tar.gz: '0348874bd1b95be6fa3ca1aa0b6b0ce10e8d3580a65d481d3d84fa7178d161062e4257858f583509380c4f204a0591585f57ac8dd7fb0b59dcc7ff051e9eebad'
|
@@ -57,6 +57,25 @@ module Lago
|
|
57
57
|
|
58
58
|
JSON.parse(response.to_json, object_class: OpenStruct).credit_note
|
59
59
|
end
|
60
|
+
|
61
|
+
def estimate(params)
|
62
|
+
uri = URI("#{client.base_api_url}#{api_resource}/estimate")
|
63
|
+
|
64
|
+
payload = whitelist_estimate_params(params)
|
65
|
+
response = connection.post(payload, uri)['estimated_credit_note']
|
66
|
+
|
67
|
+
JSON.parse(response.to_json, object_class: OpenStruct)
|
68
|
+
end
|
69
|
+
|
70
|
+
def whitelist_estimate_params(params)
|
71
|
+
result_hash = { invoice_id: params[:invoice_id] }.compact
|
72
|
+
|
73
|
+
whitelist_items(params[:items] || []).tap do |items|
|
74
|
+
result_hash[:items] = items unless items.empty?
|
75
|
+
end
|
76
|
+
|
77
|
+
{ root_name => result_hash }
|
78
|
+
end
|
60
79
|
end
|
61
80
|
end
|
62
81
|
end
|
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.51.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-
|
11
|
+
date: 2023-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
- !ruby/object:Gem::Version
|
176
176
|
version: 1.3.1
|
177
177
|
requirements: []
|
178
|
-
rubygems_version: 3.
|
178
|
+
rubygems_version: 3.3.3
|
179
179
|
signing_key:
|
180
180
|
specification_version: 4
|
181
181
|
summary: Lago Rest API client
|