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.
12 13 14 |
# File 'lib/seam/webhook.rb', line 12 def initialize(secret) @webhook = Svix::Webhook.new(secret) end |
Instance Method Details
#verify(payload, headers) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/seam/webhook.rb', line 16 def verify(payload, headers) normalized_headers = headers.transform_keys(&:downcase) res = @webhook.verify(payload, normalized_headers) Seam::Resources::SeamEvent.load_from_response(res) end |