ReCaptchaV2Connection
in package
implements
ConnectionTypeInterface
FinalYes
Google reCAPTCHA v2 Invisible — the widget the front forms render today.
Table of Contents
Interfaces
- ConnectionTypeInterface
- A kind of external connection the system knows how to use (reCAPTCHA, maps…).
Constants
- CODE : string = 'recaptcha_v2'
- FIELD_SECRET_KEY : string = 'secretKey'
- FIELD_SITE_KEY : string = 'siteKey'
- GROUP : string = 'captcha'
Methods
- check() : ConnectionCheck|null
- Verifies the given values against the third party. Null = this type cannot be verified remotely.
- getCode() : string
- Stable identifier stored in `cms_system_external_connections.type`.
- getFields() : array<int, ConnectionField>
- getGroup() : string
- Connections of the same group are alternatives (e.g. `captcha`: reCAPTCHA v2 or v3) — only one of them should be enabled. Null = independent connection.
- supportsCheck() : bool
- Not verifiable from the server alone: since 2025 Google's `siteverify` answers `invalid-input-response` for a wrong secret as well as for a valid one with a dummy token, so only a real token from a browser can prove the pair.
Constants
CODE
public
string
CODE
= 'recaptcha_v2'
FIELD_SECRET_KEY
public
string
FIELD_SECRET_KEY
= 'secretKey'
FIELD_SITE_KEY
public
string
FIELD_SITE_KEY
= 'siteKey'
GROUP
public
string
GROUP
= 'captcha'
Methods
check()
Verifies the given values against the third party. Null = this type cannot be verified remotely.
public
check(array<string|int, mixed> $values) : ConnectionCheck|null
Parameters
- $values : array<string|int, mixed>
Return values
ConnectionCheck|nullgetCode()
Stable identifier stored in `cms_system_external_connections.type`.
public
getCode() : string
Return values
stringgetFields()
public
getFields() : array<int, ConnectionField>
Return values
array<int, ConnectionField>getGroup()
Connections of the same group are alternatives (e.g. `captcha`: reCAPTCHA v2 or v3) — only one of them should be enabled. Null = independent connection.
public
getGroup() : string
Return values
stringsupportsCheck()
Not verifiable from the server alone: since 2025 Google's `siteverify` answers `invalid-input-response` for a wrong secret as well as for a valid one with a dummy token, so only a real token from a browser can prove the pair.
public
supportsCheck() : bool