Business-CPI-Gateway-MercadoPago

 view release on metacpan or  search on metacpan

lib/Business/CPI/Gateway/MercadoPago.pm  view on Meta::CPAN

}

sub get_checkout_code {
    my ( $self, $info ) = @_;

    my $ua  = $self->user_agent;
    my $url = $self->_build_uri(
        '/checkout/preferences?access_token=' . $self->access_token );
    my $json = $self->_make_json($info);

    my $req = HTTP::Request->new( 'POST', $url );
    $req->content_type('application/json');
    $req->content($json);
    my $res = $ua->request($req);

    die $res->status_line unless $res->is_success;

    my $content = $res->content;
    $json = from_json($content);

    my $init_point = $json->{'init_point'};



( run in 0.333 second using v1.01-cache-2.11-cpan-de7293f3b23 )