Skip to content

Commit 1b6c66e

Browse files
committed
Merge branch 'MAGETWO-24173' of github.corp.ebay.com:magento-mpi/magento2ce into pull-request
2 parents 14b93b9 + 72857fd commit 1b6c66e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/code/Magento/Sales/Model/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ public function canVoidPayment()
520520
*/
521521
protected function _canVoidOrder()
522522
{
523-
return !($this->canUnhold() || $this->isPaymentReview());
523+
return !($this->isCanceled() || $this->canUnhold() || $this->isPaymentReview());
524524
}
525525

526526
/**

app/code/Magento/Sales/Test/Unit/Model/OrderTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,11 @@ public function testCanVoidPayment($actionFlags, $orderState)
348348
$order->setData('state', $orderState);
349349
$payment = $this->_prepareOrderPayment($order);
350350
$canVoidOrder = true;
351+
352+
if ($orderState == \Magento\Sales\Model\Order::STATE_CANCELED) {
353+
$canVoidOrder = false;
354+
}
355+
351356
if ($orderState == \Magento\Sales\Model\Order::STATE_PAYMENT_REVIEW) {
352357
$canVoidOrder = false;
353358
}

0 commit comments

Comments
 (0)