integrallis / stripe_event

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

Fixes tests for Stripe 5.19.0 #133

Closed gaffneyc closed 4 years ago

gaffneyc commented 4 years ago

As of 5.19.0, the compute_signature method was made public and they split the timestamp into a separate param (which must be a Time). This version checks compute_signature based on the number of params it takes since doing a version check felt odd. Now that it is public, the method shouldn't change it's API.

The build is currently failing with errors like these:

  8) StripeEvent::WebhookController with multiple signing secrets succeeds with valid signature from first secret
     Failure/Error: signature = Stripe::Webhook::Signature.send(:compute_signature, "#{timestamp}.#{payload}", secret)

     ArgumentError:
       wrong number of arguments (given 2, expected 3)
     # ./spec/controllers/webhook_controller_spec.rb:16:in `generate_signature'
     # ./spec/controllers/webhook_controller_spec.rb:28:in `webhook_with_signature'
     # ./spec/controllers/webhook_controller_spec.rb:117:in `block (3 levels) in <top (required)>'

1: https://github.com/stripe/stripe-ruby/pull/915

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.9%) to 99.099% when pulling 3aea3a0e5fd38cb7f9a4e9012d5f0f003ace491b on gaffneyc:stripe-5-19-0 into 31d759d2d6b0c013319ea7ea1f0c93cccfef2b43 on integrallis:master.

rmm5t commented 4 years ago

Thank you!