Exception: Pago::WebhookSecretError
- Inherits:
-
WebhookVerificationError
- Object
- StandardError
- Error
- WebhookError
- WebhookVerificationError
- Pago::WebhookSecretError
- 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
-
#initialize(reason = nil) ⇒ WebhookSecretError
constructor
A new instance of WebhookSecretError.
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) = "Invalid webhook secret: expected the \"whsec_\" prefix followed by base64 encoded bytes" super(reason.nil? ? : "#{} (#{reason})") end |