empikClientFactory = $empikClientFactory; $this->productRepository = $productRepository; $this->offersDataProvider = $offersDataProvider; $this->empikClient = $this->empikClientFactory->createClient(); } public function handle(array $ids) { try { $offersData = $this->offersDataProvider->getOffersDataByProductIds($ids); $this->empikClient->postOffers($offersData); return true; } catch (Exception $e) { $this->addError($e->getMessage()); } return false; } }