lago-ruby-client 0.41.0.pre.beta → 0.42.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/client.rb +0 -4
- data/lib/lago/api/resources/customer.rb +1 -0
- data/lib/lago/api/resources/plan.rb +2 -0
- data/lib/lago/version.rb +1 -1
- data/lib/lago-ruby-client.rb +0 -1
- metadata +2 -3
- data/lib/lago/api/resources/applied_tax.rb +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c74ed77303be8ec35b3c733ba128cb238122a688df86246550a5395a1e59f0d
|
4
|
+
data.tar.gz: 23953066533a3d163692fe938f88358bacdd42fb1a67b0a9149c72d78fdc5ff5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a2e897c9b87db9666e4572dc459758ff4dc844c8a1835468b1a126841726f652eb67e6a4d8fc6229375c4b49b7d059bbc05c4e9e74afc200130bab6b39946af
|
7
|
+
data.tar.gz: 3ec3a01afa6a4cd97945974923f8d4b8bdf6f8bdd878c696c615d7bace7b42d9f98b878895ae6947c40ec6bb06b198053571a7aaaed4864ea1eed715f4edf5d5
|
data/lib/lago/api/client.rb
CHANGED
@@ -23,6 +23,7 @@ module Lago
|
|
23
23
|
trial_period: params[:trial_period],
|
24
24
|
pay_in_advance: params[:pay_in_advance],
|
25
25
|
bill_charges_monthly: params[:bill_charges_monthly],
|
26
|
+
tax_codes: params[:tax_codes],
|
26
27
|
}.compact
|
27
28
|
|
28
29
|
whitelist_charges(params[:charges]).tap do |charges|
|
@@ -45,6 +46,7 @@ module Lago
|
|
45
46
|
:min_amount_cents,
|
46
47
|
:properties,
|
47
48
|
:group_properties,
|
49
|
+
:tax_codes,
|
48
50
|
)
|
49
51
|
|
50
52
|
processed_charges << result unless result.empty?
|
data/lib/lago/version.rb
CHANGED
data/lib/lago-ruby-client.rb
CHANGED
@@ -15,7 +15,6 @@ 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/applied_tax'
|
19
18
|
require 'lago/api/resources/billable_metric'
|
20
19
|
require 'lago/api/resources/coupon'
|
21
20
|
require 'lago/api/resources/credit_note'
|
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.42.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-07
|
11
|
+
date: 2023-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -136,7 +136,6 @@ 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/applied_tax.rb
|
140
139
|
- lib/lago/api/resources/base.rb
|
141
140
|
- lib/lago/api/resources/billable_metric.rb
|
142
141
|
- lib/lago/api/resources/coupon.rb
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Lago
|
4
|
-
module Api
|
5
|
-
module Resources
|
6
|
-
class AppliedTax < Base
|
7
|
-
def api_resource
|
8
|
-
'applied_tax'
|
9
|
-
end
|
10
|
-
|
11
|
-
def root_name
|
12
|
-
'applied_tax'
|
13
|
-
end
|
14
|
-
|
15
|
-
def create(external_customer_id, params)
|
16
|
-
path = "/api/v1/customers/#{external_customer_id}/applied_taxes"
|
17
|
-
payload = whitelist_params(params)
|
18
|
-
response = connection.post(payload, path)[root_name]
|
19
|
-
|
20
|
-
JSON.parse(response.to_json, object_class: OpenStruct)
|
21
|
-
end
|
22
|
-
|
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
|
-
|
27
|
-
JSON.parse(response.to_json, object_class: OpenStruct)
|
28
|
-
end
|
29
|
-
|
30
|
-
def whitelist_params(params)
|
31
|
-
{
|
32
|
-
root_name => {
|
33
|
-
tax_code: params[:tax_code],
|
34
|
-
}.compact,
|
35
|
-
}
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|