7
8
9
10
11
12
13
14
15
16
17
|
# File 'app/controllers/stripe_event/webhook_controller_decorator.rb', line 7
def secrets(payload, signature)
all_signing_keys = SpreeStripe::WebhookKey.pluck(:signing_secret).uniq.compact
all_signing_keys << ENV['STRIPE_SIGNING_SECRET'] if ENV['STRIPE_SIGNING_SECRET'].present?
return all_signing_keys if all_signing_keys.any?
raise Stripe::SignatureVerificationError.new(
'Cannot verify signature without a `StripeEvent.signing_secret`',
signature, http_body: payload
)
end
|