getDto(); $expires = now()->addSeconds(config('captcha.waiting_for_captcha_verification_in_seconds')); $result = $this->captchaService->createKeyWithCaptcha($captchaPublicToken, $expires); if (!$result->isSuccess()) { return response()->json($result->getData())->setStatusCode($result->getCode()); } return response()->json(new Captcha($result)); } public function checking(CheckingRequest $request): JsonResponse { $maxCountError = config('captcha.validate_max_count_errors'); $params = $request->getDto(); $result = $this->captchaService->checking($params, $maxCountError); if (!$result->isSuccess()) { return response()->json($result->getData())->setStatusCode($result->getCode()); } return response()->json(new CaptchaVerified($result)); } public function verificationInformation(string $captchaUuid, VerificationInformationRequest $request): JsonResponse { $params = $request->getDto(); $expiresMinutes = config('captcha.verification_data_view_limit_in_minutes'); $maxInfoDisplayCount = config('captcha.max_info_display_count'); $result = $this->captchaService->verificationInformation($captchaUuid, $params, $expiresMinutes, $maxInfoDisplayCount); if (!$result->isSuccess()) { return response()->json($result->getData())->setStatusCode($result->getCode()); } return response()->json(new CaptchaVerificationInformation($result)); } }