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())));
    }