private function processPrices(ProductInterface $variant, array $variantData)
    {
        if (!isset($variantData['prices']) || !is_array($variantData['prices'])) {
            return;
        }

        $currentPrices = iterator_to_array($variant->getPrices());
        foreach ($variantData['prices'] as $price) {
            $matchingEntity = $this->retrievePriceByCurrency($currentPrices, $price['currency']['id']);

            // Create new price if no match was found.
            if (!$matchingEntity) {
                $this->productPriceManager->createNewProductPriceForCurrency(
                    $variant,
                    $price['price'],
                    0,
                    $price['currency']['id']
                );
            } else {
                // Otherwise just update price.
                $matchingEntity->setPrice($price['price']);
            }
        }

        // The following prices were not matched and therefore have to be deleted.
        foreach ($currentPrices as $price) {
            $this->entityManager->remove($price);
        }
    }