lago-ruby-client 0.48.0.pre.beta → 0.50.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: b827eefb8b303238ec2a42e5cc5d485530d63671c3afe9e6af5c6a5aabb45859
4
- data.tar.gz: 8aca6b61ce1ae31df5df9146ccf6a5ecf5397e2be62da93bc45ca1f6b84bf45b
3
+ metadata.gz: 6648835d8488417de038880a3124b10d68756f9185098fa54250e9167566a8e9
4
+ data.tar.gz: a26d2b61479f46e1ba144c048aa7127f73889950d26bf0a761dc34e290df6663
5
5
  SHA512:
6
- metadata.gz: 5f7a685eb3ebe1c763e394afc74e254fe4a8af9a9c7d043a887d4556a22b27bd655ecd5e3c443441805744aa461d3382ab1caaa5887d3d0ed03a1f5d96b93b80
7
- data.tar.gz: e7622705cca16d224615da1b3665d85dfb614e9c6742d21d657bdc3ff8cc9aa4bccaf64f544a34b1926e1d1bf6dbdbf58b90cc8d0f2dc205ffe3dde0e4d5673a
6
+ metadata.gz: 3b52dc25f131fb69f85ef12c6f7236cd48c7d839a883bc5b1407770b16a095c714f5f0c98f588c99cac026b5bb4899e78124678f297ffd42ab27495d8b4354e1
7
+ data.tar.gz: a0e8af78ed0d728f77507391c78de2cb56a73e205c6560b850d21e46da9e1ef47b7933e299154a9f4656139bd622e2521c7f103c86cc395f5b97adca76a74d94
@@ -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]
@@ -12,11 +12,6 @@ module Lago
12
12
  'event'
13
13
  end
14
14
 
15
- def create(params)
16
- payload = whitelist_params(params)
17
- connection.post(payload)
18
- end
19
-
20
15
  def batch_create(params)
21
16
  uri = URI("#{client.base_api_url}#{api_resource}/batch")
22
17
 
@@ -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,
@@ -23,6 +23,7 @@ module Lago
23
23
  subscription_at: params[:subscription_at],
24
24
  ending_at: params[:ending_at],
25
25
  subscription_date: params[:subscription_date], # Deprecated
26
+ plan_overrides: params[:plan_overrides],
26
27
  }.compact
27
28
  }
28
29
  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.48.0-beta'
4
+ VERSION = '0.50.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.50.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-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -175,7 +175,7 @@ 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.3.3
178
+ rubygems_version: 3.0.3.1
179
179
  signing_key:
180
180
  specification_version: 4
181
181
  summary: Lago Rest API client