PHP code example of matfatjoe / sicredi-api

1. Go to this page and download the library: Download matfatjoe/sicredi-api 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/ */

    

matfatjoe / sicredi-api example snippets


$client = new \SicrediAPI\Client(
    $_ENV['SICREDI_API_KEY'],
    $_ENV['SICREDI_COOPERATIVE'],
    $_ENV['SICREDI_POST'],
    $_ENV['SICREDI_BENEFICIARY'],
    new \GuzzleHttp\Client(), true);

$client->authenticate($_ENV['SICREDI_USERNAME'], $_ENV['SICREDI_PASSWORD']);

$boletoClient = $client->boleto();

$boleto = new \SicrediAPI\Domain\Boleto\Boleto(
    (new Beneficiary(
        'Jose da Silva',
        '86049253099',
        'person'
    )),
    (new Payee(
        'Maria de Lurdes',
        '50581718054',
        'person'
    )),
    100.00,
    'DM',
    12345,
    'RECIBO',
    '999999',
    new DateTime('2023-12-31')
);

$boletoClient->create($boleto);