flux-se/sylius-hcaptcha-plugin

Plugin adding the hCaptcha field to some frontend FormType of Sylius

Installs: 3 003

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:sylius-plugin

v0.0.3 2024-05-13 23:13 UTC

This package is auto-updated.

Last update: 2024-10-27 15:32:29 UTC


README

Latest Version on Packagist Software License Build Status Quality Score

Sylius Plugin adding hCaptcha integration

This plugin is adding hCaptcha to the following forms :

  • Contact form
  • Registration form

But an abstract class is available to add the captcha field to any other Form\Extension

Installation

composer require flux-se/sylius-hcaptcha-plugin symfony/http-client nyholm/psr7

Configuration

Enable this plugin :

<?php

# config/bundles.php

return [
    // ...
    FluxSE\SyliusHCaptchaPlugin\FluxSESyliusHCaptchaPlugin::class => ['all' => true],
    // ...
];

This plugin is using the meteo-concept/hcaptcha-bundle to handle the validation of the hCaptcha, so a little configuration have to be made. Add or modify the meteo-concept/hcaptcha-bundle configuration :

# 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'

Finally, add your site key and secret to your .env.local file :

###> meteo-concept/hcaptcha-bundle ###
HCAPTCHA_SITE_KEY=10000000-ffff-ffff-ffff-000000000001
HCAPTCHA_SECRET=0x0000000000000000000000000000000000000000
###< meteo-concept/hcaptcha-bundle ###