smoothcode 0.0.3 → 1.0.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/smoothcode/auth.rb +8 -1
  3. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 969f89d7113502314207c31135340ebf1d176fabc250091e0387077b80cd2cab
4
- data.tar.gz: 00c8fd602c6495d0bfe6655e9f60b539523622d4950461b66a19daa51de96113
3
+ metadata.gz: 4ba846674770db9e7109cf5ce90aa262c34528d85183bf841f7b665702cbba81
4
+ data.tar.gz: 610f09f311f76cc97198baaa4ef95cabc0a1d5fc901e8f215baab509575673b5
5
5
  SHA512:
6
- metadata.gz: a01046dc0f78d162d3f665d59a7a518387253a9a3e405dcc1811975ec6a6fceb1c9d5cd04aacfb4b8451d66ebe75a2f0ed99f2af94b8eb5c1b42a65d7876e311
7
- data.tar.gz: f27446ff540604c2c8acf6b55d6cf814ff194c3903e2544c4bc08151b0c3f188992e9d775a72a595bf580c9844b4cef91ca181eed55f070c3b8e9a0dfcc3dc68
6
+ metadata.gz: 8f5a0160a247e1e12d12f717430445a3a0bd3e5fdd113d133d751021418443955af8b5cf33f741503d2086d9da1c86030bdc0846b1180fcff802623bb8e74fae
7
+ data.tar.gz: a09ebdb2cad9a4d01fc4c14192a830b6fc2fbd01af2da4cda33bb954a4402b71d8a95b640b5a94d5e77c7f340d56f7cc3ad04943d85cc956238d4c60b03ce14f
@@ -12,8 +12,15 @@ class SmoothCodeAuth
12
12
 
13
13
  def webhook_request?(webhook_data)
14
14
  webhook_data = webhook_data.transform_keys(&:to_sym)
15
- webhook_id = webhook_data[:id]
15
+ webhook_id = webhook_data[:shopify_webhook_uuid]
16
16
 
17
17
  generate_hmac(@client_secret, webhook_id.to_s) == @request_hmac
18
18
  end
19
+
20
+ def gdpr_webhook_request?(webhook_data)
21
+ webhook_data = webhook_data.transform_keys(&:to_sym)
22
+ shop_id = webhook_data[:shop_id]
23
+
24
+ generate_hmac(@client_secret, shop_id.to_s) == @request_hmac
25
+ end
19
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smoothcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SmoothCode
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-26 00:00:00.000000000 Z
11
+ date: 2022-10-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby client to interact with SmoothCode
14
14
  email: hello@smoothcode.io
@@ -23,7 +23,7 @@ homepage: https://github.com/Smooth-Code-IO/smoothcode-client-ruby
23
23
  licenses:
24
24
  - MIT
25
25
  metadata: {}
26
- post_install_message:
26
+ post_install_message:
27
27
  rdoc_options: []
28
28
  require_paths:
29
29
  - lib
@@ -38,8 +38,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  requirements: []
41
- rubygems_version: 3.0.3.1
42
- signing_key:
41
+ rubygems_version: 3.0.9
42
+ signing_key:
43
43
  specification_version: 4
44
44
  summary: Ruby client to interact with SmoothCode
45
45
  test_files: []