lago-ruby-client 0.39.0.pre.beta → 0.42.0.pre.beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b6dbc90312ccbab37f687fe7c7a930e0a55eb2f08fce005c2093698f76fa03a
4
- data.tar.gz: 204cc8aa9b6cee9066165f7c2114f56b455acadd2010dfdfb034418403f736c3
3
+ metadata.gz: 9c74ed77303be8ec35b3c733ba128cb238122a688df86246550a5395a1e59f0d
4
+ data.tar.gz: 23953066533a3d163692fe938f88358bacdd42fb1a67b0a9149c72d78fdc5ff5
5
5
  SHA512:
6
- metadata.gz: f6f9c9ab67d5d5d0053cf85eecee516f214c84aa2a08f7221c0f0d68360b305c436e7d07f91657c88ba200656289edcad593b888c975d28ce2dea74396db0641
7
- data.tar.gz: fd9d4016dd56a503b420b0dc15c4948a7e9784f7b8566447f81d539316970bd61d17b2263ffd8a38c34c1826322a61c70ec43d664e7b4a0142350c7fc9851cb7
6
+ metadata.gz: 8a2e897c9b87db9666e4572dc459758ff4dc844c8a1835468b1a126841726f652eb67e6a4d8fc6229375c4b49b7d059bbc05c4e9e74afc200130bab6b39946af
7
+ data.tar.gz: 3ec3a01afa6a4cd97945974923f8d4b8bdf6f8bdd878c696c615d7bace7b42d9f98b878895ae6947c40ec6bb06b198053571a7aaaed4864ea1eed715f4edf5d5
@@ -51,10 +51,6 @@ module Lago
51
51
  Lago::Api::Resources::AppliedAddOn.new(self)
52
52
  end
53
53
 
54
- def applied_taxes
55
- Lago::Api::Resources::AppliedTax.new(self)
56
- end
57
-
58
54
  def billable_metrics
59
55
  Lago::Api::Resources::BillableMetric.new(self)
60
56
  end
@@ -94,6 +90,10 @@ module Lago
94
90
  def webhooks
95
91
  Lago::Api::Resources::Webhook.new(self)
96
92
  end
93
+
94
+ def webhook_endpoints
95
+ Lago::Api::Resources::WebhookEndpoint.new(self)
96
+ end
97
97
  end
98
98
  end
99
99
  end
@@ -45,8 +45,10 @@ module Lago
45
45
  handle_response(response)
46
46
  end
47
47
 
48
- def destroy(path = uri.path, identifier:)
49
- uri_path = "#{path}/#{identifier}"
48
+ def destroy(path = uri.path, identifier:, options: nil)
49
+ uri_path = path
50
+ uri_path += "/#{identifier}" if identifier
51
+ uri_path += "?#{URI.encode_www_form(options)}" unless options.nil?
50
52
  response = http_client.send_request(
51
53
  'DELETE',
52
54
  uri_path,
@@ -42,8 +42,8 @@ module Lago
42
42
  JSON.parse(response.to_json, object_class: OpenStruct)
43
43
  end
44
44
 
45
- def destroy(identifier)
46
- response = connection.destroy(identifier: identifier)[root_name]
45
+ def destroy(identifier, options: nil)
46
+ response = connection.destroy(identifier: identifier, options: options)[root_name]
47
47
 
48
48
  JSON.parse(response.to_json, object_class: OpenStruct)
49
49
  end
@@ -18,6 +18,7 @@ module Lago
18
18
  name: params[:name],
19
19
  code: params[:code],
20
20
  description: params[:description],
21
+ recurring: params[:recurring],
21
22
  aggregation_type: params[:aggregation_type],
22
23
  field_name: params[:field_name],
23
24
  group: params[:group],
@@ -47,6 +47,7 @@ module Lago
47
47
  url: params[:url],
48
48
  zipcode: params[:zipcode],
49
49
  currency: params[:currency],
50
+ tax_codes: params[:tax_codes],
50
51
  timezone: params[:timezone],
51
52
  }
52
53
 
@@ -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?
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lago
4
+ module Api
5
+ module Resources
6
+ class WebhookEndpoint < Base
7
+ def api_resource
8
+ 'webhook_endpoints'
9
+ end
10
+
11
+ def root_name
12
+ 'webhook_endpoint'
13
+ end
14
+
15
+ def whitelist_params(params)
16
+ {
17
+ root_name => {
18
+ webhook_url: params[:webhook_url],
19
+ }.compact,
20
+ }
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
data/lib/lago/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lago
4
- VERSION = '0.39.0-beta'
4
+ VERSION = '0.42.0-beta'
5
5
  end
@@ -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'
@@ -31,3 +30,4 @@ require 'lago/api/resources/tax'
31
30
  require 'lago/api/resources/wallet'
32
31
  require 'lago/api/resources/wallet_transaction'
33
32
  require 'lago/api/resources/webhook'
33
+ require 'lago/api/resources/webhook_endpoint'
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.39.0.pre.beta
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-06 00:00:00.000000000 Z
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
@@ -153,6 +152,7 @@ files:
153
152
  - lib/lago/api/resources/wallet.rb
154
153
  - lib/lago/api/resources/wallet_transaction.rb
155
154
  - lib/lago/api/resources/webhook.rb
155
+ - lib/lago/api/resources/webhook_endpoint.rb
156
156
  - lib/lago/version.rb
157
157
  homepage: https://github.com/getlago/lago-ruby-client
158
158
  licenses:
@@ -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