public function buildJsRedirect()
    {
        if (!is_null($this->js)) {
            return $this->js;
        }

        $builder = new ShopgateBuilder($this->initConfig());

        try {
            $this->js = $builder->buildJsRedirect($this->request->getParams(), $_COOKIE);
        } catch (\ShopgateMerchantApiException $e) {
            $this->logger->error('JS > oAuth access token for store not set: ' . $e->getMessage());

            return null;
        } catch (\Exception $e) {
            $this->logger->error('JS > error in HTTP redirect: ' . $e->getMessage());

            return null;
        }

        return $this->js;
    }