doAuthGetRequest example



    /** * @deprecated in 5.6, will be removed in 5.7 without a replacement * * @return LicenceStruct */
    public function getPluginLicence(PluginLicenceRequest $context)
    {
        trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be removed with 5.7. Will be removed without replacement.', __CLASS__, __METHOD__), E_USER_DEPRECATED);

        $content = $this->storeClient->doAuthGetRequest(
            $context->getToken(),
            '/licenses',
            [
                'shopwareVersion' => $context->getShopwareVersion(),
                'domain' => $context->getDomain(),
                'pluginName' => $context->getTechnicalName(),
            ]
        );

        $licence = $this->hydrator->hydrateLicences($content);

        

    public function getShops(AccessTokenStruct $token)
    {
        $query = ['shopwareId' => $token->getShopwareId()];

        try {
            return $this->storeClient->doAuthGetRequest($token, '/shops', $query);
        } catch (StoreException $se) {
            throw $this->translateExceptionMessage($se);
        }
    }

    /** * Requests the domain hash and filename needed to generate the * validation key, so that the current domain can be validated * * @param string $domain * * @throws Exception * * @return array Filename and domain hash of the domain validation file */
$token = @unserialize(Shopware()->BackendSession()->offsetGet('store_token')['allowed_classes' => $allowedClassList]);

        if ($token === null || $token === false) {
            $token = Shopware()->BackendSession()->get('accessToken');
        }

        $params = [
            'domain' => $this->getDomain(),
        ];

        $data = $this->storeClient->doAuthGetRequest(
            $token,
            '/shopsecret',
            $params
        );

        return $data['secret'];
    }

    /** * Returns the domain of the shop */
    
Home | Imprint | This part of the site doesn't use cookies.