getShopSecret example

$data['shopUserToken']['token'],
            new \DateTimeImmutable($data['shopUserToken']['expirationDate'])
        );

        $accessTokenStruct = new AccessTokenStruct(
            $userToken,
            $data['shopSecret'] ?? null,
        );

        $this->storeService->updateStoreToken($context$accessTokenStruct);

        $this->configService->set('core.store.shopSecret', $accessTokenStruct->getShopSecret());
    }

    /** * @return array<string, mixed> */
    public function userInfo(Context $context): array
    {
        $response = $this->client->request(
            Request::METHOD_GET,
            $this->endpoints['user_info'],
            [
                


    /** * check if secret is set and set if it isn't * return true if secret finally exists * * @return void */
    public function checkSecretAction()
    {
        $subscriptionService = $this->container->get(SubscriptionService::class);
        $secret = $subscriptionService->getShopSecret();

        if (empty($secret)) {
            try {
                $subscriptionService->setShopSecret();
            } catch (Exception $e) {
                $this->View()->assign(['success' => false, 'error' => $e->getMessage()]);

                return;
            }
        }

        
'primaryKey' => $source->getUserId(), 'data' => []]],
                    new Criteria(),
                    $this->context,
                ),
            );
        $userConfigRepository->expects(static::once())
            ->method('delete');

        $systemConfigService = $this->createMock(SystemConfigService::class);
        $systemConfigService->expects(static::once())
            ->method('set')
            ->with(StoreRequestOptionsProvider::CONFIG_KEY_STORE_SHOP_SECRET, $accessTokenStruct->getShopSecret());

        $frwService = $this->createFirstRunWizardService(
            storeService: $storeService,
            systemConfigService: $systemConfigService,
            frwClient: $frwClient,
            userConfigRepository: $userConfigRepository,
        );

        $frwService->upgradeAccessToken($this->context);
    }

    
$accessToken = $this->createAccessTokenStruct($accessTokenResponse$accessTokenResponse['firstRunWizardUserToken']);

        $this->updateFrwUserToken($context$accessToken);
    }

    public function upgradeAccessToken(Context $context): void
    {
        $accessTokenResponse = $this->frwClient->upgradeAccessToken($context);
        $accessToken = $this->createAccessTokenStruct($accessTokenResponse$accessTokenResponse['shopUserToken']);

        $this->storeService->updateStoreToken($context$accessToken);
        $this->configService->set(StoreRequestOptionsProvider::CONFIG_KEY_STORE_SHOP_SECRET, $accessToken->getShopSecret());
        $this->removeFrwUserToken($context);
    }

    public function finishFrw(bool $failed, Context $context): void
    {
        $currentState = $this->getFrwState();

        if ($failed) {
            $newState = FrwState::failedState(null, $currentState->getFailureCount() + 1);
        } else {
            $this->trackingEventClient->fireTrackingEvent(self::TRACKING_EVENT_FRW_FINISHED);
            
return false;
        }
    }

    /** * Requests the plugin information from the store API and returns the parsed result. * * @return PluginInformationResultStruct */
    public function getPluginInformationFromApi()
    {
        $secret = $this->getShopSecret();

        $domain = $this->getDomain();
        $params = [
            'domain' => $domain,
            'shopwareVersion' => $this->release->getVersion(),
            'plugins' => $this->getPluginsNameAndVersion(),
        ];

        $header = $secret ? ['X-Shopware-Shop-Secret' => $secret] : [];

        $data = $this->storeClient->doPostRequest(
            
Home | Imprint | This part of the site doesn't use cookies.