mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user