CaptchaHandler
in package
Tags
Table of Contents
- RECAPTCHA_RESPONSE_PARAM = 'g-recaptcha-response'
- RECAPTCHA_V3_THRESHOLD = 0.5
- SITE_VERIFY_URL = 'https://www.google.com/recaptcha/api/siteverify'
- $_captchaResponse : string
- $_errorCodes : array<string|int, mixed>
- $_secret : string
- __construct() : mixed
- checkCaptcha() : bool
- getErrorCodes() : array<string|int, mixed>
- getResult() : bool
- buildFullUrl() : string
Constants
RECAPTCHA_RESPONSE_PARAM
public
mixed
RECAPTCHA_RESPONSE_PARAM
= 'g-recaptcha-response'
RECAPTCHA_V3_THRESHOLD
public
mixed
RECAPTCHA_V3_THRESHOLD
= 0.5
SITE_VERIFY_URL
public
mixed
SITE_VERIFY_URL
= 'https://www.google.com/recaptcha/api/siteverify'
Properties
$_captchaResponse
private
string
$_captchaResponse
= ''
$_errorCodes
private
array<string|int, mixed>
$_errorCodes
= []
$_secret
private
string
$_secret
= ''
Methods
__construct()
public
__construct(string $captchaResponse, string $secret) : mixed
Parameters
- $captchaResponse : string
- $secret : string
Return values
mixed —checkCaptcha()
public
checkCaptcha() : bool
Return values
bool —getErrorCodes()
public
getErrorCodes() : array<string|int, mixed>
Return values
array<string|int, mixed> —getResult()
public
getResult(string $response) : bool
Parameters
- $response : string
Return values
bool —buildFullUrl()
private
buildFullUrl() : string