-
Notifications
You must be signed in to change notification settings - Fork 0
/
11-CalculationNFSe.php
42 lines (35 loc) · 1017 Bytes
/
11-CalculationNFSe.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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());
}