Requirement::UUID_V6], methods: ['POST'], )] public function __invoke(Request $request, string $id, #[CurrentUser] User $user): Response { $groupOffer = $this->getGroupOffer($id); /** @var ?string $token */ $token = $request->request->get('token'); if (!$this->isCsrfTokenValid('payment_prepare', $token)) { throw new UnprocessableEntityHttpException('Invalid CSRF token'); } // create and save the payment main reference $payment = $this->payumManager->getPayment($groupOffer, $user); // create the capture token and redirect to the capture action $captureToken = $this->payumManager->getCaptureToken($payment, DoneAction::ROUTE_NAME, [ 'id' => $id, ]); return $this->redirect($captureToken->getTargetUrl()); } }