From 509aa149e9b50af8c519f291c57da6de37ba30df Mon Sep 17 00:00:00 2001 From: Lukas Mencl Date: Fri, 6 Jan 2017 15:01:37 +0100 Subject: [PATCH] orderPayment is set to failed if any of payments is failed and no completed or processing --- .../Component/Core/OrderProcessing/StateResolver.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Sylius/Component/Core/OrderProcessing/StateResolver.php b/src/Sylius/Component/Core/OrderProcessing/StateResolver.php index f0ff407d702..ade0f4334bd 100644 --- a/src/Sylius/Component/Core/OrderProcessing/StateResolver.php +++ b/src/Sylius/Component/Core/OrderProcessing/StateResolver.php @@ -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; + } } }