container->get('net15.payment.mode.manager')->getByPublicKey($publicKey); // We recover the transaction publicKey of the session and we inject the paymentMode $transaction = $this->container->get('net15.transaction.manager')->getByPublicKey($request->getSession()->get('transactionPK')); $transaction = $this->container->get('net15.transaction.manager')->addPaymentMode($transaction,$paymentMode); return $this->render('@Payment/Default/payment.details.html.twig',[ 'transaction'=>$transaction, 'paymentMode'=>$paymentMode, 'rout'=>'api_systempay_tunnel' ]); } public function tunnelAction(Request $request){ $transaction = $this->get('net15.transaction.manager')->getByPublicKey($request->getSession()->get('transactionPK')); $args = $this->container->get('net15.payment.systempay.manager')->init($transaction); return $this->render('@Payment/SystemPay/systempay.payment.form.html.twig', ['args'=>$args]); } /** * @param string $publicKey * @param Request $request * @return Response */ public function ipnAction(string $publicKey, Request $request){ $transaction = $this->container->get('net15.transaction.manager')->getByPublicKey($publicKey); $authResult = $request->get('vads_auth_result'); $amount = $request->get('vads_amount'); if ($amount > 0) $amount /= 100; $transactionId = $request->get('vads_trans_id'); $status = false; if ($authResult == '00'){ $authResult = 'Transaction approuvée ou traitée avec succès'; $status = true; } $this->container->get('net15.payment.systempay.manager')->ipn($transaction, $transactionId, $authResult, $amount,$status); return new Response(''); } public function successAction(){ return $this->render('@Payment/Default/payment.success.response.html.twig'); } public function cancelAction(){ return $this->render('@Payment/Default/payment.cancel.response.html.twig'); } }