redirectFactory->create()->setPath('sales/order/history'); if (!$this->formKeyValidator->validate($this->request)) { $this->messages->addErrorMessage(__('Your session has expired. Please try again.')); return $result; } try { $this->service->receive((int)$this->request->getParam('order_id'), (int)$this->session->getCustomerId()); $this->messages->addSuccessMessage(__('Receipt confirmed. You can now review the products in this order.')); } catch (\Throwable $exception) { $this->messages->addErrorMessage($exception instanceof \Magento\Framework\Exception\LocalizedException ? $exception->getMessage() : __('We could not confirm receipt right now.')); } return $result; } }