Fix: Do not redirect to paypal if there is an error on the Order model
In case there is a validation issue with the Order we do not want to redirect to the paypal page.
This commit is contained in:
parent
1e0836b4a9
commit
04fa7f9c40
|
@ -227,6 +227,10 @@ module Spree
|
|||
end
|
||||
|
||||
load_order
|
||||
if not @order.errors.empty?
|
||||
render :edit and return
|
||||
end
|
||||
|
||||
payment_method = Spree::PaymentMethod.find(params[:order][:payments_attributes].first[:payment_method_id])
|
||||
|
||||
if payment_method.kind_of?(Spree::BillingIntegration::PaypalExpress) || payment_method.kind_of?(Spree::BillingIntegration::PaypalExpressUk)
|
||||
|
|
Loading…
Reference in New Issue