getShopwareId example

/** * @return void */
    public function getAccessTokenAction()
    {
        $token = $this->getAccessToken();

        if (!$token instanceof AccessTokenStruct) {
            $this->View()->assign('success', false);
        } else {
            $this->View()->assign(['success' => true, 'shopwareId' => $token->getShopwareId()]);
        }
    }

    /** * @return void */
    public function loginAction()
    {
        if (!$this->isApiAvailable()) {
            $this->View()->assign('success', false);

            


    /** * @return BasketStruct */
    public function getCheckout(
        AccessTokenStruct $token,
        OrderRequest $context
    ) {
        $data = [
            'origin' => ['name' => 'Shopware Backend'],
            'shopwareId' => $token->getShopwareId(),
            'positions' => [
                [
                    'licenseShopDomain' => $context->getLicenceShop(),
                    'bookingShopDomain' => $context->getBookingShop(),
                    'orderNumber' => $context->getOrderNumber(),
                    'isArticle' => true,
                    'priceModel' => [
                        'price' => $context->getPrice(),
                        'type' => $context->getPriceType(),
                    ],
                ],
            ],


    /** * Get the list of shops (and details) associated to the given user * * @throws Exception * * @return array Array of shop details */
    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 */
Home | Imprint | This part of the site doesn't use cookies.