23 $integrationName = $this->escaper->escapeHtml($integrationName);
24 $successMsg = $isReauthorize ?
__(
25 "The integration '%1' has been re-authorized.",
28 "The integration '%1' has been activated.",
31 $this->messageManager->addSuccess($successMsg);
42 $integrationId = $this->
getRequest()->getParam(self::PARAM_INTEGRATION_ID);
43 $integration = $this->_integrationService->get($integrationId);
44 $clearExistingToken = (int)$this->
getRequest()->getParam(self::PARAM_REAUTHORIZE, 0);
45 if ($this->_oauthService->createAccessToken(
$integration->getConsumerId(), $clearExistingToken)) {
46 $integration->setStatus(IntegrationModel::STATUS_ACTIVE)->save();
49 $this->_registry->register(
50 self::REGISTRY_KEY_CURRENT_INTEGRATION,
51 $this->_integrationService->get($integrationId)->getData()
54 $this->messageManager->addError($e->getMessage());
57 }
catch (\Exception $e) {
58 $this->_logger->critical($e);
59 $this->messageManager->addError(
__(
'Internal error. Check exception log for details.'));
63 $this->_view->loadLayout(
false);
66 $this->_view->renderLayout();
_redirect($path, $arguments=[])
_setActivationSuccessMsg($isReauthorize, $integrationName)