lago-ruby-client 1.47.0 → 1.49.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1ce7eaf525a2785545ea91a30464c1da9da45a09c95d01a6b062cd4b51a85f5
4
- data.tar.gz: 6d8be436f3b5b4155d8e72e28aea99082fd40dfa1070a18758e40842ede13d34
3
+ metadata.gz: 3f6b3744426d3dc1557cccca38a1ea551dcf980216849e48f03445ef030d95c4
4
+ data.tar.gz: f2209448cbc72ea88adcae5d24e0db816711c04b56d1de6c4283c23c4d53c73e
5
5
  SHA512:
6
- metadata.gz: c10616c41e59442007247c9245bb91be08881744dbf91f9112dbe4043e7d19c33539aa50c8367f77a06a6d3fd49efa5d5a3add3f10842eaa05cc0d0ab0f2643d
7
- data.tar.gz: adc378ba5f462f08880bbd3ff8b841b9432660a378f3dec36aeab4b4065e0ecaf07608a27ead50a49cea6eab701c250e0f2e89915d1d13df016f22c252dc95de
6
+ metadata.gz: 7d46f88c7b9d129f4d0a2782753170269d6b079a1c236023cc9e2214fd997b8f62239819cdb46dd11066e323424280e2ba238f61673826520db1e8f0e8d651dc
7
+ data.tar.gz: ba5454c0fa9cbb8606d6e8d7513cb23d6bd0d7a64c881daa01078d5808fad46439b32104aa50fdbb608f64ea54b9805c037e6eb4032d79d8e14154e7d82cd091
@@ -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,
@@ -23,6 +23,7 @@ module Lago
23
23
  :transaction_name,
24
24
  :paid_top_up_min_amount_cents,
25
25
  :paid_top_up_max_amount_cents,
26
+ :billing_entity_code,
26
27
  )
27
28
 
28
29
  recurring_rules = recurring_rules_params(params[:recurring_transaction_rules])
@@ -70,6 +71,7 @@ module Lago
70
71
  :transaction_metadata,
71
72
  :transaction_name,
72
73
  :ignore_paid_top_up_limits,
74
+ :grants_target_top_up,
73
75
  )
74
76
 
75
77
  payment_method = payment_method_params(r[:payment_method])
@@ -86,7 +86,7 @@ module Lago
86
86
  def preview(params)
87
87
  path = "/api/v1/invoices/preview"
88
88
  payload = params.slice(
89
- :customer, :plan_code, :subscription_at, :billing_time, :coupons, :subscriptions
89
+ :customer, :plan_code, :subscription_at, :billing_time, :coupons, :subscriptions, :billing_entity_code
90
90
  )
91
91
  response = connection.post(payload, path)[root_name]
92
92
 
@@ -125,8 +125,9 @@ module Lago
125
125
  external_customer_id: params[:external_customer_id],
126
126
  currency: params[:currency],
127
127
  net_payment_term: params[:net_payment_term],
128
- skip_psp: params[:skip_psp]
129
- }
128
+ skip_psp: params[:skip_psp],
129
+ billing_entity_code: params[:billing_entity_code]
130
+ }.compact
130
131
 
131
132
  fees = whitelist_fees(params[:fees])
132
133
  result[:fees] = fees unless fees.empty?
@@ -212,6 +212,8 @@ 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],
216
+ billing_entity_code: params[:billing_entity_code],
215
217
  }.compact
216
218
 
217
219
  payment_method_params = whitelist_payment_method_params(params[:payment_method])
data/lib/lago/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lago
4
- VERSION = '1.47.0'
4
+ VERSION = '1.49.0'
5
5
  end
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.47.0
4
+ version: 1.49.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.6
387
+ rubygems_version: 4.0.10
388
388
  specification_version: 4
389
389
  summary: Lago Rest API client
390
390
  test_files: []