public function confirmationAction()
{
try {
$order = $this->getPaymentHandler()->handleConfirmation($this->getRequest());
} catch (EntityNotFoundException $ex) {
throw new NotFoundHttpException($ex->getMessage());
} catch (InvalidTransactionException $ex) {
throw new UnauthorizedHttpException($ex->getMessage());
}
if (!($order->isValidated() || $order->isPending())) {
return $this->render('SonataPaymentBundle:Payment:error.html.twig', array('order' => $order));
}
return $this->render('SonataPaymentBundle:Payment:confirmation.html.twig', array('order' => $order));
}