Notify bugsnag and execute post checkout actions (reset to cart state) whenever there's a payment gateway exceeption raised

This commit is contained in:
Luis Ramos
2020-07-24 18:27:51 +01:00
parent 1bf946d124
commit b23b707b5d

View File

@@ -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