<?php
namespace App\EventListener;
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
use Symfony\Component\Messenger\MessageBusInterface;
use App\Message\ValidateOrder;
class PaymentResourceGenerixAddOrUpdateListener {
private $bus;
public function __construct(MessageBusInterface $bus)
{
$this->bus = $bus;
}
public function onPostComplete(ResourceControllerEvent $event)
{
dump($event);
$payment = $event->getSubject();
dump($payment);
$this->bus->dispatch(new ValidateOrder($payment->getOrder()->getId(), true));
}
}