lago-ruby-client 1.48.0 → 1.50.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: bea17bf1229294d29f024bf35d7d04259dc2c456f2e8a74bf9e7e5c29e2a5a0b
4
- data.tar.gz: c153ae102d6bbe8c03611230fb098670e3ea10e8270270e887dc5dc50f6a23b7
3
+ metadata.gz: 0f8190f69942ee6d4db6ba8eee70cc30f288ef4722a2380bc4fbccdd6da8c0ab
4
+ data.tar.gz: e1b21254b6af67400a312feedf60078cd03eeb1e623a860d767aaedaf3753980
5
5
  SHA512:
6
- metadata.gz: aacfbe713d36b9815a502f139b6bf2839dab41300ac7ceda923ea9b28fc29c16a98e76344b60cc074976062e6b44c70c85c706cf94f94f14f4fef605162d8a28
7
- data.tar.gz: 0f9b64eb351fe34016b585db14cbec53028156f18bf5ff2fdc606b357df8ad0d219a6eea81987e433a72c5d8705ea96907ea660ff4b29be4fcbb96b7c0d5016c
6
+ metadata.gz: 94f3bf16b98f79a7ef7232c75e3449acf60ac3aff7a4775611ca3a20f2de86c9125b3e01cdd51e4c9cb506bcdf2a0e9991c6912065b3790f303fca0c0978a2bf
7
+ data.tar.gz: 2c52879f4a93f841a68d3b6c038c671db69f642f7082bd72bc5d9b2e3b69883dc9d4478c85313bd0561ee8d69127f21ca8f265af1754fb4de585b4430dc49f4a
@@ -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?
@@ -213,6 +213,7 @@ module Lago
213
213
  ending_at: params[:ending_at],
214
214
  plan_overrides: params[:plan_overrides],
215
215
  consolidate_invoice: params[:consolidate_invoice],
216
+ billing_entity_code: params[:billing_entity_code],
216
217
  }.compact
217
218
 
218
219
  payment_method_params = whitelist_payment_method_params(params[:payment_method])
@@ -221,6 +222,9 @@ module Lago
221
222
  invoice_custom_section = whitelist_invoice_custom_section_params(params[:invoice_custom_section])
222
223
  result[:invoice_custom_section] = invoice_custom_section if invoice_custom_section
223
224
 
225
+ activation_rules = whitelist_activation_rules_params(params[:activation_rules])
226
+ result[:activation_rules] = activation_rules if activation_rules
227
+
224
228
  { root_name => result }
225
229
  end
226
230
 
@@ -287,6 +291,12 @@ module Lago
287
291
  payment_method_param&.slice(:payment_method_type, :payment_method_id)
288
292
  end
289
293
 
294
+ def whitelist_activation_rules_params(activation_rules_param)
295
+ activation_rules_param&.map do |rule|
296
+ (rule || {}).slice(:type, :timeout_hours)
297
+ end
298
+ end
299
+
290
300
  def whitelist_invoice_custom_section_params(invoice_custom_section_param)
291
301
  invoice_custom_section_param&.slice(:skip_invoice_custom_sections, :invoice_custom_section_codes)
292
302
  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 = '1.48.0'
4
+ VERSION = '1.50.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.48.0
4
+ version: 1.50.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lovro Colic