Skip to content

Commit c38120d

Browse files
added hcaptcha enterprise extra parameters
1 parent 9746055 commit c38120d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Diff for: hcaptcha.php

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ function test_api() {
1616
$params['page_url'] = 'https://your-site.com';
1717
$params['sitekey'] = '1c7062c7-cae6-4e12-96fb-303fbec7fe4f';
1818
//$params['invisible'] = '1'; // if captcha is invisible - optional
19+
20+
// extra parameters, useful for enterprise
21+
// submit userAgent from requests too, when this is used
22+
# $params['HcaptchaEnterprise'] = array(
23+
# "rqdata" => "take value from web requests"
24+
# );
25+
1926
//$params['proxy'] = '126.45.34.53:123'; // - optional
2027
//$params['user_agent'] = 'Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'; // - optional
2128
$captcha_id = $i->submit_hcaptcha($params);

Diff for: lib/imagetyperzapi.php

+4
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ function submit_hcaptcha($d) {
335335
if (isset($d['invisible'])) {
336336
$data["invisible"] = '1';
337337
}
338+
// check for enterprise
339+
if (isset($d['HcaptchaEnterprise'])) {
340+
$data["HcaptchaEnterprise"] = json_encode($d['HcaptchaEnterprise']);
341+
}
338342
// check for user agent
339343
if (isset($d['user_agent'])) $data["useragent"] = $d['user_agent'];
340344
$response = Utils::post(HCAPTCHA_ENDPOINT, $data, USER_AGENT, $this->_timeout);

0 commit comments

Comments
 (0)