lago-ruby-client 0.47.0.pre.beta → 0.49.0.pre.beta

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cdb77cda34cce9253e6346276881fdaadeacfdd35d53ab7989ec9429bb66c16
4
- data.tar.gz: 3f090677a5bda43b49803fa806bc125a32548884911b7d83181063096c0cc844
3
+ metadata.gz: 072a79f8acff2afd5899ae8ff2780ec1eba4fc769b3799ee8b465ee5c1941265
4
+ data.tar.gz: 296248f68d455e649dd05b79e6d4092b44d7c1aacf2f37870617348f5a366542
5
5
  SHA512:
6
- metadata.gz: 22bb546383f575dba754bcbeaf62f7a09a5eb2a01adcc4417226ae5bcbb0d03e6fe6568439444eba6cfffafe0c99c2dc051aff5b5fb0c631c9be9d34922280c3
7
- data.tar.gz: b9a13ab8d440f7baf0be609b7442a01bfe9cf6ab5a64e24c3afece9aecbb84ed8191c5e5a4caf3f2342cb1a3ce05c61c17233f631c67a979281082f1e1d633b2
6
+ metadata.gz: 60a9a6bd1bc167e54db965d0feccba55a8f4f57e4ce19da8f55708ba7dd27a3257144329e90f340376e0456998117a6a8ce82811b719e6878bb7c645a1873cd6
7
+ data.tar.gz: 9490fc69ee57f8293f2cf7ca7608bed779b2bbc1444e6a0d3dcafba7d35618eab26868f140608a9c65bac6ffa207f589a474e8d6423059b6140582595957086b
@@ -16,6 +16,7 @@ module Lago
16
16
  {
17
17
  root_name => {
18
18
  name: params[:name],
19
+ invoice_display_name: params[:invoice_display_name],
19
20
  code: params[:code],
20
21
  description: params[:description],
21
22
  amount_cents: params[:amount_cents],
@@ -20,6 +20,7 @@ module Lago
20
20
  description: params[:description],
21
21
  recurring: params[:recurring],
22
22
  aggregation_type: params[:aggregation_type],
23
+ weighted_interval: params[:weighted_interval],
23
24
  field_name: params[:field_name],
24
25
  group: params[:group],
25
26
  }.compact,
@@ -26,6 +26,7 @@ module Lago
26
26
  frequency_duration: params[:frequency_duration],
27
27
  expiration: params[:expiration],
28
28
  expiration_at: params[:expiration_at],
29
+ terminated_at: params[:terminated_at],
29
30
  }.compact
30
31
 
31
32
  whitelist_limitations(params[:applies_to]).tap do |limitations|
@@ -14,14 +14,26 @@ module Lago
14
14
 
15
15
  def current_usage(external_customer_id, external_subscription_id)
16
16
  uri = URI(
17
- "#{client.base_api_url}#{api_resource}/#{external_customer_id}/current_usage?external_subscription_id=#{external_subscription_id}"
17
+ "#{client.base_api_url}#{api_resource}/#{external_customer_id}" \
18
+ "/current_usage?external_subscription_id=#{external_subscription_id}",
18
19
  )
19
20
  connection.get(uri, identifier: nil)
20
21
  end
21
22
 
23
+ def past_usage(external_customer_id, external_subscription_id, options = {})
24
+ uri = URI(
25
+ "#{client.base_api_url}#{api_resource}/#{external_customer_id}/past_usage",
26
+ )
27
+
28
+ connection.get_all(
29
+ options.merge(external_subscription_id: external_subscription_id),
30
+ uri,
31
+ )
32
+ end
33
+
22
34
  def portal_url(external_customer_id)
23
35
  uri = URI(
24
- "#{client.base_api_url}#{api_resource}/#{external_customer_id}/portal_url"
36
+ "#{client.base_api_url}#{api_resource}/#{external_customer_id}/portal_url",
25
37
  )
26
38
 
27
39
  response = connection.get(uri, identifier: nil)[root_name]
@@ -90,7 +90,14 @@ module Lago
90
90
  processed_fees = []
91
91
 
92
92
  fees.each do |f|
93
- result = (f || {}).slice(:add_on_code, :unit_amount_cents, :units, :description, :tax_codes)
93
+ result = (f || {}).slice(
94
+ :add_on_code,
95
+ :unit_amount_cents,
96
+ :units,
97
+ :description,
98
+ :tax_codes,
99
+ :invoice_display_name,
100
+ )
94
101
 
95
102
  processed_fees << result unless result.empty?
96
103
  end
@@ -15,6 +15,7 @@ module Lago
15
15
  def whitelist_params(params)
16
16
  result_hash = {
17
17
  name: params[:name],
18
+ invoice_display_name: params[:invoice_display_name],
18
19
  code: params[:code],
19
20
  interval: params[:interval],
20
21
  description: params[:description],
@@ -43,6 +44,7 @@ module Lago
43
44
  :charge_model,
44
45
  :pay_in_advance,
45
46
  :invoiceable,
47
+ :invoice_display_name,
46
48
  :min_amount_cents,
47
49
  :properties,
48
50
  :group_properties,
@@ -21,6 +21,7 @@ module Lago
21
21
  external_id: params[:external_id],
22
22
  billing_time: params[:billing_time],
23
23
  subscription_at: params[:subscription_at],
24
+ ending_at: params[:ending_at],
24
25
  subscription_date: params[:subscription_date], # Deprecated
25
26
  }.compact
26
27
  }
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.47.0-beta'
4
+ VERSION = '0.49.0-beta'
5
5
  end
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.47.0.pre.beta
4
+ version: 0.49.0.pre.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lovro Colic
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-14 00:00:00.000000000 Z
11
+ date: 2023-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -122,7 +122,7 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
- description:
125
+ description:
126
126
  email:
127
127
  - lovro@getlago.com
128
128
  executables: []
@@ -160,7 +160,7 @@ metadata:
160
160
  homepage_uri: https://www.getlago.com/
161
161
  source_code_uri: https://github.com/getlago/lago-ruby-client
162
162
  documentation_uri: https://doc.getlago.com
163
- post_install_message:
163
+ post_install_message:
164
164
  rdoc_options: []
165
165
  require_paths:
166
166
  - lib
@@ -175,8 +175,8 @@ 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.4.6
179
- signing_key:
178
+ rubygems_version: 3.3.3
179
+ signing_key:
180
180
  specification_version: 4
181
181
  summary: Lago Rest API client
182
182
  test_files: []