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 = nil) ⇒ Object
Checks if webhook is valid.
Class Method Details
.call(webhook, config = nil) ⇒ Object
Checks if webhook is valid
11 12 13 14 15 16 |
# File 'lib/castle/webhooks/verify.rb', line 11 def call(webhook, config = nil) config ||= Castle.config expected_signature = compute_signature(webhook, config) signature = webhook.env['HTTP_X_CASTLE_SIGNATURE'] verify_signature(signature, expected_signature) end |