lib/stripe_event.rb in stripe_event-1.1.0 vs lib/stripe_event.rb in stripe_event-1.2.0
- old
+ new
@@ -13,9 +13,15 @@
alias :setup :configure
def instrument(params)
begin
event = event_retriever.call(params)
+ rescue Stripe::AuthenticationError => e
+ if params[:type] == "account.application.deauthorized"
+ event = Stripe::Event.construct_from(params.deep_symbolize_keys)
+ else
+ raise UnauthorizedError.new(e)
+ end
rescue Stripe::StripeError => e
raise UnauthorizedError.new(e)
end
backend.instrument namespace.call(event[:type]), event