Loading src/Entity/OrderHooks.php +13 −2 Original line number Diff line number Diff line Loading @@ -65,9 +65,20 @@ class OrderHooks { if ($is_positive) { $this->applyTransitionIfAllowed($order->getState(), 'payment_undone'); } // Otherwise, use the paid_in_full transition. // Otherwise, transition to the paid_in_full state. else { $this->applyTransitionIfAllowed($order->getState(), 'paid_in_full'); // If we are confirming the booking and paying in full in the same // transition we need to reset the order state back to the original // state (likely 'draft') before applying the transition. $order->set('state', $original->getState()->getId()); $state_item = $order->getState(); // Transition might be paid_in_full or confirmed_paid_in_full. $transition = $state_item->getWorkflow()->findTransition($state_item->getId(), 'paid_in_full'); if ($transition) { $state_item->applyTransition($transition); } } } } Loading Loading
src/Entity/OrderHooks.php +13 −2 Original line number Diff line number Diff line Loading @@ -65,9 +65,20 @@ class OrderHooks { if ($is_positive) { $this->applyTransitionIfAllowed($order->getState(), 'payment_undone'); } // Otherwise, use the paid_in_full transition. // Otherwise, transition to the paid_in_full state. else { $this->applyTransitionIfAllowed($order->getState(), 'paid_in_full'); // If we are confirming the booking and paying in full in the same // transition we need to reset the order state back to the original // state (likely 'draft') before applying the transition. $order->set('state', $original->getState()->getId()); $state_item = $order->getState(); // Transition might be paid_in_full or confirmed_paid_in_full. $transition = $state_item->getWorkflow()->findTransition($state_item->getId(), 'paid_in_full'); if ($transition) { $state_item->applyTransition($transition); } } } } Loading