PHP code example of astrotechlabs / bancobrasil-sdk

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

    

astrotechlabs / bancobrasil-sdk example snippets


$bbService = new BancoBrasilPix(new BancoBrasilPixParams(
    clientId: 'xxxxxxxxx',
    clientSecret: 'yyyyyyyyyy',
    devAppId: 'ccccccccc',
    // isSandBox: true (opicional)
));

$pixChargeResponse = $bbService->createCharge(new PixData(
    senderName: 'João Silva',
    senderCpf: 'xxxxxxxxxxx',
    amount: 100.00,
    destinationKey: '0000000000', // Chave pix
    // description: 'Compra XPTO' (Opcional)
));

print_r($pixChargeResponse);
bash
$ php composer.phar