From ec0d06af542f167f23e049816000acf573f96db6 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Fri, 24 Jul 2020 18:29:47 +0100 Subject: [PATCH] Reuse update_failed method as the code needed is exactly the same --- app/controllers/checkout_controller.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index 8c4aea8cc4..dd1a67c702 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -254,13 +254,10 @@ 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 - update_failed_response + # but the actions and response needed are exactly the same as when the update action fails + update_failed(error) end def permitted_params