lago-ruby-client 1.33.4 → 1.36.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: e4f36f34d3837da58b899e03264e47f2428a336d634d3b0ec15cd32b5f690a81
4
- data.tar.gz: b6c92d70ada60803a4b4905f66914298a44c639639df99c2e57c24e0f400c253
3
+ metadata.gz: bcd6c039cf9531fcea1e985a23874ff789f48e1dce07f29c23f61f909eb68b88
4
+ data.tar.gz: 2f907276114ad8ffcf86b3f417a5b252f76dd007e285810ba684be3cbda14fdb
5
5
  SHA512:
6
- metadata.gz: c32c5fc8b1c6649a5d1325ef1bfef65853aa88daafc3aac8ab8da8c67239b3d8c0270578a1986295ab6efb96dec519d7dcf907e092fd701c5fd19fcf218659f2
7
- data.tar.gz: e767f6c9a846cb234e5260cbc1202ea9d171f1038241170890dd35af8f85bf1ed3235d4a276bf0773d3c7aef01c2c0d7192ebd2d75fc1ea725865b1599f02d9d
6
+ metadata.gz: 6033a4653c3c6a06f6b5acf42f84802831efca81a54fa1b3e86fe16096f742c20e35d562a247e97653163f62d4b30484d79f355f42f52b8c25054d347805cc25
7
+ data.tar.gz: a3887ffc665b06300183cb4e0d3b8506ba5895b49193e62a9706394501cefd90faeb308d4ef04889c34dd7f3a350a03b80e1ddf8b53695bcb552d80c872925a9
@@ -22,7 +22,7 @@ module Lago
22
22
  end
23
23
 
24
24
  def put(path = uri.path, identifier:, body:)
25
- uri_path = identifier.nil? ? path : "#{path}/#{URI.encode_www_form_component(identifier)}"
25
+ uri_path = identifier.nil? ? path : "#{path}/#{CGI.escapeURIComponent(identifier)}"
26
26
  response = http_client.send_request(
27
27
  'PUT',
28
28
  uri_path,
@@ -34,7 +34,7 @@ module Lago
34
34
  end
35
35
 
36
36
  def patch(path = uri.path, identifier:, body:)
37
- uri_path = identifier.nil? ? path : "#{path}/#{URI.encode_www_form_component(identifier)}"
37
+ uri_path = identifier.nil? ? path : "#{path}/#{CGI.escapeURIComponent(identifier)}"
38
38
  response = http_client.send_request(
39
39
  'PATCH',
40
40
  uri_path,
@@ -46,7 +46,7 @@ module Lago
46
46
  end
47
47
 
48
48
  def get(path = uri.path, identifier:)
49
- uri_path = identifier.nil? ? path : "#{path}/#{URI.encode_www_form_component(identifier)}"
49
+ uri_path = identifier.nil? ? path : "#{path}/#{CGI.escapeURIComponent(identifier)}"
50
50
  response = http_client.send_request(
51
51
  'GET',
52
52
  uri_path,
@@ -59,7 +59,7 @@ module Lago
59
59
 
60
60
  def destroy(path = uri.path, identifier:, options: nil)
61
61
  uri_path = path
62
- uri_path += "/#{URI.encode_www_form_component(identifier)}" if identifier
62
+ uri_path += "/#{CGI.escapeURIComponent(identifier)}" if identifier
63
63
  uri_path += "?#{URI.encode_www_form(options)}" unless options.nil?
64
64
  response = http_client.send_request(
65
65
  'DELETE',
@@ -69,12 +69,14 @@ module Lago
69
69
  (billing_params || {}).slice(
70
70
  :invoice_footer,
71
71
  :invoice_grace_period,
72
+ :subscription_invoice_issuing_date_anchor,
73
+ :subscription_invoice_issuing_date_adjustment,
72
74
  :document_locale,
73
75
  )
74
76
  end
75
77
 
76
78
  def whitelist_update_params(params)
77
- result_params = whitelist_create_params(params).dup
79
+ result_params = whitelist_create_params(params).dup[root_name]
78
80
 
79
81
  result_params.delete(:code)
80
82
  result_params[:tax_codes] = params[:tax_codes] if params.key?(:tax_codes)
@@ -113,6 +113,8 @@ module Lago
113
113
  def whitelist_billing_configuration(billing_params)
114
114
  (billing_params || {}).slice(
115
115
  :invoice_grace_period,
116
+ :subscription_invoice_issuing_date_anchor,
117
+ :subscription_invoice_issuing_date_adjustment,
116
118
  :payment_provider,
117
119
  :payment_provider_code,
118
120
  :provider_customer_id,
@@ -28,7 +28,8 @@ module Lago
28
28
  uri = URI("#{client.base_api_url}#{api_resource}/batch")
29
29
 
30
30
  payload = whitelist_batch_params(params)
31
- connection.post(payload, uri)
31
+ response = connection.post(payload, uri)
32
+ JSON.parse(response.to_json, object_class: OpenStruct)
32
33
  end
33
34
 
34
35
  def estimate_fees(params)
@@ -25,7 +25,10 @@ module Lago
25
25
  :expiration_at,
26
26
  :transaction_metadata,
27
27
  :invoice_requires_successful_payment,
28
+ :ignore_paid_top_up_limits_on_creation,
28
29
  :transaction_name,
30
+ :paid_top_up_min_amount_cents,
31
+ :paid_top_up_max_amount_cents
29
32
  )
30
33
 
31
34
  recurring_rules = whitelist_recurring_rules(params[:recurring_transaction_rules])
@@ -54,7 +57,8 @@ module Lago
54
57
  :expiration_at,
55
58
  :target_ongoing_balance,
56
59
  :transaction_metadata,
57
- :transaction_name
60
+ :transaction_name,
61
+ :ignore_paid_top_up_limits
58
62
  )
59
63
 
60
64
  processed_rules << result unless result.empty?
@@ -30,15 +30,16 @@ module Lago
30
30
 
31
31
  def whitelist_params(params)
32
32
  {
33
- 'wallet_transaction' => {
34
- wallet_id: params[:wallet_id],
35
- name: params[:name],
36
- paid_credits: params[:paid_credits],
37
- granted_credits: params[:granted_credits],
38
- voided_credits: params[:voided_credits],
39
- invoice_requires_successful_payment: params[:invoice_requires_successful_payment],
40
- metadata: params[:metadata],
41
- }.compact
33
+ 'wallet_transaction' => params.compact.slice(
34
+ :wallet_id,
35
+ :name,
36
+ :paid_credits,
37
+ :granted_credits,
38
+ :voided_credits,
39
+ :invoice_requires_successful_payment,
40
+ :ignore_paid_top_up_limits,
41
+ :metadata,
42
+ )
42
43
  }
43
44
  end
44
45
  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.33.4'
4
+ VERSION = '1.36.0'
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: 1.33.4
4
+ version: 1.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lovro Colic
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-09-19 00:00:00.000000000 Z
11
+ date: 2025-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jwt
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ostruct
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: bigdecimal
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -80,6 +94,48 @@ dependencies:
80
94
  - - ">="
81
95
  - !ruby/object:Gem::Version
82
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: guard-rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: httplog
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
83
139
  - !ruby/object:Gem::Dependency
84
140
  name: mutex_m
85
141
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +164,20 @@ dependencies:
108
164
  - - ">="
109
165
  - !ruby/object:Gem::Version
110
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: pry-byebug
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
111
181
  - !ruby/object:Gem::Dependency
112
182
  name: rake
113
183
  requirement: !ruby/object:Gem::Requirement
@@ -164,20 +234,6 @@ dependencies:
164
234
  - - ">="
165
235
  - !ruby/object:Gem::Version
166
236
  version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: rubocop-rails
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
237
  - !ruby/object:Gem::Dependency
182
238
  name: rubocop-rspec
183
239
  requirement: !ruby/object:Gem::Requirement