lago-ruby-client 0.48.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: b827eefb8b303238ec2a42e5cc5d485530d63671c3afe9e6af5c6a5aabb45859
4
- data.tar.gz: 8aca6b61ce1ae31df5df9146ccf6a5ecf5397e2be62da93bc45ca1f6b84bf45b
3
+ metadata.gz: 072a79f8acff2afd5899ae8ff2780ec1eba4fc769b3799ee8b465ee5c1941265
4
+ data.tar.gz: 296248f68d455e649dd05b79e6d4092b44d7c1aacf2f37870617348f5a366542
5
5
  SHA512:
6
- metadata.gz: 5f7a685eb3ebe1c763e394afc74e254fe4a8af9a9c7d043a887d4556a22b27bd655ecd5e3c443441805744aa461d3382ab1caaa5887d3d0ed03a1f5d96b93b80
7
- data.tar.gz: e7622705cca16d224615da1b3665d85dfb614e9c6742d21d657bdc3ff8cc9aa4bccaf64f544a34b1926e1d1bf6dbdbf58b90cc8d0f2dc205ffe3dde0e4d5673a
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],
@@ -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,
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.48.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.48.0.pre.beta
4
+ version: 0.49.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-09-21 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