Esempio n. 1
0
 /**
  * @param AccessTokenStruct $token
  * @param OrderRequest $context
  * @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()]]]];
     $response = $this->storeClient->doAuthPostRequest($token, '/basket', $data);
     $basket = $this->hydrator->hydrateBasket($response);
     $basket->setLicenceDomain($context->getLicenceShop());
     return $basket;
 }
 /**
  * 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);
     }
 }