1. Go to this page and download the library: Download mathiconical/php-bnc 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/ */
mathiconical / php-bnc example snippets
athiconical\Client;
// alterne entre TEST e PROD.
$client = new Mathiconical\Client('TOKEN_API', 'TEST_or_PROD');
terne entre TEST e PROD.
$client = new Mathiconical\Client(
'TOKEN_API',
'TEST_or_PROD',
[
'foo' => 'bar',
'x-key' => 'x-value',
],
'TEST_or_PROD'
);
$client = new \Mathiconical\Client('apikey');
// Os Endpoints contidos na pasta Endpoints possuem alguns metodos que por padrão recebem 2 parametros.
// O primeiro é um array associativo que vai ser convertido em parametros para a uri.
// Exemplo: ['id' => 2], irá resultar na string '?id=2'.
// O segundo é um array que será convertido em json e passado para o body da requisição.
$guid = $client->getProcessGuid()->get(['param' => 1312]);
$client = new \Mathiconical\Client('apikey');
$status = $client->getStatusProcess()->get(['processId' => $guid]);
$client = new \Mathiconical\Client('apikey');
$status = $client->getProcessResult()->get(['processId' => $guid]);
$client = new \Mathiconical\Client('apikey');
// Mapear os parametros do processo com o objeto BncProcesso, BncItem e BncLote
$bncProcesso = new \Mathiconical\BncProcesso();
// ...
// Converter os dados salvos para objeto
$obj = $bncProcesso->convertToObject();
// Caso o processo já exista no sistema da BNC, deve ser passado o GUID
$obj->idIntegProcess = $guid;
// O retorno será do guid interno do processo.
$processo_guid = $client->getProcessResult()->get([], (array)$obj);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.