formKeyValidator->validate($this->getRequest())) { $this->messageManager->addErrorMessage(__('Your session has expired. Please try again.')); return $this->resultRedirectFactory->create()->setPath('*/*/index'); } try { $this->applications->deleteForCustomer( (int)$this->getRequest()->getParam('id'), (int)$this->customerSession->getCustomerId() ); $this->messageManager->addSuccessMessage(__('The VAT number has been deleted.')); } catch (\Throwable $exception) { $this->messageManager->addErrorMessage($exception->getMessage()); } return $this->resultRedirectFactory->create()->setPath('*/*/index'); } }