castle-rb 9.2.0 → 9.3.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: 93980c047867e58e332b7503edfb243e157de612024a137e7e8fe2f6cd69b0ab
4
- data.tar.gz: 487754c292626984bb233f67c88b0101aba4a206dfa7ab738f7e042799be59cf
3
+ metadata.gz: 45354835d85251395bc9830ccdcccbe04db16d6e19134babbd36ff110e587758
4
+ data.tar.gz: 9560b565f2042f57f6a5cb85e54860b2ef5f950c9b1d63c4371420d41dc7ff7a
5
5
  SHA512:
6
- metadata.gz: 42b66ed4b557d084bbfbb0b15b69793811c35e87e642b0a07de4aee9c8c0379732747aa9bd8a4890ff34a0420926f280d7d44044f09347e4078b9d65af6c9630
7
- data.tar.gz: f15c06bfdcc644c419ff45fa6777c11ddae889a1be42d3b2c88665ce45b08acb71474c182b6524b6d70aa3777349733753fda516bd2215f63ca337bdf7daf102
6
+ metadata.gz: 4471bf9db7d73a0434db57dc27a0f5d265f5d9ff62f0046bf9755636bd57b6ab0676169c579cd67bb5ba29a8719a9ddc93ccd0169ffdaa5e65e44a3dfb6083d3
7
+ data.tar.gz: 7725515e779e546a4ce763aad5a4bd8001aa0cf755a07963bb44643726c115d271a1210529d48d90f5feef50a6f63b8194f9bf6349e5338dccc11a93693fddc3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 9.3.0
4
+
5
+ - Add `Castle::PaymentRequiredError` for HTTP 402 responses.
6
+
3
7
  ## 9.2.0
4
8
 
5
9
  **Changes:**
@@ -25,7 +29,7 @@
25
29
  - Bump Bundler 2.6.9 → 2.7.2
26
30
  - Bump json 2.19.5 → 2.19.7
27
31
 
28
- ## master
32
+ ## Unreleased
29
33
 
30
34
  - Bump dependencies (rack 3.1.19 → 3.2.6, rake, rspec-\*, timecop, simplecov-html, diff-lcs)
31
35
  - Bump Ruby to 3.4.9 (zlib CVE-2026-27820)
data/README.md CHANGED
@@ -293,6 +293,7 @@ All exceptions inherit from `Castle::Error`. The most useful ones:
293
293
  | `Castle::InvalidRequestTokenError` | The `request_token` is missing or invalid. |
294
294
  | `Castle::InvalidParametersError` | 422 response with validation details. |
295
295
  | `Castle::RateLimitError` | 429 response — back off and retry. |
296
+ | `Castle::PaymentRequiredError` | 402 response. |
296
297
  | `Castle::UnauthorizedError` | 401 — bad API secret. |
297
298
  | `Castle::InternalServerError` | 5xx response from Castle. |
298
299
  | `Castle::WebhookVerificationError` | Webhook signature did not match. |
data/lib/castle/api.rb CHANGED
@@ -43,9 +43,8 @@ module Castle
43
43
  # @note We need to initialize the error, as the original error is a cause for this
44
44
  # custom exception. If we would do it the default Ruby way, the original error
45
45
  # would get converted into a string
46
- # rubocop:disable Style/RaiseArgs
46
+ # rubocop:disable-next Style/RaiseArgs
47
47
  raise Castle::RequestError.new(e)
48
- # rubocop:enable Style/RaiseArgs
49
48
  end
50
49
  end
51
50
  end
@@ -7,6 +7,7 @@ module Castle
7
7
  RESPONSE_ERRORS = {
8
8
  400 => Castle::BadRequestError,
9
9
  401 => Castle::UnauthorizedError,
10
+ 402 => Castle::PaymentRequiredError,
10
11
  403 => Castle::ForbiddenError,
11
12
  404 => Castle::NotFoundError,
12
13
  419 => Castle::UserUnauthorizedError,
data/lib/castle/errors.rb CHANGED
@@ -65,6 +65,9 @@ module Castle
65
65
  class RateLimitError < Castle::ApiError
66
66
  end
67
67
 
68
+ class PaymentRequiredError < Castle::ApiError
69
+ end
70
+
68
71
  # all internal server errors
69
72
  class InternalServerError < Castle::ApiError
70
73
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Castle
4
- VERSION = '9.2.0'
4
+ VERSION = '9.3.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: castle-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.2.0
4
+ version: 9.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johan Brissmyr