integrallis / stripe_event

Stripe webhook integration for Rails applications.
https://rubygems.org/gems/stripe_event
MIT License
840 stars 107 forks source link

Fix signature validation error if the first signing secret is nil #146

Closed beetlehope closed 2 years ago

beetlehope commented 2 years ago

This pull requests fixes the bug described in this issue.

Motivation: signing_secret method returns false if the first secret in the array is nil which is actually a valid state (a variable might be set to nil in one environment and not nil in another environment):

StripeEvent.signing_secrets = [
  ENV['STRIPE_SIGNING_SECRET_DEV_GB'], # nil
  ENV['STRIPE_SIGNING_SECRET_PROD_GB'], # not nil
  ...
]

Using compact fixes this issue.

Fixes #145

rmm5t commented 2 years ago

Thank you! 🍻