/** * Get the list of shops (and details) associated to the given user * * @param AccessTokenStruct $token * @return array Array of shop details * @throws \Exception */ public function getShops(AccessTokenStruct $token) { $query = ['shopwareId' => $token->getShopwareId()]; try { return $this->storeClient->doAuthGetRequest($token, "/shops", $query); } catch (StoreException $se) { throw $this->translateExceptionMessage($se); } }
/** * generate new Secret by API Call * @return string */ private function generateApiShopSecret() { $token = Shopware()->BackendSession()->offsetGet('store_token'); $token = unserialize($token); if ($token == null) { $token = Shopware()->BackendSession()->accessToken; } $params = ['domain' => $this->getDomain()]; $data = $this->storeClient->doAuthGetRequest($token, '/shopsecret', $params); return $data['secret']; }
/** * @param LicenceRequest $context * @return array * @throws \Exception */ public function getLicences(LicenceRequest $context) { $result = $this->storeClient->doAuthGetRequest($context->getToken(), '/licenses', ['shopwareVersion' => $context->getShopwareVersion(), 'domain' => $context->getDomain()]); return $this->hydrator->hydrateLicences($result); }