Skip to content

Commit

Permalink
Fix issue where mass capture would continue despite errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RBech committed Nov 12, 2018
1 parent 1848898 commit 7adafde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/code/community/Quickpay/Payment/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ 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 */
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();

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);
Expand All @@ -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;
}
}

Expand Down

0 comments on commit 7adafde

Please sign in to comment.