thoughtfully/module-recaptcha

There is no license information available for the latest version (0.0.2) of this package.

Google Recaptcha integration for Magento 2

Installs: 150

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:magento2-module

0.0.2 2018-07-02 19:21 UTC

This package is auto-updated.

Last update: 2021-02-23 05:22:00 UTC


README

This module adds Google Recaptcha integration with Magento 2 forms.

Installation

Require module with composer.

composer require thoughtfully/module-recaptcha

Upgrade and recompile Magento

php bin/magento setup:upgrade
php bin/magento setup:di:compile

Configuration

The module configuration can be found by logging into the Magento 2 administration panel and navigating to:

Stores > Settings > Configuration > Thoughtfully > Recaptcha

General

  • Enable
    • Enable or disable Google Recaptcha validation
  • API URL
  • Site Key
    • The site key provided when setting up a Google Recaptcha key pair in the Recaptcha Admin.
  • Secret Key
    • The secret key provided when setting up a Google Recaptcha key pair in the Recaptcha Admin.

Forms to Validate

Validate Another Form

Use the following information to implement Google Recaptcha on your own form:

  • Render the module's recaptcha.captcha block (defined in view/frontend/layout/default.xml) within your <form/>.
<?php echo $block->getLayout()->renderElement('recaptcha.captcha') ?>
  • Validate the captcha within the controller.
    • The abstract class file Plugin/AbstractPlugin.php defines the method validateRecaptcha() to validate the user's captcha input.
    • You can utilize a Plugin (Interceptor) to validate a captcha before a form is submitted to a Magento controller endpoint. Refer to Plugin/Controller/ContactFormPlugin.php for an example.

Issues / Enhancements

Please feel free to request features / report issues / give feedback using the repository's issue board.