Exception: Pago::WebhookSecretError

Inherits:
WebhookVerificationError show all
Defined in:
lib/pago/webhooks.rb

Overview

Raised when the endpoint secret is not a Standard Webhooks secret.

A secret is the whsec_ prefix followed by the base64 encoding of the signing key. Anything else — a missing prefix, an empty or malformed base64 body — is a configuration mistake, so it is reported instead of being silently treated as a signature mismatch.

Instance Method Summary collapse

Constructor Details

#initialize(reason = nil) ⇒ WebhookSecretError

Returns a new instance of WebhookSecretError.



17
18
19
20
# File 'lib/pago/webhooks.rb', line 17

def initialize(reason = nil)
  message = "Invalid webhook secret: expected the \"whsec_\" prefix followed by base64 encoded bytes"
  super(reason.nil? ? message : "#{message} (#{reason})")
end