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:
Holger Hans Peter Freyther 2013-01-31 22:51:27 +01:00
parent 1e0836b4a9
commit 04fa7f9c40
1 changed files with 4 additions and 0 deletions

View File

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