Skip to content

Instantly share code, notes, and snippets.

@gustavoreis
Created April 19, 2018 17:40
Show Gist options
  • Save gustavoreis/e3de7cba7b8e73855d41524cbf391085 to your computer and use it in GitHub Desktop.
Save gustavoreis/e3de7cba7b8e73855d41524cbf391085 to your computer and use it in GitHub Desktop.
Invisible reCAPTCHA
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script>
var element = document.getElementById("payment_card_confirm");
element.classList.add("g-recaptcha");
element.dataset.sitekey = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
element.dataset.callback = "onSubmitCaptcha";
function onSubmitCaptcha(token) {
document.getElementById("payment_form").submit();
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment