src/Controller/PaymentController.php line 19
<?phpnamespace App\Controller;use App\Entity\Setting;use Doctrine\Persistence\ManagerRegistry;use Symfony\Component\HttpFoundation\Request;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Routing\Annotation\Route;use Symfony\Component\Security\Http\Attribute\IsGranted;class PaymentController extends AbstractController{public function __construct(private readonly ManagerRegistry $doctrine) {}#[IsGranted('ROLE_USER')]#[Route('/payment', name: 'app_payment')]public function index(): Response{$user = $this->getUser();$userOrds = $user->getUserOrd();return $this->render('payment/index.html.twig', ['balance' => $user->getBalance(),'paymentEmail' => $user->getEmail(),'paymentUserId' => $user->getId(),'cloudpayments_public' => $this->doctrine->getRepository(Setting::class)->get('cloudpayments_public') ?? '','email' => $user->getEmail(),'userOrds' => $userOrds,]);}#[Route('/payment/link', name: 'app_payment_by_link')]public function paymentByLinkAction(Request $request): Response{$paymentEmail = $request->query->get('paymentEmail');$paymentUserId = $request->query->get('paymentUserId');$amount = $request->query->get('amount');if (!($paymentEmail && $paymentUserId && $amount)) {return $this->redirectToRoute('app_landing');}return $this->render('payment/link.html.twig', ['paymentEmail' => $paymentEmail,'paymentUserId' => $paymentUserId,'cloudpayments_public' => $this->doctrine->getRepository(Setting::class)->get('cloudpayments_public') ?? '','amount' => $amount]);}}