30 private $integrationService;
35 private $oauthService;
49 $this->integrationService = $integrationService;
51 $this->oauthService = $oauthService;
63 $this->config->getConfigDataValue(
'analytics/integration_name')
69 $integrationData[
'integration_id'] =
$integration->getId();
70 $this->integrationService->update($integrationData);
81 $consumerId = $this->generateIntegration()->getConsumerId();
82 $accessToken = $this->oauthService->getAccessToken($consumerId);
83 if (!$accessToken && $this->oauthService->createAccessToken($consumerId,
true)) {
84 $accessToken = $this->oauthService->getAccessToken($consumerId);
94 private function generateIntegration()
97 $this->config->getConfigDataValue(
'analytics/integration_name')
100 $integration = $this->integrationService->create($this->getIntegrationData());
114 'name' => $this->config->getConfigDataValue(
'analytics/integration_name'),
116 'all_resources' =>
false,
118 'Magento_Analytics::analytics',
119 'Magento_Analytics::analytics_api' 122 return $integrationData;
__construct(SystemConfig $config, IntegrationServiceInterface $integrationService, OauthServiceInterface $oauthService)