container->get('net15.payment.mode.manager')->getByPublicKey($publicKey); // We recover the transaction publicKey from the session $transaction = $this->get('net15.transaction.manager')->getByPublicKey($request->getSession()->get('transactionPK')); $transaction = $this->get('net15.transaction.manager')->addPaymentMode($transaction,$paymentMode); return $this->render('@Payment/Default/payment.details.html.twig',[ 'transaction'=>$transaction, 'paymentMode'=>$paymentMode, 'rout'=>'api_paypal_tunnel' ]); } public function tunnelAction(Request $request){ $transaction = $this->get('net15.transaction.manager')->getByPublicKey($request->getSession()->get('transactionPK')); $payPalInit = $this->get('net15.payment.paypal.manager')->inti($transaction); return new RedirectResponse($payPalInit); } public function paymentConfirmationAction(string $publicKey, Request $request){ $transaction = $this->get('net15.transaction.manager')->getByPublicKey($publicKey); $paymentParameters = $request->query->all(); $confirmationPayment = $this->get('net15.payment.paypal.manager')->confirmationPayment($transaction, $paymentParameters); return new RedirectResponse($confirmationPayment); } /** * @return Response */ public function SuccessAction(){ return $this->render('@Payment/Default/payment.success.response.html.twig'); } /** * @return Response */ public function cancelAction(){ return $this->render('@Payment/Default/payment.cancel.response.html.twig'); } }