public function consume(CouponConsumeEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $totalDiscount = 0;
        $isValid = false;

        /** @var CouponInterface $coupon */
        $coupon = $this->couponFactory->buildCouponFromCode($event->getCode());

        if ($coupon) {
            $isValid = $coupon->isMatching();

            if ($isValid) {
                $this->couponManager->pushCouponInSession($event->getCode());
                $totalDiscount = $this->couponManager->getDiscount();

                $this->getSession()
                    ->getSessionCart($dispatcher)
                    ->setDiscount($totalDiscount)
                    ->save();

                $this->getSession()
                    ->getOrder()
                    ->setDiscount($totalDiscount)
                ;
            }
        }

        $event->setIsValid($isValid);
        $event->setDiscount($totalDiscount);
    }