container->get('net15.payment.mode.manager')->getByPublicKey($publicKey); return $this->render('@Payment/manual_payment/manual.payment.html.twig', ['manualPayment'=>$manualPaymentMode]); } public function chequeAction(){ // $transaction = $this->get('net15.transaction.manager')->getByPublicKey($request->getSession()->get('transactionPK')); // if (!empty($transaction->getPaymentMode()->getUrlPayment())) // return $this->redirectToRoute($transaction->getPaymentMode()->getUrlPayment()); // // // return $this->redirectToRoute('api_default_tunnel',['publicKey'=>$transaction->getPaymentMode()->getPublicKey()]); $manualPaymentMode = $this->container->get('net15.payment.mode.manager')->getPaymentByName('cheque'); if (!empty($manualPaymentMode->getUrlPayment())) return $this->redirectToRoute($manualPaymentMode->getUrlPayment(), ['publicKey'=>$manualPaymentMode->getPublicKey()]); return $this->redirectToRoute('api_confirmation_manual_payment',['publicKey'=>$manualPaymentMode->getPublicKey()]); } public function virement_bancaireAction(){ $manualPaymentMode = $this->container->get('net15.payment.mode.manager')->getPaymentByName('virement_bancaire'); if (!empty($manualPaymentMode->getUrlPayment())) return $this->redirectToRoute($manualPaymentMode->getUrlPayment(), ['publicKey'=>$manualPaymentMode->getPublicKey()]); return $this->redirectToRoute('api_confirmation_manual_payment',['publicKey'=>$manualPaymentMode->getPublicKey()]); } public function cheque_ANCVAction(){ $manualPaymentMode = $this->container->get('net15.payment.mode.manager')->getPaymentByName('cheque_ANCV'); if (!empty($manualPaymentMode->getUrlPayment())) return $this->redirectToRoute($manualPaymentMode->getUrlPayment(), ['publicKey'=>$manualPaymentMode->getPublicKey()]); return $this->redirectToRoute('api_confirmation_manual_payment',['publicKey'=>$manualPaymentMode->getPublicKey()]); } public function LCRAction(){ $manualPaymentMode = $this->container->get('net15.payment.mode.manager')->getPaymentByName('LCR'); if (!empty($manualPaymentMode->getUrlPayment())) return $this->redirectToRoute($manualPaymentMode->getUrlPayment(), ['publicKey'=>$manualPaymentMode->getPublicKey()]); return $this->redirectToRoute('api_confirmation_manual_payment',['publicKey'=>$manualPaymentMode->getPublicKey()]); } public function contre_remboursementAction(){ $manualPaymentMode = $this->container->get('net15.payment.mode.manager')->getPaymentByName('contre_remboursement'); if (!empty($manualPaymentMode->getUrlPayment())) return $this->redirectToRoute($manualPaymentMode->getUrlPayment(), ['publicKey'=>$manualPaymentMode->getPublicKey()]); return $this->redirectToRoute('api_confirmation_manual_payment',['publicKey'=>$manualPaymentMode->getPublicKey()]); } /** * @param string $publicKey * @param Request $request * @return RedirectResponse */ public function confirmationAction(string $publicKey, Request $request){ $transaction = $this->get('net15.transaction.manager')->getByPublicKey($request->getSession()->get('transactionPK')); $paymentMode = $this->container->get('net15.payment.mode.manager')->getByPublicKey($publicKey); // Update Transaction status $transactionUpdated = $this->container->get('net15.transaction.manager')->confirmationTransaction($transaction, $paymentMode); $modeName = explode("_", $paymentMode->getName()); // Update Transaction in session $request->getSession()->set('transaction', $transactionUpdated); return $this->redirectToRoute($paymentMode->getUrlReturnSuccess()); } public function testAction(){ return new Response('Mode depayment ok'); } }