Skip to content

Commit

Permalink
orderPayment is set to failed if any of payments is failed and no com…
Browse files Browse the repository at this point in the history
…pleted or processing
  • Loading branch information
Tetragramat committed Jan 6, 2017
1 parent 69c26f6 commit 509aa14
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Sylius/Component/Core/OrderProcessing/StateResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ public function resolvePaymentState(OrderInterface $order)
));
})) {
$paymentState = PaymentInterface::STATE_PROCESSING;
}
} elseif ($payments->exists(function ($key, $payment) {
return in_array($payment->getState(), array(
PaymentInterface::STATE_FAILED,
));
})) {
$paymentState = PaymentInterface::STATE_FAILED;
}
}
}

Expand Down

0 comments on commit 509aa14

Please sign in to comment.