Skip to content

Commit

Permalink
Revert "all API checkouts with gateway 'dummy' will be automatically …
Browse files Browse the repository at this point in the history
…completed"

This reverts commit 86c6e77.
  • Loading branch information
Amunak committed Jun 24, 2015
1 parent 86c6e77 commit da5e558
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

use FOS\RestBundle\Controller\FOSRestController;
use Sylius\Component\Core\Model\OrderInterface;
use Sylius\Component\Core\Model\PaymentInterface;
use Sylius\Component\Core\Model\ShipmentInterface;
use Sylius\Component\Core\OrderCheckoutTransitions;
use Sylius\Component\Core\SyliusCheckoutEvents;
use Sylius\Component\Core\SyliusOrderEvents;
Expand Down Expand Up @@ -182,13 +180,6 @@ public function finalizeAction(Request $request, OrderInterface $order)
$stateMachine = $this->get('sm.factory')->get($order, OrderCheckoutTransitions::GRAPH);
$stateMachine->apply(OrderCheckoutTransitions::SYLIUS_FINALIZE);

if ($order->getLastPayment() && $order->getLastPayment()->getMethod()->getGateway() === 'dummy') {
$order->getLastPayment()->setState(PaymentInterface::STATE_COMPLETED);
$order->setPaymentState(PaymentInterface::STATE_COMPLETED);
$order->setShippingState(ShipmentInterface::STATE_SHIPPED);
$order->setState(OrderInterface::STATE_SHIPPED);
}

$manager = $this->get('sylius.manager.order');
$manager->persist($order);
$manager->flush();
Expand Down

0 comments on commit da5e558

Please sign in to comment.