Replace #raise with #return in Checkout::StripeRedirect

The (potential) unhappy code path here was raising an error which would not be explicitly handled, and would in theory not return a useful message / response.
This commit is contained in:
Matt-Yorkley
2021-12-06 13:36:39 +00:00
parent 0fc4b851f2
commit b77ff346a3
2 changed files with 2 additions and 1 deletions

View File

@@ -178,6 +178,7 @@ class CheckoutController < ::BaseController
if @order.state == "payment"
return if redirect_to_payment_gateway
return action_failed if @order.errors.any?
return action_failed unless @order.process_payments!
end

View File

@@ -16,7 +16,7 @@ module Checkout
payment = payment_authorizer.call!(return_url)
raise if order.errors.any?
return if order.errors.any?
stripe_payment_url(payment)
end