private function getToken(string
$shopwareId, string
$password): AccessTokenStruct
{ $token =
Shopware()->
BackendSession()->
get('accessToken'
);
if (empty($token) ||
$token->
getExpire()->
getTimestamp() <=
strtotime('+30 seconds'
)) { if (empty($shopwareId) ||
empty($password)) { throw new RuntimeException('Could not login - missing login data'
);
} $accountManagerService =
$this->container->
get('shopware_plugininstaller.account_manager_service'
);
$token =
$accountManagerService->
getToken($shopwareId,
$password);
Shopware()->
BackendSession()->
set('accessToken',
$token);
}