-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The webhook registry in the package assumes that all webhooks to be processed will be defined in the config It also couples subscribing to processing This PR removes the registration loggic from the config. It uses the provided webhook verification concern with new controllers
- Loading branch information
Showing
11 changed files
with
66 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
web/app/controllers/shopify_webhooks/app_uninstalled_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module ShopifyWebhooks | ||
class AppUninstalledController < ApplicationController | ||
include ShopifyApp::WebhookVerification | ||
|
||
def receive | ||
webhook_request = ShopifyAPI::Webhooks::Request.new(raw_body: request.raw_post, headers: request.headers.to_h) | ||
AppUninstalledJob.perform_later(shop_domain: webhook_request.shop, webhook: webhook_request.parsed_body) | ||
head(:no_content) | ||
end | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
web/app/controllers/shopify_webhooks/customer_data_request_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module ShopifyWebhooks | ||
class CustomerDataRequestController < ApplicationController | ||
include ShopifyApp::WebhookVerification | ||
|
||
def receive | ||
webhook_request = ShopifyAPI::Webhooks::Request.new(raw_body: request.raw_post, headers: request.headers.to_h) | ||
CustomerDataRequestJob.perform_later(shop_domain: webhook_request.shop, webhook: webhook_request.parsed_body) | ||
head(:no_content) | ||
end | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
web/app/controllers/shopify_webhooks/customer_redact_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module ShopifyWebhooks | ||
class CustomerRedactController < ApplicationController | ||
include ShopifyApp::WebhookVerification | ||
|
||
def receive | ||
webhook_request = ShopifyAPI::Webhooks::Request.new(raw_body: request.raw_post, headers: request.headers.to_h) | ||
CustomerRedactJob.perform_later(shop_domain: webhook_request.shop, webhook: webhook_request.parsed_body) | ||
head(:no_content) | ||
end | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
web/app/controllers/shopify_webhooks/shop_redact_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
module ShopifyWebhooks | ||
class ShopRedactController < ApplicationController | ||
include ShopifyApp::WebhookVerification | ||
|
||
def receive | ||
webhook_request = ShopifyAPI::Webhooks::Request.new(raw_body: request.raw_post, headers: request.headers.to_h) | ||
ShopRedactJob.perform_later(shop_domain: webhook_request.shop, webhook: webhook_request.parsed_body) | ||
head(:no_content) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters