Skip to content

Commit

Permalink
[MAIN][UPD] - Deixando apenas os exemplos para NFSe
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio Alexssandro Lino committed Jul 12, 2021
1 parent afc3488 commit cc2feb9
Show file tree
Hide file tree
Showing 53 changed files with 304 additions and 954 deletions.
16 changes: 8 additions & 8 deletions exemple/nfse/01-AddNFSe.php → exemple/01-AddNFSe.php
@@ -1,13 +1,13 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\NFSe\Services\NFSeNotaFacil;
use NotaFacil\Nfse\Services\NSFeNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

Expand All @@ -26,12 +26,12 @@
"numero" => "32661380",
"tipo_telefone" => "1"
],
"nome_razao_social" => "Empresa teste",
"nome_fantasia" => "Empresa teste",
"nome_razao_social" => "teste teste",
"nome_fantasia" => "teste teste",
"tipo_cliente" => "PJ",
"cnpj_cpf" => "07298848000198",
"tipo_cadastro" => "Ambos",
"email" => "teste@emailtest.com.br",
"email" => "l.nunes@teste.com.br",
"status" => 1
],
"nfs_total" => [
Expand Down Expand Up @@ -83,9 +83,9 @@
"valor" => "0"
]
],
"numeracao_rps" => "100102",
"numeracao_rps" => "100104",
"serie_rps" => "1",
"nome_cliente" => "Empresa SISTEMA DE GESTAO S.A.",
"nome_cliente" => "VHSYS SISTEMA DE GESTAO S.A.",
"regime_tributacao" => 1,
"regime_especial_tributacao" => 1,
"natureza_operacao" => 1,
Expand All @@ -101,7 +101,7 @@
];


$services = (new NFSeNotaFacil($credentialsToken))->addNFSe($payload);
$services = (new NSFeNotaFacil($credentialsToken))->addNFSe($payload);

dump($services->getContent(), $services->getStatusCode());

Expand Down
6 changes: 3 additions & 3 deletions exemple/nfse/02-UpdateNFSe.php → exemple/02-UpdateNFSe.php
@@ -1,13 +1,13 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\NFSe\Services\NFSeNotaFacil;
use NotaFacil\Nfse\Services\NSFeNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

Expand Down Expand Up @@ -90,7 +90,7 @@
];


$services = (new NFSeNotaFacil($credentialsToken))->updateNFSe(143503,$payload);
$services = (new NSFeNotaFacil($credentialsToken))->updateNFSe(143503,$payload);

dump($services->getContent(), $services->getStatusCode());

Expand Down
6 changes: 3 additions & 3 deletions exemple/nfse/03-IssueNFSe.php → exemple/03-IssueNFSe.php
@@ -1,20 +1,20 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\NFSe\Services\NFSeNotaFacil;
use NotaFacil\Nfse\Services\NSFeNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

$payload = ["ids" => [ 143503 ] ];


$services = (new NFSeNotaFacil($credentialsToken))->issueNFSe($payload);
$services = (new NSFeNotaFacil($credentialsToken))->issueNFSe($payload);

dump($services->getContent(), $services->getStatusCode());

Expand Down
@@ -1,13 +1,13 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\NFSe\Services\NFSeNotaFacil;
use NotaFacil\Nfse\Services\NSFeNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

Expand All @@ -17,7 +17,7 @@
];


$services = (new NFSeNotaFacil($credentialsToken))->cancelIssue($payload);
$services = (new NSFeNotaFacil($credentialsToken))->cancelIssue($payload);

dump($services->getContent(), $services->getStatusCode());

Expand Down
@@ -1,17 +1,19 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\Common\Services\CustomersNotaFacil;
use NotaFacil\Nfse\Services\NSFeNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

$services = (new CustomersNotaFacil($credentialsToken))->listAll();


$services = (new NSFeNotaFacil($credentialsToken))->deleteNFSe(200);

dump($services->getContent(), $services->getStatusCode());

Expand Down
@@ -1,17 +1,19 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\Common\Services\CustomersNotaFacil;
use NotaFacil\Nfse\Services\NSFeNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

$services = (new CustomersNotaFacil($credentialsToken))->showByID(137);


$services = (new NSFeNotaFacil($credentialsToken))->listAll();

dump($services->getContent(), $services->getStatusCode());

Expand Down
@@ -1,17 +1,19 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\Common\Services\CustomersNotaFacil;
use NotaFacil\Nfse\Services\NSFeNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

$services = (new CustomersNotaFacil($credentialsToken))->deleteCustomer(137);


$services = (new NSFeNotaFacil($credentialsToken))->showByID(198);

dump($services->getContent(), $services->getStatusCode());

Expand Down
26 changes: 26 additions & 0 deletions exemple/08-ConsultNFSeByRPS.php
@@ -0,0 +1,26 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\Nfse\Services\NSFeConsultNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

$payload = [
"ids" => [
56491,55887,47222
]
];

$services = (new NSFeConsultNotaFacil($credentialsToken))->consultRPS($payload);

dump($services->getContent(), $services->getStatusCode());

} catch (NotaFacilException $th) {
dump($th->getMessage(), $th->getCode());
}
@@ -1,19 +1,23 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\Common\Services\CustomersNotaFacil;
use NotaFacil\Nfse\Services\NSFeConsultNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

$payload = [
"ids" => [
122801
]
];


$services = (new CustomersNotaFacil($credentialsToken))->getAddlPhoneByID(138, 285);
$services = (new NSFeConsultNotaFacil($credentialsToken))->consultNFSe($payload);

dump($services->getContent(), $services->getStatusCode());

Expand Down
@@ -1,19 +1,23 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\Common\Services\CustomersNotaFacil;
use NotaFacil\Nfse\Services\NSFeConsultNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

$payload = [
"ids" => [
153
]
];


$services = (new CustomersNotaFacil($credentialsToken))->listAllAddlPhone(138);
$services = (new NSFeConsultNotaFacil($credentialsToken))->consultNFSe($payload);

dump($services->getContent(), $services->getStatusCode());

Expand Down
42 changes: 42 additions & 0 deletions exemple/11-CalculationNFSe.php
@@ -0,0 +1,42 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\Nfse\Services\NSFeNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

$payload = [
"nfs_totais" => [
"valor_servico" => 50,
"valor_deducoes" => 5
],
"nfs_impostos" => [
[
"tipo" => "IR",
"reter" => true,
"aliquota" => 6.55
],
[
"tipo" => "INSS",
"reter" => true,
"aliquota" => 5.50
]
],
"nfs_construcao_civil" => [
"valor_material" => 50
]
];

$services = (new NSFeNotaFacil($credentialsToken))->calculation($payload);

dump($services->getContent(), $services->getStatusCode());

} catch (NotaFacilException $th) {
dump($th->getMessage(), $th->getCode());
}
@@ -1,24 +1,23 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\Common\Services\CustomersNotaFacil;
use NotaFacil\Nfse\Services\NSFeParamNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

$payload = [
"ddd" => "41",
"numero" => "4196105002",
"ramal" => "1",
"tipo_telefone" => 2
"numeracao_rps" => 10000,
"serie_rps" => "1",
"ambiente" => false
];

$services = (new CustomersNotaFacil($credentialsToken))->addAddlPhone(138,$payload);
$services = (new NSFeParamNotaFacil($credentialsToken))->addParamNFSe($payload);

dump($services->getContent(), $services->getStatusCode());

Expand Down
20 changes: 20 additions & 0 deletions exemple/13-GetParamNFSePROD.php
@@ -0,0 +1,20 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\Nfse\Services\NSFeParamNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

$services = (new NSFeParamNotaFacil($credentialsToken))->getParamNFSe( NSFeParamNotaFacil::PRODUCTION_ENVIRONMENT );

dump($services->getContent(), $services->getStatusCode());

} catch (NotaFacilException $th) {
dump($th->getMessage(), $th->getCode());
}
20 changes: 20 additions & 0 deletions exemple/14-GetParamNFSeDEV.php
@@ -0,0 +1,20 @@
<?php
include_once(__DIR__.'/../../vendor/autoload.php');

use NotaFacil\Nfse\Services\NSFeParamNotaFacil;
use NotaFacil\Common\Exceptions\NotaFacilException;

try {

$credentialsToken = [
"consumer-id" => "CONSUMER_ID",
"token-bearer" => "TOKEN_BEARER"
];

$services = (new NSFeParamNotaFacil($credentialsToken))->getParamNFSe( NSFeParamNotaFacil::PARAM_APPROVAL_ENVIRONMENT );

dump($services->getContent(), $services->getStatusCode());

} catch (NotaFacilException $th) {
dump($th->getMessage(), $th->getCode());
}

0 comments on commit cc2feb9

Please sign in to comment.