package Captcha::reCAPTCHA::V2;
use strict;
use warnings;
use Carp;
use HTTP::Tiny;
use JSON;
# ABSTRACT: A Perl implementation of reCAPTCHA API version 2
our $VERSION = '0.3'; # VERSION
sub new
ptcha_script {
my ($self, $sitekey, $options) = @_;
my $json_options = to_json({ sitekey => $sitekey, %$options }, $self->{json_options} || {});
return '<script type="text/javascript">va
r onloadCallback = function(){grecaptcha.render(\''
. _element_id($sitekey) . '\',' . $json_options . ');};</script>';
}
sub html {
my ($self, $sitekey, $options) = @_;
$options ||=