From b23b707b5d9daa61fa166244c9a17f37834566a0 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Fri, 24 Jul 2020 18:27:51 +0100 Subject: [PATCH] Notify bugsnag and execute post checkout actions (reset to cart state) whenever there's a payment gateway exceeption raised --- app/controllers/checkout_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index 3d068f1a8b..8c4aea8cc4 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -254,6 +254,9 @@ class CheckoutController < Spree::StoreController end def rescue_from_spree_gateway_error(error) + Bugsnag.notify(error) + checkout_failed + flash[:error] = t(:spree_gateway_error_flash_for_checkout, error: error.message) # This can also happen during the edit action # but the response needed here is the same as when the update action fails