getRequest()->getParam('id'); $type = (string)$this->getRequest()->getParam('type'); $retried = $type === 'order' ? $this->orderRepository->retry($id) : ($type === 'shipment' && $this->shipmentRepository->retry($id)); if ($retried) { $this->messageManager->addSuccessMessage(__('The synchronization was queued for retry.')); } else { $this->messageManager->addErrorMessage(__('This record cannot be retried in its current state.')); } return $this->resultRedirectFactory->create()->setRefererUrl(); } }