From 7adafde17d2b07b4207daa7f81f25665ea66ea1f Mon Sep 17 00:00:00 2001 From: Rasmus Bech Date: Mon, 12 Nov 2018 10:01:09 +0100 Subject: [PATCH] Fix issue where mass capture would continue despite errors --- app/code/community/Quickpay/Payment/Helper/Data.php | 1 + .../Payment/controllers/Adminhtml/QuickpayController.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/code/community/Quickpay/Payment/Helper/Data.php b/app/code/community/Quickpay/Payment/Helper/Data.php index 33e3a35..5ded43e 100644 --- a/app/code/community/Quickpay/Payment/Helper/Data.php +++ b/app/code/community/Quickpay/Payment/Helper/Data.php @@ -462,6 +462,7 @@ public function createTransaction($order, $transactionId, $type) $transaction->setOrderPaymentObject($order->getPayment()); $transaction->setOrder($order); } + if ($type == Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH) { $transaction->setIsClosed(false); } else { diff --git a/app/code/community/Quickpay/Payment/controllers/Adminhtml/QuickpayController.php b/app/code/community/Quickpay/Payment/controllers/Adminhtml/QuickpayController.php index c1fd20f..0ac25a1 100644 --- a/app/code/community/Quickpay/Payment/controllers/Adminhtml/QuickpayController.php +++ b/app/code/community/Quickpay/Payment/controllers/Adminhtml/QuickpayController.php @@ -24,6 +24,7 @@ public function massCaptureAction() if (!$order->canInvoice()) { $this->_getSession()->addError($this->__('Could not create invoice for %s', $order->getIncrementId())); + continue; } /* @var $invoice Mage_Sales_Model_Order_Invoice */ @@ -31,6 +32,7 @@ public function massCaptureAction() if (!$invoice->getTotalQty()) { $this->_getSession()->addError($this->__('Cannot create an invoice without products for %s.', $order->getIncrementId())); + continue; } $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE); @@ -43,6 +45,7 @@ public function massCaptureAction() $transactionSave->save(); } catch (Exception $e) { $this->_getSession()->addError($this->__('Invoice and capture failed for %s: %s', $order->getIncrementId(), $e->getMessage())); + continue; } }