flux-se / sylius-hcaptcha-plugin
插件,为Sylius的一些前端FormType添加hCaptcha字段
v0.0.3
2024-05-13 23:13 UTC
Requires
- meteo-concept/hcaptcha-bundle: >=2
- sylius/sylius: ^1.4
Requires (Dev)
- ext-json: *
- behat/behat: ^3.7
- behat/mink: ^1.9
- dbrekelmans/bdi: ^1.0
- friends-of-behat/mink: ^1.9
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- nyholm/psr7: ^1.4
- phpspec/phpspec: ^7.0
- phpstan/extension-installer: ^1.2
- phpstan/phpstan-doctrine: ^1
- phpstan/phpstan-strict-rules: ^1
- phpstan/phpstan-webmozart-assert: ^1
- phpunit/phpunit: ^9.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- robertfausk/behat-panther-extension: ^1.1
- sylius-labs/coding-standard: ^4.0
- symfony/browser-kit: ^5.4|^6.0
- symfony/debug-bundle: ^5.4|^6.0
- symfony/dotenv: ^5.4|^6.0
- symfony/http-client: ^5.4|^6.0
- symfony/intl: ^5.4|^6.0
- symfony/runtime: ^5.4|^6.0
- symfony/web-profiler-bundle: ^5.4|^6.0
- symfony/webpack-encore-bundle: ^1.16
- vimeo/psalm: ^4|^5
Suggests
- nyholm/psr7: A library that implements PSR-7 HTTP client interface
- symfony/http-client: A Symfony component that implements PSR-18 HTTP client interface
This package is auto-updated.
Last update: 2024-08-27 15:02:55 UTC
README
Sylius插件,添加hCaptcha集成功能
此插件将hCaptcha添加到以下表单
- 联系表单
- 注册表单
但提供了一个抽象类,可以将验证码字段添加到任何其他 Form\Extension
安装
composer require flux-se/sylius-hcaptcha-plugin symfony/http-client nyholm/psr7
配置
启用此插件
<?php # config/bundles.php return [ // ... FluxSE\SyliusHCaptchaPlugin\FluxSESyliusHCaptchaPlugin::class => ['all' => true], // ... ];
此插件使用 meteo-concept/hcaptcha-bundle
来处理hCaptcha的验证,因此需要进行一些配置。添加或修改 meteo-concept/hcaptcha-bundle
的配置
# config/packages/meteo_concept_hcaptcha.yaml meteo_concept_h_captcha: hcaptcha: site_key: '%env(resolve:HCAPTCHA_SITE_KEY)%' secret: '%env(resolve:HCAPTCHA_SECRET)%' validation: 'strict'
最后,将您的站点密钥和密钥添加到您的 .env.local
文件
###> meteo-concept/hcaptcha-bundle ### HCAPTCHA_SITE_KEY=10000000-ffff-ffff-ffff-000000000001 HCAPTCHA_SECRET=0x0000000000000000000000000000000000000000 ###< meteo-concept/hcaptcha-bundle ###