lago-ruby-client 0.33.0.pre.beta → 0.34.1.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/client.rb +4 -4
- data/lib/lago/api/resources/{applied_tax_rate.rb → applied_tax.rb} +10 -10
- data/lib/lago/api/resources/credit_note.rb +4 -2
- data/lib/lago/api/resources/plan.rb +1 -1
- data/lib/lago/api/resources/{tax_rate.rb → tax.rb} +6 -6
- data/lib/lago/version.rb +1 -1
- data/lib/lago-ruby-client.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acd91ca0f3859e9fb901f220b67e7bbd56c8945468ea36a0130dbf1118ca5f4e
|
4
|
+
data.tar.gz: cf3daedef626aba321dd8d788f3781f3e0406dcec964c4b493351f4929724862
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d567e76f0d7ee187f42617569af3067e8edcf84efc4c4f3b49b3e635de39c65966a9e0d072792fc0a532ad37bc542b68fab28100b5fc2c4038da86f3b5b957f0
|
7
|
+
data.tar.gz: ab54777b7f4b72b791dcaf0e3bf208204f4f9c11177faf05f7d1af36ab138218bfa10560d640ee8f8d9dadd7a6845b708264c03b5ed4f8c81e07e013cf3c4655
|
data/lib/lago/api/client.rb
CHANGED
@@ -51,8 +51,8 @@ module Lago
|
|
51
51
|
Lago::Api::Resources::AppliedAddOn.new(self)
|
52
52
|
end
|
53
53
|
|
54
|
-
def
|
55
|
-
Lago::Api::Resources::
|
54
|
+
def applied_taxes
|
55
|
+
Lago::Api::Resources::AppliedTax.new(self)
|
56
56
|
end
|
57
57
|
|
58
58
|
def billable_metrics
|
@@ -79,8 +79,8 @@ module Lago
|
|
79
79
|
Lago::Api::Resources::Organization.new(self)
|
80
80
|
end
|
81
81
|
|
82
|
-
def
|
83
|
-
Lago::Api::Resources::
|
82
|
+
def taxes
|
83
|
+
Lago::Api::Resources::Tax.new(self)
|
84
84
|
end
|
85
85
|
|
86
86
|
def wallets
|
@@ -3,26 +3,26 @@
|
|
3
3
|
module Lago
|
4
4
|
module Api
|
5
5
|
module Resources
|
6
|
-
class
|
6
|
+
class AppliedTax < Base
|
7
7
|
def api_resource
|
8
|
-
'
|
8
|
+
'applied_tax'
|
9
9
|
end
|
10
10
|
|
11
11
|
def root_name
|
12
|
-
'
|
12
|
+
'applied_tax'
|
13
13
|
end
|
14
14
|
|
15
15
|
def create(external_customer_id, params)
|
16
|
-
path = "/api/v1/customers/#{external_customer_id}/
|
16
|
+
path = "/api/v1/customers/#{external_customer_id}/applied_taxes"
|
17
17
|
payload = whitelist_params(params)
|
18
18
|
response = connection.post(payload, path)[root_name]
|
19
|
-
|
19
|
+
|
20
20
|
JSON.parse(response.to_json, object_class: OpenStruct)
|
21
21
|
end
|
22
22
|
|
23
|
-
def destroy(external_customer_id,
|
24
|
-
path = "/api/v1/customers/#{external_customer_id}/
|
25
|
-
response = connection.destroy(path, identifier:
|
23
|
+
def destroy(external_customer_id, tax_code)
|
24
|
+
path = "/api/v1/customers/#{external_customer_id}/applied_taxes"
|
25
|
+
response = connection.destroy(path, identifier: tax_code)[root_name]
|
26
26
|
|
27
27
|
JSON.parse(response.to_json, object_class: OpenStruct)
|
28
28
|
end
|
@@ -30,8 +30,8 @@ module Lago
|
|
30
30
|
def whitelist_params(params)
|
31
31
|
{
|
32
32
|
root_name => {
|
33
|
-
|
34
|
-
}.compact
|
33
|
+
tax_code: params[:tax_code],
|
34
|
+
}.compact,
|
35
35
|
}
|
36
36
|
end
|
37
37
|
end
|
@@ -16,7 +16,9 @@ module Lago
|
|
16
16
|
result_hash = {
|
17
17
|
invoice_id: params[:invoice_id],
|
18
18
|
reason: params[:reason],
|
19
|
-
refund_status: params[:refund_status]
|
19
|
+
refund_status: params[:refund_status],
|
20
|
+
credit_amount_cents: params[:credit_amount_cents],
|
21
|
+
refund_amount_cents: params[:refund_amount_cents],
|
20
22
|
}.compact
|
21
23
|
|
22
24
|
whitelist_items(params[:items] || []).tap do |items|
|
@@ -29,7 +31,7 @@ module Lago
|
|
29
31
|
def whitelist_items(items)
|
30
32
|
items.each_with_object([]) do |item, result|
|
31
33
|
filtered_item = (item || {}).slice(
|
32
|
-
:fee_id, :
|
34
|
+
:fee_id, :amount_cents
|
33
35
|
)
|
34
36
|
|
35
37
|
result << filtered_item unless filtered_item.empty?
|
@@ -3,13 +3,13 @@
|
|
3
3
|
module Lago
|
4
4
|
module Api
|
5
5
|
module Resources
|
6
|
-
class
|
6
|
+
class Tax < Base
|
7
7
|
def api_resource
|
8
|
-
'
|
8
|
+
'taxes'
|
9
9
|
end
|
10
10
|
|
11
11
|
def root_name
|
12
|
-
'
|
12
|
+
'tax'
|
13
13
|
end
|
14
14
|
|
15
15
|
def whitelist_params(params)
|
@@ -17,10 +17,10 @@ module Lago
|
|
17
17
|
root_name => {
|
18
18
|
name: params[:name],
|
19
19
|
code: params[:code],
|
20
|
-
|
20
|
+
rate: params[:rate],
|
21
21
|
description: params[:description],
|
22
|
-
|
23
|
-
}.compact
|
22
|
+
applied_to_organization: params[:applied_to_organization],
|
23
|
+
}.compact,
|
24
24
|
}
|
25
25
|
end
|
26
26
|
end
|
data/lib/lago/version.rb
CHANGED
data/lib/lago-ruby-client.rb
CHANGED
@@ -15,7 +15,7 @@ require 'lago/api/resources/base'
|
|
15
15
|
require 'lago/api/resources/add_on'
|
16
16
|
require 'lago/api/resources/applied_add_on'
|
17
17
|
require 'lago/api/resources/applied_coupon'
|
18
|
-
require 'lago/api/resources/
|
18
|
+
require 'lago/api/resources/applied_tax'
|
19
19
|
require 'lago/api/resources/billable_metric'
|
20
20
|
require 'lago/api/resources/coupon'
|
21
21
|
require 'lago/api/resources/credit_note'
|
@@ -27,7 +27,7 @@ require 'lago/api/resources/invoice'
|
|
27
27
|
require 'lago/api/resources/organization'
|
28
28
|
require 'lago/api/resources/plan'
|
29
29
|
require 'lago/api/resources/subscription'
|
30
|
-
require 'lago/api/resources/
|
30
|
+
require 'lago/api/resources/tax'
|
31
31
|
require 'lago/api/resources/wallet'
|
32
32
|
require 'lago/api/resources/wallet_transaction'
|
33
33
|
require 'lago/api/resources/webhook'
|
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.34.1.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-05-
|
11
|
+
date: 2023-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -136,7 +136,7 @@ files:
|
|
136
136
|
- lib/lago/api/resources/add_on.rb
|
137
137
|
- lib/lago/api/resources/applied_add_on.rb
|
138
138
|
- lib/lago/api/resources/applied_coupon.rb
|
139
|
-
- lib/lago/api/resources/
|
139
|
+
- lib/lago/api/resources/applied_tax.rb
|
140
140
|
- lib/lago/api/resources/base.rb
|
141
141
|
- lib/lago/api/resources/billable_metric.rb
|
142
142
|
- lib/lago/api/resources/coupon.rb
|
@@ -149,7 +149,7 @@ files:
|
|
149
149
|
- lib/lago/api/resources/organization.rb
|
150
150
|
- lib/lago/api/resources/plan.rb
|
151
151
|
- lib/lago/api/resources/subscription.rb
|
152
|
-
- lib/lago/api/resources/
|
152
|
+
- lib/lago/api/resources/tax.rb
|
153
153
|
- lib/lago/api/resources/wallet.rb
|
154
154
|
- lib/lago/api/resources/wallet_transaction.rb
|
155
155
|
- lib/lago/api/resources/webhook.rb
|