10 use Magento\Sales\Model\OrderFactory;
21 private $orderFactory;
26 private $orderManagement;
31 private $commentsHistoryUpdater;
39 OrderFactory $orderFactory,
43 $this->orderFactory = $orderFactory;
45 $this->commentsHistoryUpdater = $commentsHistoryUpdater;
56 $orderId =
$case->getOrderId();
58 switch (
$case->getGuaranteeDisposition()) {
60 $this->unHold($orderId);
63 $this->hold($orderId);
66 if ($this->hold($orderId)) {
67 $this->commentsHistoryUpdater->addComment(
69 __(
'Awaiting the Signifyd guarantee disposition.'),
83 private function unHold($orderId)
85 $order = $this->getOrder($orderId);
87 return $this->orderManagement->unHold($orderId);
99 private function hold($orderId)
101 $order = $this->getOrder($orderId);
103 return $this->orderManagement->hold($orderId);
115 private function getOrder($orderId)
117 return $this->orderFactory->create()->load($orderId);
__construct(OrderFactory $orderFactory, OrderManagementInterface $orderManagement, CommentsHistoryUpdater $commentsHistoryUpdater)
updateByCase(CaseInterface $case)