Elcodi\Admin\CartBundle\Controller\OrderController::changePaymentStateAction PHP Method

changePaymentStateAction() public method

Change payment state
public changePaymentStateAction ( Request $request, Elcodi\Component\Cart\Entity\Interfaces\OrderInterface $order, string $transition ) : RedirectResponse
$request Symfony\Component\HttpFoundation\Request Request
$order Elcodi\Component\Cart\Entity\Interfaces\OrderInterface Order
$transition string Verb to apply
return Symfony\Component\HttpFoundation\RedirectResponse Back to referrer
    public function changePaymentStateAction(Request $request, OrderInterface $order, $transition)
    {
        $stateLineStack = $this->get('elcodi.order_payment_states_machine_manager')->transition($order, $order->getPaymentStateLineStack(), $transition, '');
        $order->setPaymentStateLineStack($stateLineStack);
        $this->flush($order);
        return $this->redirect($request->headers->get('referer'));
    }