NAME

WebService::BR::BoletoFacil - Perl low level implementation of the https://boletobancario.com.br/boletofacil brazilian payment gateway.

SYNOPSIS

use WebService::BR::BoletoFacil;

my $gateway = new WebService::BR::BoletoFacil( api_key => 'YOUR SECRET KEY' );

# Or, if you want to use the sandbox:
my $gateway = new WebService::BR::BoletoFacil( api_key => 'YOUR SECRET KEY', target => 'sandbox' );

# Create a new bankslip and the the PDF download URL of the document.
my $response = $gateway->post(
 'issue-charge',
 { description => 'My Sale...',
   amount      => 120.90,
   payerName   => 'Someone' }
);

# Error
if ( !$response || $response->{ErrorStatus} ) {

 print $response->{ErrorStatus} || 'UNKNOWN ERROR';  

# OK
} else {

 print $response->{data}->{charges}->[0]->{link};

}


# Check if a previously created bankslip was is paid or not.
my $boletos = $gateway->get( 'list-charges', { beginPaymentDate => '12/12/2012' } );

for my $charge ( @{ $boletos->{data}->{charges} } ) {
 print $charge->{code}."\n";
}

DESCRIPTION

This is a straight brindge to the boletobancario.com.br payment gateway API.

SEE ALSO

Please check BoletoFacil's full API docs at https://www.boletobancario.com/boletofacil/integration/integration.html (you will need an API key to access this page).

AUTHOR

Diego de Lima, <diego_de_lima@hotmail.com>

SPECIAL THANKS

This module was kindly made available by the https://modeloinicial.com.br/ team.

COPYRIGHT AND LICENSE

Copyright (C) 2017 by Diego de Lima

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.