integrallis/stripe_event — pull request #32 by rmm5t (2014-06-16 23:31:46+00:00)
Title: Subscribe to `account.application.deauthorized` events

When a Stripe Connect application receives an
`account.application.deauthorized` event, the tokens have already been
decommissioned, so the event_retriever is pretty much guaranteed to
throw a `Stripe::AuthenticationError`, and no subsequent event
subscriptions fire.

Instead, if we receive a `Stripe::AuthenticationError` from a known
account and the type is `account.application.deauthorized`, we can be
confident that this was an authorized webhook from Stripe. Under this
scenario, construct a `Stripe::Event` from the passed params instead of
retrieving the Event from Stripe's API and fire the subscribed hooks
directly.

Fixes #15