From aa359d996c4834cfb362aaa31586eff8f1ffa62a Mon Sep 17 00:00:00 2001 From: Filipe Santos Date: Tue, 10 Jul 2018 14:25:42 -0300 Subject: [PATCH] 1.x: 1.x: Add new endpoints --- CHANGELOG.md | 4 + composer.json | 4 +- examples/charge/createChargeBalanceSheet.php | 99 ++++++++++++++++++++ src/Gerencianet/config.json | 6 +- 4 files changed, 110 insertions(+), 3 deletions(-) create mode 100755 examples/charge/createChargeBalanceSheet.php diff --git a/CHANGELOG.md b/CHANGELOG.md index b5192ed..09ccea9 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.0.16 + +- Added: new endpoint (create charge balance sheet) + # 1.0.15 - Added: new endpoint (update plan) diff --git a/composer.json b/composer.json index bf43bb1..8730d29 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "gerencianet/gerencianet-sdk-php", "description": "GN API SDK PHP", - "version": "1.0.15", + "version": "1.0.16", "require": { "guzzlehttp/guzzle": "5.3.0", "php": ">=5.4.0" @@ -29,4 +29,4 @@ "Gerencianet": "src/" } } -} +} \ No newline at end of file diff --git a/examples/charge/createChargeBalanceSheet.php b/examples/charge/createChargeBalanceSheet.php new file mode 100755 index 0000000..bce5e29 --- /dev/null +++ b/examples/charge/createChargeBalanceSheet.php @@ -0,0 +1,99 @@ + 1]; +$body = [ + 'title' => 'Balancete Demonstrativo', + 'body' => + [ + 0 => + [ + 'header' => 'Demonstrativo de Consumo', + 'tables' => + [ + 0 => + [ + 'rows' => + [ + 0 => + [ + 0 => + [ + 'align' => 'left', + 'color' => '#000000', + 'style' => 'bold', + 'text' => 'Exemplo de despesa', + 'colspan' => 2, + ], + 1 => + [ + 'align' => 'left', + 'color' => '#000000', + 'style' => 'bold', + 'text' => 'Total lançado', + 'colspan' => 2, + ], + ], + 1 => + [ + 0 => + [ + 'align' => 'left', + 'color' => '#000000', + 'style' => 'normal', + 'text' => 'Instalação', + 'colspan' => 2, + ], + 1 => + [ + 'align' => 'left', + 'color' => '#000000', + 'style' => 'normal', + 'text' => 'R$ 100,00', + 'colspan' => 2, + ], + ], + ], + ], + ], + ], + 1 => + [ + 'header' => 'Balancete Geral', + 'tables' => + [ + 0 => + [ + 'rows' => + [ + 0 => + [ + 0 => + [ + 'align' => 'left', + 'color' => '#000000', + 'style' => 'normal', + 'text' => 'Confira na documentação da Gerencianet todas as configurações possíveis de um boleto balancete.', + 'colspan' => 4, + ], + ], + ], + ], + ], + ], + ], +]; +try { + $api = new Gerencianet($options); + $response = $api->createChargeBalanceSheet($params, $body); + print_r($response); +} catch (GerencianetException $e) { + print_r($e->code); + print_r($e->error); + print_r($e->errorDescription); +} catch (Exception $e) { + print_r($e->getMessage()); +} \ No newline at end of file diff --git a/src/Gerencianet/config.json b/src/Gerencianet/config.json index 533e149..12e5455 100755 --- a/src/Gerencianet/config.json +++ b/src/Gerencianet/config.json @@ -135,6 +135,10 @@ "createSubscriptionHistory": { "route": "/v1/subscription/:id/history", "method": "post" + }, + "createChargeBalanceSheet": { + "route": "/v1/charge/:id/balance-sheet", + "method": "post" } } -} +} \ No newline at end of file