25 $integrationId = (int)$this->
getRequest()->getParam(self::PARAM_INTEGRATION_ID);
28 $integrationData = $this->_integrationService->get($integrationId);
29 if ($this->_integrationData->isConfigType($integrationData)) {
30 $this->messageManager->addError(
32 "Uninstall the extension to remove integration '%1'.",
33 $this->escaper->escapeHtml($integrationData[Info::DATA_NAME])
36 return $resultRedirect->setPath(
'*/*/');
38 $integrationData = $this->_integrationService->delete($integrationId);
39 if (!$integrationData[Info::DATA_ID]) {
40 $this->messageManager->addError(
__(
'This integration no longer exists.'));
43 if (isset($integrationData[Info::DATA_CONSUMER_ID])) {
44 $this->_oauthService->deleteConsumer($integrationData[Info::DATA_CONSUMER_ID]);
46 $this->_registry->register(self::REGISTRY_KEY_CURRENT_INTEGRATION, $integrationData);
47 $this->messageManager->addSuccess(
49 "The integration '%1' has been deleted.",
50 $this->escaper->escapeHtml($integrationData[Info::DATA_NAME])
55 $this->messageManager->addError(
__(
'Integration ID is not specified or is invalid.'));
58 $this->messageManager->addError($e->getMessage());
59 }
catch (\Exception $e) {
60 $this->_logger->critical($e);
63 return $resultRedirect->setPath(
'*/*/');