Skip to content

Commit

Permalink
Ajustes no metodo toAuthorize para testar os xml que chegam e dar um …
Browse files Browse the repository at this point in the history
…retorno mais objetivo.
  • Loading branch information
icompsoftcleiton committed Mar 14, 2022
1 parent 6fa2af9 commit 9fa984c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Complements.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ class Complements
*/
public static function toAuthorize($request, $response)
{
if (empty($request)) {
throw new DocumentsException('Erro ao protocolar !! o xml '
. 'a protocolar está vazio.');
}
if (empty($response)) {
throw new DocumentsException('Erro ao protocolar !!'
. ' O retorno da sefaz está vazio.');
}
$st = new Standardize();
$key = ucfirst($st->whichIs($request));
if ($key != 'CTe' && $key != 'CTeOS' && $key != 'EventoCTe' && $key != 'InutCTe') {
Expand Down

0 comments on commit 9fa984c

Please sign in to comment.