public function getPaymentCallbackResponse(Request $request)
{
// retrieve the transaction
$transaction = $this->createTransaction($request);
$order = $this->getValidOrder($transaction);
$event = new PaymentEvent($order, $transaction);
$this->getEventDispatcher()->dispatch(PaymentEvents::PRE_CALLBACK, $event);
// start the payment callback
$response = $this->getPayment($transaction->getPaymentCode())->callback($transaction);
$this->transactionManager->save($transaction);
$this->orderManager->save($order);
$event = new PaymentEvent($order, $transaction, $response);
$this->getEventDispatcher()->dispatch(PaymentEvents::POST_CALLBACK, $event);
$this->notificationBackend->createAndPublish('sonata_payment_order_process', array('order_id' => $order->getId(), 'transaction_id' => $transaction->getId()));
return $response;
}