/** * Requests the validation of the current installation's domain * * @param string $domain * @param string $shopwareVersion Current Shopware version * @param AccessTokenStruct $token * @return array Result of the validation operation (empty if successful) * @throws \Exception */ public function verifyDomain($domain, $shopwareVersion, AccessTokenStruct $token) { $postData = ['shopwareId' => $token->getShopwareId(), 'domain' => $domain, 'shopwareVersion' => $shopwareVersion]; try { return $this->storeClient->doAuthPostRequest($token, "/domainverifications", $postData); } catch (StoreException $se) { throw $this->translateExceptionMessage($se); } }
/** * @param AccessTokenStruct $accessToken * @param OrderRequest $context * @throws \Exception * @return bool */ public function orderPlugin(AccessTokenStruct $accessToken, OrderRequest $context) { $data = ['origin' => ['name' => 'Shopware Backend'], 'shopwareId' => $accessToken->getShopwareId(), 'positions' => [['licenseShopDomain' => $context->getLicenceShop(), 'bookingShopDomain' => $context->getBookingShop(), 'orderNumber' => $context->getOrderNumber(), 'isArticle' => true, 'priceModel' => ['type' => $context->getPriceType(), 'price' => $context->getPrice()]]]]; $response = $this->storeClient->doAuthPostRequestRaw($accessToken, '/orders', $data); return $response->getStatusCode() == 204; }