src/EventListener/PaymentResourceGenerixAddOrUpdateListener.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\EventListener;
  3. use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
  4. use Symfony\Component\Messenger\MessageBusInterface;
  5. use App\Message\ValidateOrder;
  6. class PaymentResourceGenerixAddOrUpdateListener {
  7.     private $bus;
  8.     public function __construct(MessageBusInterface $bus)
  9.     {
  10.         $this->bus $bus;
  11.     }
  12.     
  13.     public function onPostComplete(ResourceControllerEvent $event)
  14.     {
  15.         dump($event);
  16.         $payment $event->getSubject();
  17.         dump($payment);
  18.         $this->bus->dispatch(new ValidateOrder($payment->getOrder()->getId(), true));
  19.     }
  20. }