dodopayments 1.54.0 → 1.55.8

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: 632ee24b75862fb42d76c1f2eb5d8a5acf117210188d9ce7f95a0a02b7c55424
4
- data.tar.gz: 39ff2d906db19493491c65906463eb8c181ad0c09cc07740fbd531e4c81d7010
3
+ metadata.gz: 3a0e945d7b450dc154627e3f0a103fc64211cc9bacd413836a13c685c6072ee4
4
+ data.tar.gz: 01eb12a3362398b3cb3e79151d763ea7307c80a4c54700751dea7bf29f99dcca
5
5
  SHA512:
6
- metadata.gz: 699acbcea634f1bb3cc3a132ebacc51cb1b9e8fe415df6d13f12ffd35f32c9a5d181d8dcf3eeebc78de33661d61bd3f461d3c49d96b4d006f831b5c50e7b22d5
7
- data.tar.gz: 3345a6f54e2618138d74713806b28cd215d0187ae2fbce4e78e0f32b82a6ed679d7c44c57218b90ccea338dcf5149b2e966a3861de65450b0054a14e307bbaff
6
+ metadata.gz: 15b740ff52e1790bc06d0c4ef5ac7f085295691c49749faf672eec14ac82b70a6f105fd6dc6353fba7745d5bfc3bfb811a8ef0575f9ddeb851c354d2ee2447b4
7
+ data.tar.gz: da481011695dfc3d390f289935f700bf0192f43f31156c1a63b827aeb53f819f8e513fcd20d6401b88d6b12eeddbd76eb4b5933c42f8ef79f43c8e755117fd8f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.55.8 (2025-10-24)
4
+
5
+ Full Changelog: [v1.55.7...v1.55.8](https://github.com/dodopayments/dodopayments-ruby/compare/v1.55.7...v1.55.8)
6
+
7
+ ### Features
8
+
9
+ * handle thread interrupts in the core HTTP client ([704ad81](https://github.com/dodopayments/dodopayments-ruby/commit/704ad81101e265fcf099bc397643a650476672ce))
10
+
11
+ ## 1.55.7 (2025-10-17)
12
+
13
+ Full Changelog: [v1.54.0...v1.55.7](https://github.com/dodopayments/dodopayments-ruby/compare/v1.54.0...v1.55.7)
14
+
15
+ ### Features
16
+
17
+ * **api:** updates for openapi spec v1.55.7 ([7bcc59e](https://github.com/dodopayments/dodopayments-ruby/commit/7bcc59eeedcb804bd8e83205e78c04c785089f63))
18
+
3
19
  ## 1.54.0 (2025-10-16)
4
20
 
5
21
  Full Changelog: [v1.53.5...v1.54.0](https://github.com/dodopayments/dodopayments-ruby/compare/v1.53.5...v1.54.0)
data/README.md CHANGED
@@ -17,7 +17,7 @@ To use this gem, install via Bundler by adding the following to your application
17
17
  <!-- x-release-please-start-version -->
18
18
 
19
19
  ```ruby
20
- gem "dodopayments", "~> 1.54.0"
20
+ gem "dodopayments", "~> 1.55.8"
21
21
  ```
22
22
 
23
23
  <!-- x-release-please-end -->
@@ -128,40 +128,48 @@ module Dodopayments
128
128
  url, deadline = request.fetch_values(:url, :deadline)
129
129
 
130
130
  req = nil
131
- eof = false
132
131
  finished = false
133
- closing = nil
134
132
 
135
133
  # rubocop:disable Metrics/BlockLength
136
134
  enum = Enumerator.new do |y|
137
135
  next if finished
138
136
 
139
137
  with_pool(url, deadline: deadline) do |conn|
140
- req, closing = self.class.build_request(request) do
141
- self.class.calibrate_socket_timeout(conn, deadline)
142
- end
143
-
144
- self.class.calibrate_socket_timeout(conn, deadline)
145
- unless conn.started?
146
- conn.keep_alive_timeout = self.class::KEEP_ALIVE_TIMEOUT
147
- conn.start
148
- end
138
+ eof = false
139
+ closing = nil
140
+ ::Thread.handle_interrupt(Object => :never) do
141
+ ::Thread.handle_interrupt(Object => :immediate) do
142
+ req, closing = self.class.build_request(request) do
143
+ self.class.calibrate_socket_timeout(conn, deadline)
144
+ end
149
145
 
150
- self.class.calibrate_socket_timeout(conn, deadline)
151
- conn.request(req) do |rsp|
152
- y << [req, rsp]
153
- break if finished
154
-
155
- rsp.read_body do |bytes|
156
- y << bytes.force_encoding(Encoding::BINARY)
157
- break if finished
146
+ self.class.calibrate_socket_timeout(conn, deadline)
147
+ unless conn.started?
148
+ conn.keep_alive_timeout = self.class::KEEP_ALIVE_TIMEOUT
149
+ conn.start
150
+ end
158
151
 
159
152
  self.class.calibrate_socket_timeout(conn, deadline)
153
+ conn.request(req) do |rsp|
154
+ y << [req, rsp]
155
+ break if finished
156
+
157
+ rsp.read_body do |bytes|
158
+ y << bytes.force_encoding(Encoding::BINARY)
159
+ break if finished
160
+
161
+ self.class.calibrate_socket_timeout(conn, deadline)
162
+ end
163
+ eof = true
164
+ end
165
+ end
166
+ ensure
167
+ begin
168
+ conn.finish if !eof && conn&.started?
169
+ ensure
170
+ closing&.call
160
171
  end
161
- eof = true
162
172
  end
163
- ensure
164
- conn.finish if !eof && conn&.started?
165
173
  end
166
174
  rescue Timeout::Error
167
175
  raise Dodopayments::Errors::APITimeoutError.new(url: url, request: req)
@@ -174,8 +182,6 @@ module Dodopayments
174
182
  body = Dodopayments::Internal::Util.fused_enum(enum, external: true) do
175
183
  finished = true
176
184
  loop { enum.next }
177
- ensure
178
- closing&.call
179
185
  end
180
186
  [Integer(response.code), response, body]
181
187
  end
@@ -4,23 +4,32 @@ module Dodopayments
4
4
  module Models
5
5
  class NewCustomer < Dodopayments::Internal::Type::BaseModel
6
6
  # @!attribute email
7
+ # Email is required for creating a new customer
7
8
  #
8
9
  # @return [String]
9
10
  required :email, String
10
11
 
11
12
  # @!attribute name
13
+ # Optional full name of the customer. If provided during session creation, it is
14
+ # persisted and becomes immutable for the session. If omitted here, it can be
15
+ # provided later via the confirm API.
12
16
  #
13
- # @return [String]
14
- required :name, String
17
+ # @return [String, nil]
18
+ optional :name, String, nil?: true
15
19
 
16
20
  # @!attribute phone_number
17
21
  #
18
22
  # @return [String, nil]
19
23
  optional :phone_number, String, nil?: true
20
24
 
21
- # @!method initialize(email:, name:, phone_number: nil)
22
- # @param email [String]
23
- # @param name [String]
25
+ # @!method initialize(email:, name: nil, phone_number: nil)
26
+ # Some parameter documentations has been truncated, see
27
+ # {Dodopayments::Models::NewCustomer} for more details.
28
+ #
29
+ # @param email [String] Email is required for creating a new customer
30
+ #
31
+ # @param name [String, nil] Optional full name of the customer. If provided during session creation,
32
+ #
24
33
  # @param phone_number [String, nil]
25
34
  end
26
35
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dodopayments
4
- VERSION = "1.54.0"
4
+ VERSION = "1.55.8"
5
5
  end
@@ -8,10 +8,14 @@ module Dodopayments
8
8
  T.any(Dodopayments::NewCustomer, Dodopayments::Internal::AnyHash)
9
9
  end
10
10
 
11
+ # Email is required for creating a new customer
11
12
  sig { returns(String) }
12
13
  attr_accessor :email
13
14
 
14
- sig { returns(String) }
15
+ # Optional full name of the customer. If provided during session creation, it is
16
+ # persisted and becomes immutable for the session. If omitted here, it can be
17
+ # provided later via the confirm API.
18
+ sig { returns(T.nilable(String)) }
15
19
  attr_accessor :name
16
20
 
17
21
  sig { returns(T.nilable(String)) }
@@ -20,16 +24,28 @@ module Dodopayments
20
24
  sig do
21
25
  params(
22
26
  email: String,
23
- name: String,
27
+ name: T.nilable(String),
24
28
  phone_number: T.nilable(String)
25
29
  ).returns(T.attached_class)
26
30
  end
27
- def self.new(email:, name:, phone_number: nil)
31
+ def self.new(
32
+ # Email is required for creating a new customer
33
+ email:,
34
+ # Optional full name of the customer. If provided during session creation, it is
35
+ # persisted and becomes immutable for the session. If omitted here, it can be
36
+ # provided later via the confirm API.
37
+ name: nil,
38
+ phone_number: nil
39
+ )
28
40
  end
29
41
 
30
42
  sig do
31
43
  override.returns(
32
- { email: String, name: String, phone_number: T.nilable(String) }
44
+ {
45
+ email: String,
46
+ name: T.nilable(String),
47
+ phone_number: T.nilable(String)
48
+ }
33
49
  )
34
50
  end
35
51
  def to_hash
@@ -1,21 +1,21 @@
1
1
  module Dodopayments
2
2
  module Models
3
- type new_customer = { email: String, name: String, phone_number: String? }
3
+ type new_customer = { email: String, name: String?, phone_number: String? }
4
4
 
5
5
  class NewCustomer < Dodopayments::Internal::Type::BaseModel
6
6
  attr_accessor email: String
7
7
 
8
- attr_accessor name: String
8
+ attr_accessor name: String?
9
9
 
10
10
  attr_accessor phone_number: String?
11
11
 
12
12
  def initialize: (
13
13
  email: String,
14
- name: String,
14
+ ?name: String?,
15
15
  ?phone_number: String?
16
16
  ) -> void
17
17
 
18
- def to_hash: -> { email: String, name: String, phone_number: String? }
18
+ def to_hash: -> { email: String, name: String?, phone_number: String? }
19
19
  end
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dodopayments
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.54.0
4
+ version: 1.55.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dodo Payments
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-16 00:00:00.000000000 Z
11
+ date: 2025-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool