public function isValid(IsValidPaymentEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $module = $event->getModule();

        // dispatch event to target specific module
        $dispatcher->dispatch(
            TheliaEvents::getModuleEvent(
                TheliaEvents::MODULE_PAYMENT_IS_VALID,
                $module->getCode()
            ),
            $event
        );

        if ($event->isPropagationStopped()) {
            return;
        }

        // call legacy module method
        $event->setValidModule($module->isValidPayment());
    }
public function isValid(IsValidPaymentEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $module = $event->getModule();

        // dispatch event to target specific module
        $dispatcher->dispatch(
            TheliaEvents::getModuleEvent(
                TheliaEvents::MODULE_PAYMENT_IS_VALID,
                $module->getCode()
            ),
            $event
        );

        if ($event->isPropagationStopped()) {
            return;
        }

        // call legacy module method
        $event->setValidModule($module->isValidPayment());
    }
public function isValid ( IsValidPaymentEvent $ event , $ eventName , EventDispatcherInterface $ dispatcher ) { $ module = $ event -> getModule ( ) ; // dispatch event to target specific module $ dispatcher -> dispatch ( TheliaEvents :: getModuleEvent ( TheliaEvents :: MODULE_PAYMENT_IS_VALID , $ module -> getCode ( ) ) , $ event ) ; if ( $ event -> isPropagationStopped ( ) ) { return ; } // call legacy module method $ event -> setValidModule ( $ module -> isValidPayment ( ) ) ; }
Check if a module is valid

@param IsValidPaymentEvent $event
Check if a module is valid