letraceursnork/sdkaptcha
最新稳定版本:v1.1.1
Composer 安装命令:
composer require letraceursnork/sdkaptcha
包简介
Unofficial SDK bundle for different external CAPTCHA providers
README 文档
README
Unofficial SDK for different Captcha external providers
Installation
composer require letraceursnork/sdkaptcha
Usage example
As described in this proposed CaptchaInterface, all of provided Captcha verifiers share common interface and their basic simple usage is:
// first we get User's token `token` from, say, front-end $token = 'User token from front-end'; $secret_recaptcha_key = 'recaptcha-secret-token'; $recaptcha = new \LeTraceurSnork\SDKaptcha\ReCaptcha\ReCaptcha($secret_recaptcha_key); $recaptcha_response = $recaptcha->verify($token); if ($recaptcha_response->isSuccess()) { // ... ReCaptcha successfully passed } $secret_hcaptcha_key = 'hcaptcha-secret-token'; $hcaptcha = new \LeTraceurSnork\SDKaptcha\HCaptcha\HCaptcha($secret_hcaptcha_key); $hcaptcha_response = $hcaptcha->verify($token); if ($hcaptcha_response->isSuccess()) { // ... hCaptcha successfully passed } $secret_smartcaptcha_key = 'smart-captcha-secret-token'; $smart_captcha = new \LeTraceurSnork\SDKaptcha\SmartCaptcha\SmartCaptcha($secret_smartcaptcha_key); $smartcaptcha_response = $smart_captcha->verify($token); if ($smartcaptcha_response->isSuccess()) { // ... Smart Captcha successfully passed } // ... you got the idea // Please see basic interface for details // ... or see specific Captcha verifier for specific details, especially their inner fields, like getScore() for ReCaptcha
统计信息
- 总下载量: 834
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-11