15 use Psr\Log\LoggerInterface;
25 private $caseManagement;
30 private $caseUpdatingServiceFactory;
40 private $createGuaranteeAbility;
63 $this->caseManagement = $caseManagement;
64 $this->caseUpdatingServiceFactory = $caseUpdatingServiceFactory;
65 $this->gateway = $gateway;
66 $this->createGuaranteeAbility = $createGuaranteeAbility;
75 if (!$this->createGuaranteeAbility->isAvailable($orderId)) {
79 $caseEntity = $this->caseManagement->getByOrderId($orderId);
82 $disposition = $this->gateway->submitCaseForGuarantee($caseEntity->getCaseId());
84 $this->logger->error($e->getMessage());
88 $updatingService = $this->caseUpdatingServiceFactory->create(
'guarantees/creation');
90 'caseId' => $caseEntity->getCaseId(),
91 'guaranteeDisposition' => $disposition
93 $updatingService->update($caseEntity,
$data);
__construct(CaseManagementInterface $caseManagement, UpdatingServiceFactory $caseUpdatingServiceFactory, Gateway $gateway, CreateGuaranteeAbility $createGuaranteeAbility, LoggerInterface $logger)