Class: Castle::Webhooks::Verify
- Inherits:
-
Object
- Object
- Castle::Webhooks::Verify
- Defined in:
- lib/castle/webhooks/verify.rb
Overview
Verify a webhook
Class Method Summary collapse
-
.call(webhook, config = Castle.config) ⇒ Object
Checks if webhook is valid.
Class Method Details
.call(webhook, config = Castle.config) ⇒ Object
Checks if webhook is valid
11 12 13 14 15 |
# File 'lib/castle/webhooks/verify.rb', line 11 def call(webhook, config = Castle.config) expected_signature = compute_signature(webhook, config.api_secret) signature = webhook.env['HTTP_X_CASTLE_SIGNATURE'] verify_signature(signature, expected_signature) end |