1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| public function detailsAction($id)
{
$order = $this->get('order_manager')->load($id);
$form = $this->get('form.factory')->create('credit_card');
if ('POST' === $this->getRequest()->getMethod()) {
$form->handleRequest($this->getRequest());
if ($form->isValid()) {
$this->ppc->createPaymentInstruction($instruction = $form->getData());
$order->setPaymentInstruction($instruction);
$this->em->persist($order);
$this->em->flush($order);
return new RedirectResponse($this->router->generate('payment_complete', array(
'id' => $order->getId(),
)));
}
}
return $this->render('XXXBundle:payment:details.html.twig', array(
'form' => $form->createView(),
'order' => $order
));
} |
Partager