lago-ruby-client 1.47.0 → 1.48.0
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 +4 -4
- data/lib/lago/api/resources/customer.rb +10 -1
- data/lib/lago/api/resources/subscription.rb +1 -0
- data/lib/lago/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bea17bf1229294d29f024bf35d7d04259dc2c456f2e8a74bf9e7e5c29e2a5a0b
|
|
4
|
+
data.tar.gz: c153ae102d6bbe8c03611230fb098670e3ea10e8270270e887dc5dc50f6a23b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aacfbe713d36b9815a502f139b6bf2839dab41300ac7ceda923ea9b28fc29c16a98e76344b60cc074976062e6b44c70c85c706cf94f94f14f4fef605162d8a28
|
|
7
|
+
data.tar.gz: 0f9b64eb351fe34016b585db14cbec53028156f18bf5ff2fdc606b357df8ad0d219a6eea81987e433a72c5d8705ea96907ea660ff4b29be4fcbb96b7c0d5016c
|
|
@@ -21,7 +21,8 @@ module Lago
|
|
|
21
21
|
def current_usage( # rubocop:disable Metrics/ParameterLists
|
|
22
22
|
external_customer_id, external_subscription_id, apply_taxes: nil,
|
|
23
23
|
charge_id: nil, charge_code: nil, billable_metric_code: nil, group: nil,
|
|
24
|
-
filter_by_charge_id: nil, filter_by_charge_code: nil, filter_by_group: nil, full_usage: nil
|
|
24
|
+
filter_by_charge_id: nil, filter_by_charge_code: nil, filter_by_group: nil, full_usage: nil,
|
|
25
|
+
filter_by_presentation: nil
|
|
25
26
|
)
|
|
26
27
|
query_params = { external_subscription_id: external_subscription_id }
|
|
27
28
|
query_params[:apply_taxes] = apply_taxes unless apply_taxes.nil?
|
|
@@ -33,6 +34,10 @@ module Lago
|
|
|
33
34
|
query_params[:filter_by_charge_code] = filter_by_charge_code unless filter_by_charge_code.nil?
|
|
34
35
|
filter_by_group&.each { |k, v| query_params[:"filter_by_group[#{k}]"] = v }
|
|
35
36
|
query_params[:full_usage] = full_usage unless full_usage.nil?
|
|
37
|
+
unless filter_by_presentation.nil?
|
|
38
|
+
query_params[:filter_by_presentation] =
|
|
39
|
+
filter_by_presentation_param(filter_by_presentation)
|
|
40
|
+
end
|
|
36
41
|
query_string = URI.encode_www_form(query_params)
|
|
37
42
|
|
|
38
43
|
uri = URI("#{client.base_api_url}#{api_resource}/#{external_customer_id}/current_usage?#{query_string}")
|
|
@@ -126,6 +131,10 @@ module Lago
|
|
|
126
131
|
{ root_name => result_hash }
|
|
127
132
|
end
|
|
128
133
|
|
|
134
|
+
def filter_by_presentation_param(filter_by_presentation)
|
|
135
|
+
filter_by_presentation.is_a?(String) ? filter_by_presentation : JSON.generate(filter_by_presentation)
|
|
136
|
+
end
|
|
137
|
+
|
|
129
138
|
def whitelist_billing_configuration(billing_params)
|
|
130
139
|
(billing_params || {}).slice(
|
|
131
140
|
:invoice_grace_period,
|
|
@@ -212,6 +212,7 @@ module Lago
|
|
|
212
212
|
subscription_at: params[:subscription_at],
|
|
213
213
|
ending_at: params[:ending_at],
|
|
214
214
|
plan_overrides: params[:plan_overrides],
|
|
215
|
+
consolidate_invoice: params[:consolidate_invoice],
|
|
215
216
|
}.compact
|
|
216
217
|
|
|
217
218
|
payment_method_params = whitelist_payment_method_params(params[:payment_method])
|
data/lib/lago/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lago-ruby-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.48.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lovro Colic
|
|
@@ -384,7 +384,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
384
384
|
- !ruby/object:Gem::Version
|
|
385
385
|
version: '0'
|
|
386
386
|
requirements: []
|
|
387
|
-
rubygems_version: 4.0.
|
|
387
|
+
rubygems_version: 4.0.10
|
|
388
388
|
specification_version: 4
|
|
389
389
|
summary: Lago Rest API client
|
|
390
390
|
test_files: []
|