Page 1 of 1

Simple Integration For Google Recaptcha V3 in Opencard 3.0.2.0

Posted: Fri Jan 01, 2021 5:05 am
by lostwake
Im not sure if this is the right place to post this but I ran into this problem for a client. Needed to integrate Recaptcha V3 and didnt want to buy an extension. So to get around this:

In theme editor edit: extension/captcha/google

Replace existing code with this:

Code: Select all

<script src="//www.google.com/recaptcha/api.js?render={{ site_key }}" type="text/javascript"></script>
<script>
  function onClick(e) {
        e.preventDefault();
        grecaptcha.ready(function(){
        grecaptcha.execute('{{ site_key }}', { action: 'submit'}).then(function(token) {
        var recaptchaResponse = document.getElementById('recaptchaResponse');
        recaptchaResponse.value = token;
        })
        });
  	}
</script>
<input type="hidden" name="g-recaptcha-response" value="" id="recaptchaResponse">
<div class="text-danger">{{ error_captcha }}</div>
Then replace your Keys with the V3 keys.

Re: Simple Integration For Google Recaptcha V3 in Opencard 3.0.2.0

Posted: Sat Jan 02, 2021 12:40 am
by straightlight
Visible site keys on the view source.

Re: Simple Integration For Google Recaptcha V3 in Opencard 3.0.2.0

Posted: Wed Jan 13, 2021 10:43 am
by lostwake
Its a public key its supposed to be viable.