1. Go to this page and download the library: Download mangati/sicoob-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mangati / sicoob-sdk example snippets
use Mangati\Sicoob\SicoobClient;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpClient\HttpOptions;;
$localCert = "path/to/cert.pem";
$localPk = "path/to/cert.key";
$options = new HttpOptions();
$options
->setLocalCert($localCert)
->setLocalPk($localPk);
$client = HttpClient::create(
defaultOptions: $options->toArray(),
);
// pix
$sicoob = new SicoobPixClient($client);
// boleto
$sicoob = new SicoobCobrancaBancariaClient($client);
// conta corrente
$sicoob = new SicoobContaCorrenteClient($client);
use Mangati\Sicoob\SicoobCobrancaBancariaClient;
use Mangati\Sicoob\Dto\AuthenticationToken;
/** @var AuthenticationToken */
$token = SicoobCobrancaBancariaClient::sandboxToken();
// then
$sicoob = new SicoobCobrancaBancariaClient($client, isSandbox: true);
use Mangati\Sicoob\Dto\CobrancaBancaria\IncluirBoletosRequest;
use Mangati\Sicoob\Model\CobrancaBancaria\Boleto;
$boleto = new Boleto();
$response = $sicoob->incluirBoletos($authToken, new IncluirBoletosRequest(
boletos: [ $boleto ],
));
$resultado = $response->resultado[0];
if ($resultado->status->codigo !== 200) {
throw new \Exception($resultado->status->mensagem);
}
$base64Data = $resultado->boleto->pdfBoleto;
$nossoNumero = $resultado->boleto->nossoNumero;
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.