stripe 19.6.1 → 19.6.2
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 +4 -4
- data/lib/stripe/stripe_context.rb +7 -1
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe/webhook.rb +8 -0
- data/rbi/stripe/stripe_client.rbi +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 310e2209501ef945d302084ec788e94effc1d49d7b28ae696f96c72ba8b16352
|
|
4
|
+
data.tar.gz: 8b6c08b64f0f314f69a276b37c251079b19b17fff9b36e362751096a3896fac3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5fa01da68c76512fb633bd82c8c36010cfd5b6d85ea38d1ba71acc6464859c5093514d9b8bb3c68b71616dfbdc238f286f436a2726d887066f173e1363b899c4
|
|
7
|
+
data.tar.gz: 79467cd47cd0712f1c95605a89ac2790b06c865c47d8dc438031479a1d5d72713bce5872fa9c38fc5d110b73adacb5457074fd3e92f7769858fc2d9a405dcb4e
|
|
@@ -13,7 +13,7 @@ module Stripe
|
|
|
13
13
|
|
|
14
14
|
# Creates a new StripeContext with the given segments.
|
|
15
15
|
def initialize(segments = nil)
|
|
16
|
-
@segments = (segments || []).map(
|
|
16
|
+
@segments = (segments || []).map { |segment| (segment.is_a?(String) ? segment.dup : segment.to_s).freeze }.freeze
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
# Parses a context string into a StripeContext instance.
|
|
@@ -54,6 +54,12 @@ module Stripe
|
|
|
54
54
|
# Alias for == to support eql? method
|
|
55
55
|
alias eql? ==
|
|
56
56
|
|
|
57
|
+
# As with equality in #== and #eql?, contexts with equivalent segments
|
|
58
|
+
# hash to the same value.
|
|
59
|
+
def hash
|
|
60
|
+
@segments.hash
|
|
61
|
+
end
|
|
62
|
+
|
|
57
63
|
# Returns a human-readable representation for debugging.
|
|
58
64
|
def inspect
|
|
59
65
|
"#<#{self.class}:0x#{object_id.to_s(16)} segments=#{@segments.inspect}>"
|
data/lib/stripe/version.rb
CHANGED
data/lib/stripe/webhook.rb
CHANGED
|
@@ -135,6 +135,14 @@ module Stripe
|
|
|
135
135
|
)
|
|
136
136
|
end
|
|
137
137
|
|
|
138
|
+
if secret.nil? || secret.empty?
|
|
139
|
+
raise SignatureVerificationError.new(
|
|
140
|
+
"No webhook secret value was provided. It should start with " \
|
|
141
|
+
"`whsec_`",
|
|
142
|
+
header, http_body: payload
|
|
143
|
+
)
|
|
144
|
+
end
|
|
145
|
+
|
|
138
146
|
expected_sig = compute_signature(timestamp, payload, secret)
|
|
139
147
|
unless signatures.any? { |s| Util.secure_compare(expected_sig, s) }
|
|
140
148
|
raise SignatureVerificationError.new(
|
|
@@ -16,7 +16,7 @@ module Stripe
|
|
|
16
16
|
)
|
|
17
17
|
.returns(::Stripe::V2::Core::EventNotification)
|
|
18
18
|
end
|
|
19
|
-
def parse_event_notification(payload, sig_header, secret, tolerance: Webhook::DEFAULT_TOLERANCE); end
|
|
19
|
+
def parse_event_notification(payload, sig_header, secret, tolerance: ::Stripe::Webhook::DEFAULT_TOLERANCE); end
|
|
20
20
|
|
|
21
21
|
# Constructs a [thin event notification](https://docs.stripe.com/event-destinations#thin-payload) from
|
|
22
22
|
# an incoming webhook without first verifying its authenticity. Should be used after calling
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stripe
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 19.6.
|
|
4
|
+
version: 19.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stripe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bigdecimal
|