public function generate(OrderItem $orderItem, Order $order)
    {
        $itemParams = $this->parentOrderItemRequestGenerator->generate($orderItem, $order);

        $customerGroupIdentity = $this->identityService->findOneBy([
            'objectIdentifier' => $order->getCustomer()->getCustomerGroupIdentifier(),
            'adapterName' => ShopwareAdapter::NAME,
            'objectType' => CustomerGroup::TYPE,
        ]);

        if (null === $customerGroupIdentity) {
            throw new RuntimeException('could not find customer group identity of bundle');
        }

        $bundle = $this->getBundle($orderItem->getNumber(), $customerGroupIdentity->getAdapterIdentifier());

        if (empty($bundle)) {
            return $itemParams;
        }

        $vatIdentity = $this->identityService->findOneBy([
            'objectIdentifier' => $orderItem->getVatRateIdentifier(),
            'adapterName' => ShopwareAdapter::NAME,
            'objectType' => VatRate::TYPE,
        ]);

        if (null === $vatIdentity) {
            throw new RuntimeException('could not find vat identity of bundle');
        }

        /**
         * @var Repository $taxRepository
         */
        $taxRepository = $this->entityManager->getRepository(Tax::class);

        /**
         * @var null|Tax $taxModel
         */
        $taxModel = $taxRepository->find($vatIdentity->getAdapterIdentifier());

        if (null === $taxModel) {
            throw new RuntimeException('could not find shopware vat model of bundle');
        }

        $itemParams['orderItemName'] = $bundle['name'];

        $itemParams['amounts'][0]['priceOriginalGross'] = $bundle['price'] * (1 + ($taxModel->getTax() / 100));

        return $itemParams;
    }
public function generate(OrderItem $orderItem, Order $order)
    {
        $itemParams = $this->parentOrderItemRequestGenerator->generate($orderItem, $order);

        $customerGroupIdentity = $this->identityService->findOneBy([
            'objectIdentifier' => $order->getCustomer()->getCustomerGroupIdentifier(),
            'adapterName' => ShopwareAdapter::NAME,
            'objectType' => CustomerGroup::TYPE,
        ]);

        if (null === $customerGroupIdentity) {
            throw new RuntimeException('could not find customer group identity of bundle');
        }

        $bundle = $this->getBundle($orderItem->getNumber(), $customerGroupIdentity->getAdapterIdentifier());

        if (empty($bundle)) {
            return $itemParams;
        }

        $vatIdentity = $this->identityService->findOneBy([
            'objectIdentifier' => $orderItem->getVatRateIdentifier(),
            'adapterName' => ShopwareAdapter::NAME,
            'objectType' => VatRate::TYPE,
        ]);

        if (null === $vatIdentity) {
            throw new RuntimeException('could not find vat identity of bundle');
        }

        /**
         * @var Repository $taxRepository
         */
        $taxRepository = $this->entityManager->getRepository(Tax::class);

        /**
         * @var null|Tax $taxModel
         */
        $taxModel = $taxRepository->find($vatIdentity->getAdapterIdentifier());

        if (null === $taxModel) {
            throw new RuntimeException('could not find shopware vat model of bundle');
        }

        $itemParams['orderItemName'] = $bundle['name'];

        $itemParams['amounts'][0]['priceOriginalGross'] = $bundle['price'] * (1 + ($taxModel->getTax() / 100));

        return $itemParams;
    }
@param OrderItem $orderItem
@param Order     $order

@return array