pay 12.1.0 → 12.1.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2cc4265d73925a1e3134b5dafcdf452b131b8c478c2d9f04179148d313ac3275
|
|
4
|
+
data.tar.gz: 02f84e17b0216f30d5d38d92455adc13a9fd14fff96a84f5ee045041340dc999
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fdf6618be0a7510e7cf015ee9e80a0e08b1550953c739fb978adfa1f3b74fe6ad58244deef09bdc52284bf92dcc1013e14daaa70d49d5516c85b0f63bcbbd701
|
|
7
|
+
data.tar.gz: be11d81512c0dc629be7eaf13070c6382fa1c30f3606bc05b0ce2c882a8b9b3bf5760b5e52be48efe2353e6a0773225b2cc473c1b5e194153e515a57e459f701
|
|
@@ -13,9 +13,11 @@ module Pay
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def valid_signature?(signature)
|
|
16
|
+
secret = Pay::LemonSqueezy.signing_secret
|
|
17
|
+
raise Pay::LemonSqueezy::Error, "Cannot verify signature without a Lemon Squeezy signing secret" if secret.blank?
|
|
16
18
|
return false if signature.blank?
|
|
17
19
|
|
|
18
|
-
hmac = OpenSSL::HMAC.hexdigest("sha256",
|
|
20
|
+
hmac = OpenSSL::HMAC.hexdigest("sha256", secret, request.raw_post)
|
|
19
21
|
ActiveSupport::SecurityUtils.secure_compare(hmac, signature)
|
|
20
22
|
end
|
|
21
23
|
end
|
|
@@ -14,11 +14,14 @@ module Pay
|
|
|
14
14
|
|
|
15
15
|
# The header looks like "ts=1671552777;h1=eb4d0dc8..."
|
|
16
16
|
def valid_signature?(signature)
|
|
17
|
+
secret = Pay::PaddleBilling.signing_secret
|
|
18
|
+
raise Pay::PaddleBilling::Error, "Cannot verify signature without a Paddle Billing signing secret" if secret.blank?
|
|
19
|
+
|
|
17
20
|
parts = signature.to_s.split(";").filter_map { |part| part.split("=", 2) if part.include?("=") }.to_h
|
|
18
21
|
ts, h1 = parts.values_at("ts", "h1")
|
|
19
22
|
return false if ts.blank? || h1.blank?
|
|
20
23
|
|
|
21
|
-
hmac = OpenSSL::HMAC.hexdigest("sha256",
|
|
24
|
+
hmac = OpenSSL::HMAC.hexdigest("sha256", secret, "#{ts}:#{request.raw_post}")
|
|
22
25
|
ActiveSupport::SecurityUtils.secure_compare(hmac, h1)
|
|
23
26
|
end
|
|
24
27
|
end
|
data/lib/pay/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pay
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 12.1.
|
|
4
|
+
version: 12.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jason Charnes
|
|
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
191
191
|
- !ruby/object:Gem::Version
|
|
192
192
|
version: '0'
|
|
193
193
|
requirements: []
|
|
194
|
-
rubygems_version: 4.0.
|
|
194
|
+
rubygems_version: 4.0.18
|
|
195
195
|
specification_version: 4
|
|
196
196
|
summary: Payments engine for Ruby on Rails
|
|
197
197
|
test_files: []
|