PHP code example of gpupo / brazilian-banking-automation

1. Go to this page and download the library: Download gpupo/brazilian-banking-automation 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/ */

    

gpupo / brazilian-banking-automation example snippets




    $headerAttributes = [
        'tipo_de_registro' => '0',
        'codigo_de_retorno' => '2',
        //...all ll   new Item($itemAttributes);

  $file = new File($headerObject, $trailerObject);
  $file->addItem($itemObject);

  $file->getContent(); // content of file
  //...




  $factory = new Cnab400\Factory();

  $item = $factory->factoryReturnItem($itemAttributes);
  $file = $factory->factoryfile($headerAttributes, $trailerAttributes);
  $file->addItem(item);

  $file->getContent(); // content of file