So maybe just dispatch the "pre" event then, to avoid any confusion
Le 15 janv. 2014 15:58, "Maksim Kotlyar" <notifications@github.com> a écrit
:

> In src/Sylius/Bundle/PayumBundle/Payum/Paypal/Action/NotifyOrderAction.php:
>
> > +    {
> > +        /** @var $request SecuredNotifyRequest */
> > +        if (!$this->supports($request)) {
> > +            throw RequestNotSupportedException::createActionNotSupported($this, $request);
> > +        }
> > +
> > +        /** @var OrderInterface $order */
> > +        $order = $request->getModel();
> > +        $payment = $order->getPayment();
> > +        $previousState = $payment->getState();
> > +
> > +        $this->payment->execute(new SyncRequest($order));
> > +
> > +        $status = new StatusRequest($order);
> > +        $this->payment->execute($status);
> > +        $payment->setState($status->getStatus());
>
> here it mean 'just to be compatible". Pre event means before we actually
> saved anything to db, so you can change state to another one, post event
> means we cannot change anything in payment object.
>
> Since the save will be done later (when we return from this action) we
> cannot do save between pre and post without injecting extra dependency. To
> keep things simple I decided to dispatch events so you can change state in
> post event too.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Sylius/Sylius/pull/725/files#r8888660>
> .
>