-
Notifications
You must be signed in to change notification settings - Fork 16
/
nfse.simple.php
49 lines (43 loc) · 1.28 KB
/
nfse.simple.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
43
44
45
46
47
48
49
<?php
require '../vendor/autoload.php';
use TecnoSpeed\Plugnotas\Builders\NfseBuilder;
use TecnoSpeed\Plugnotas\Configuration;
use TecnoSpeed\Plugnotas\Communication\CallApi;
try {
$nfse = (new NfseBuilder)
->withPrestador([
'cpfCnpj' => '00.000.000/0001-91',
'inscricaoMunicipal' => '123456',
'razaoSocial' => 'Razao Social do Prestador',
'endereco' => [
'logradouro' => 'Rua de Teste',
'numero' => '1234',
'codigoCidade' => '4115200',
'cep' => '87.050-800'
]
])
->withTomador([
'cpfCnpj' => '000.000.001-91',
'razaoSocial' => 'Razao Social do Tomador'
])
->withServicos([
0 => [
'codigo' => '1.02',
'discriminacao' => 'Exemplo',
'cnae' => '4751201',
'iss' => [
'aliquota' => '3'
],
'valor' => [
'servico' => 1500.03
]
]
])
->build([]);
$nfse->validate();
$configuration = new Configuration();
$response = $nfse->send($configuration);
var_dump($response);
} catch (\Exception $e) {
var_dump($e);
}