From bd67d63b63cca3c889755d95fcf1dd94a16ae9e0 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 23 Jan 2020 16:19:56 +1100 Subject: [PATCH] Restore payment error feedback --- 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 79a9e42310..33c70f206a 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -68,6 +68,9 @@ class CheckoutController < Spree::CheckoutController render json: { path: order_path(@order) }, status: :ok end end + rescue Spree::Core::GatewayError => error + # This is done for all actions in the Spree::CheckoutController. + rescue_from_spree_gateway_error(error) rescue StandardError => error Bugsnag.notify(error) flash[:error] = I18n.t("checkout.failed")