Class: Seam::Webhook
- Inherits:
-
Object
- Object
- Seam::Webhook
- Defined in:
- lib/seam/webhook.rb
Instance Method Summary collapse
-
#initialize(secret) ⇒ Webhook
constructor
A new instance of Webhook.
- #verify(payload, headers) ⇒ Object
Constructor Details
#initialize(secret) ⇒ Webhook
Returns a new instance of Webhook.
11 12 13 |
# File 'lib/seam/webhook.rb', line 11 def initialize(secret) @webhook = Svix::Webhook.new(secret) end |
Instance Method Details
#verify(payload, headers) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/seam/webhook.rb', line 15 def verify(payload, headers) normalized_headers = headers.transform_keys(&:downcase) res = @webhook.verify(payload, normalized_headers) Seam::Resources::SeamEvent.load_from_response(res) end |