Exemplo n.º 1
0
 /**
  * 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);
     }
 }
Exemplo n.º 2
0
 /**
  * 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'];
 }
Exemplo n.º 3
0
 /**
  * @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);
 }