| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
|
| 6 |
/** |
| 7 |
* @since x.x |
| 8 |
*/ |
| 9 |
class FrmFieldCaptchaSettings { |
| 10 |
|
| 11 |
public $secret; |
| 12 |
|
| 13 |
public $token_field; |
| 14 |
|
| 15 |
public $end_point; |
| 16 |
|
| 17 |
public function __construct( $frm_settings ) { |
| 18 |
if ( $frm_settings->active_captcha === 'recaptcha' ) { |
| 19 |
$this->secret = $frm_settings->privkey; |
| 20 |
$this->token_field = 'g-recaptcha-response'; |
| 21 |
$this->endpoint = 'https://www.google.com/recaptcha/api/siteverify'; |
| 22 |
} else { |
| 23 |
$this->secret = $frm_settings->hcaptcha_privkey; |
| 24 |
$this->token_field = 'h-captcha-response'; |
| 25 |
$this->endpoint = 'https://hcaptcha.com/siteverify'; |
| 26 |
} |
| 27 |
} |
| 28 |
} |
| 29 |
|