Bitrix API

ReCaptcha

reCAPTCHA client.

Table of Contents

Constants

MODULE_ID  = 'crm'
OPTION_NAME  = 'crm_recaptcha'
VERSION  = 'php_1.1.2'
Version of this client library.

Methods

__construct()  : mixed
Create a configured instance to use the reCAPTCHA service.
getDefaultKey()  : string
Get default key.
getDefaultSecret()  : string
Get default secret.
getError()  : string
Return error code.
getJavascriptResource()  : string
Get default key.
getKey()  : string
Get key.
getSecret()  : string
Get secret.
setKey()  : void
Set key & secret.
verify()  : bool
Calls the reCAPTCHA siteverify API to verify whether the user passes CAPTCHA test.

Constants

OPTION_NAME

public mixed OPTION_NAME = 'crm_recaptcha'

VERSION

Version of this client library.

public mixed VERSION = 'php_1.1.2'
Tags
const

string

Methods

__construct()

Create a configured instance to use the reCAPTCHA service.

public __construct(string $secret[, HttpClient $httpClient = null ]) : mixed
Parameters
$secret : string

shared secret between site and reCAPTCHA server.

$httpClient : HttpClient = null

method used to send the request. Defaults to POST.

Tags
throws
SystemException

if $secret is invalid

getDefaultKey()

Get default key.

public static getDefaultKey([string $version = '' ]) : string
Parameters
$version : string = ''

Version.

Return values
string

getDefaultSecret()

Get default secret.

public static getDefaultSecret([string $version = '' ]) : string
Parameters
$version : string = ''

Version.

Return values
string

getError()

Return error code.

public getError() : string
Return values
string

getJavascriptResource()

Get default key.

public static getJavascriptResource([mixed $lang = LANGUAGE_ID ]) : string
Parameters
$lang : mixed = LANGUAGE_ID
Return values
string

getKey()

Get key.

public static getKey([string $version = '' ]) : string
Parameters
$version : string = ''

Version.

Return values
string

getSecret()

Get secret.

public static getSecret([string $version = '' ]) : string
Parameters
$version : string = ''

Version.

Return values
string

setKey()

Set key & secret.

public static setKey(string $key, string $secret[, string $version = '' ]) : void
Parameters
$key : string

Key.

$secret : string

Secret.

$version : string = ''

Version.

verify()

Calls the reCAPTCHA siteverify API to verify whether the user passes CAPTCHA test.

public verify(string $response[, string $remoteIp = null ]) : bool
Parameters
$response : string

The value of 'g-recaptcha-response' in the submitted form.

$remoteIp : string = null

The end user's IP address.

Return values
bool

Verifying result.


        
On this page

Search results