From 251f6c20fee3d2f07d930d15db8cece787b068f7 Mon Sep 17 00:00:00 2001 From: Brian Quinn Date: Tue, 11 Jan 2011 13:13:58 +0000 Subject: [PATCH] Prevent IPN errors on zero amount orders --- app/controllers/paypal_express_callbacks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/paypal_express_callbacks_controller.rb b/app/controllers/paypal_express_callbacks_controller.rb index 0ea0a0c..635e367 100644 --- a/app/controllers/paypal_express_callbacks_controller.rb +++ b/app/controllers/paypal_express_callbacks_controller.rb @@ -8,7 +8,7 @@ class PaypalExpressCallbacksController < Spree::BaseController @notification = Paypal::Notification.new(request.raw_post) # we only care about eChecks (for now?) - if @notification.params["payment_type"] == "echeck" && @notification.acknowledge && @payment + if @notification.params["payment_type"] == "echeck" && @notification.acknowledge && @payment && @order.total >= @payment.amount case @notification.params["payment_status"] when "Denied" create_txn PaypalTxn::TxnType::DENIED