23 $integrationName = $this->escaper->escapeHtml($integrationName);
24 $msg = $isReauthorize ?
__(
25 "Integration '%1' has been sent for re-authorization.",
28 "Integration '%1' has been sent for activation.",
31 $this->messageManager->addNotice($msg);
42 $integrationId = $this->
getRequest()->getParam(self::PARAM_INTEGRATION_ID);
43 $isReauthorize = (bool)$this->
getRequest()->getParam(self::PARAM_REAUTHORIZE, 0);
44 $integration = $this->_integrationService->get($integrationId);
47 $this->_oauthService->deleteIntegrationToken(
$integration->getConsumerId());
48 $integration->setStatus(IntegrationModel::STATUS_INACTIVE)->save();
53 $this->_view->loadLayout(
false);
56 $this->_view->renderLayout();
57 $popupContent = $this->_response->getBody();
58 $consumer = $this->_oauthService->loadConsumer(
$integration->getConsumerId());
59 if (!$consumer->getId()) {
60 throw new \Magento\Framework\Oauth\Exception(
62 'A consumer with "%1" ID doesn\'t exist. Verify the ID and try again.',
69 IntegrationModel::IDENTITY_LINK_URL =>
$integration->getIdentityLinkUrl(),
70 'oauth_consumer_key' => $consumer->getKey(),
71 'popup_content' => $popupContent,
75 $this->messageManager->addError($e->getMessage());
78 }
catch (\Exception $e) {
79 $this->_logger->critical($e);
80 $this->messageManager->addError(
__(
'Internal error. Check exception log for details.'));
_setActivationInProcessMsg($isReauthorize, $integrationName)
_redirect($path, $arguments=[])