cardknox 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cardknox/version.rb +1 -1
- data/lib/cardknox/webhook.rb +19 -0
- data/lib/cardknox.rb +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88b06af63de3727a996ef6be8ce32fa1a84ed126582acdff26829d9308936c7d
|
4
|
+
data.tar.gz: 681aa714d0b50aba4f1a9490e68548600fa734051a1fb303799b9b09a396259e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e01c3429dd9d7f50eaf6bb954ec83eb95a117737ca337cbf14916606e1dd90f110993737a56fe4dd86d784ec11cd3bf4ecf9c2017d37cbd2b4bbb31bb8b9ecd
|
7
|
+
data.tar.gz: 254e9512c6c7b71f2845706a50aad23b9ad4403a6fea0e45a6fa912116be7cd3fd783aa3ff454755d4e622a3d34e00ff16442c40e996f46d54ccb0a673d08227
|
data/lib/cardknox/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cardknox
|
4
|
+
module Webhook
|
5
|
+
class << self
|
6
|
+
def verify_signature(params:, secret_key:, signature:)
|
7
|
+
sorted_values = params.to_h.sort_by do |key, _value|
|
8
|
+
key.downcase
|
9
|
+
end.map(&:last).join
|
10
|
+
|
11
|
+
hexdigest = Digest::MD5.hexdigest(
|
12
|
+
"#{sorted_values}#{secret_key}",
|
13
|
+
).upcase
|
14
|
+
|
15
|
+
hexdigest == signature
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/cardknox.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cardknox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Algonauti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- lib/cardknox/configuration.rb
|
58
58
|
- lib/cardknox/error.rb
|
59
59
|
- lib/cardknox/version.rb
|
60
|
+
- lib/cardknox/webhook.rb
|
60
61
|
homepage: https://github.com/algonauti/cardknow
|
61
62
|
licenses:
|
62
63
|
- MIT
|