/** * @param \Shopware_StoreApi_Models_Auth $auth * @param string $hostname * @return int|\Shopware_StoreApi_Models_Domain */ private function connect(\Shopware_StoreApi_Models_Auth $auth, $hostname) { /** @var $domain \Shopware_StoreApi_Models_Domain */ $domain = $this->store->getAccountService()->getDomain($auth, $hostname); if ($domain instanceof \Shopware_StoreApi_Exception_Response) { $this->handleError(array('success' => false, 'code' => $domain->getCode(), 'message' => "Your currently used shop domain isn't associated with your shopware account.")); } return $domain; }
/** * @param $auth * @param $domain * @param $productId * @return mixed|\Shopware_StoreApi_Exception_Response */ private function getLicensedProduct(\Shopware_StoreApi_Models_Auth $auth, \Shopware_StoreApi_Models_Domain $domain, $productId) { //if the order process was successful we have to get the licenced product to get the available downloads. $licencedProduct = $this->store->getAccountService()->getLicencedProductById($auth, $domain, $productId, $this->store->getNumericShopwareVersion()); //check if the product was found if ($licencedProduct instanceof \Shopware_StoreApi_Exception_Response) { $this->handleError(array('source' => 'licencedProduct', 'code' => $licencedProduct->getCode(), 'message' => $licencedProduct->getMessage())); } return $licencedProduct; }