guaranteeCancelingService = $guaranteeCancelingService; } /** * Performs Signifyd guarantee cancel operation after order canceling * if cancel order operation was successful. * * @see Order::cancel * @param Order $order * @param OrderInterface $result * @return OrderInterface */ public function afterCancel(Order $order, $result) { if ($order->isCanceled()) { $this->guaranteeCancelingService->cancelForOrder( $order->getEntityId() ); } return $result; } }