EcommerceBundle/Controller/TransactionController.php
public function authorizePaymentAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Transaction $entity */
        $entity = $em->getRepository('EcommerceBundle:Transaction')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Transaction entity.');
        }

        $entity->setStatus(Transaction::STATUS_PAID);

        $em->persist($entity);
        $em->flush();

        //send email
        $this->get('core.mailer')->sendBankTransferConfirmation($entity);
        $this->get('checkout_manager')->sendToTransport($entity);

        $this->get('session')->getFlashBag()->add('success', 'order.authorized.payment');

        return $this->redirect($this->generateUrl('ecommerce_transaction_show', array('id' => $entity->getId())));
    }
public function authorizePaymentAction($id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Transaction $entity */
        $entity = $em->getRepository('EcommerceBundle:Transaction')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Transaction entity.');
        }

        $entity->setStatus(Transaction::STATUS_PAID);

        $em->persist($entity);
        $em->flush();

        //send email
        $this->get('core.mailer')->sendBankTransferConfirmation($entity);
        $this->get('checkout_manager')->sendToTransport($entity);

        $this->get('session')->getFlashBag()->add('success', 'order.authorized.payment');

        return $this->redirect($this->generateUrl('ecommerce_transaction_show', array('id' => $entity->getId())));
    }
public function authorizePaymentAction ( $ id ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; /** @var Transaction $entity */ $ entity = $ em -> getRepository ( 'EcommerceBundle:Transaction' ) -> find ( $ id ) ; if ( ! $ entity ) { throw $ this -> createNotFoundException ( 'Unable to find Transaction entity.' ) ; } $ entity -> setStatus ( Transaction :: STATUS_PAID ) ; $ em -> persist ( $ entity ) ; $ em -> flush ( ) ; //send email $ this -> get ( 'core.mailer' ) -> sendBankTransferConfirmation ( $ entity ) ; $ this -> get ( 'checkout_manager' ) -> sendToTransport ( $ entity ) ; $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'success' , 'order.authorized.payment' ) ; return $ this -> redirect ( $ this -> generateUrl ( 'ecommerce_transaction_show' , array ( 'id' => $ entity -> getId ( ) ) ) ) ; }
Authorizes the payment of a pending transfer order

@param int $id

@throws NotFoundHttpException
@return RedirectResponse

@Route("/{id}/authorize-payment")
@Method("GET")
Authorizes the payment of a pending transfer order