-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ewerson@e-htl.com.br
committed
Aug 30, 2018
1 parent
db8aa3f
commit 90811a8
Showing
7 changed files
with
344 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: ewerson | ||
* Date: 30/08/18 | ||
* Time: 10:18 | ||
*/ | ||
|
||
namespace Ewersonfc\CNABPagamento\Constants; | ||
|
||
|
||
class TipoRetorno | ||
{ | ||
/** | ||
* @var | ||
*/ | ||
const CONFIRMACAO_REJEICAO = 'confirmacao_rejeicao'; | ||
|
||
/** | ||
* @var | ||
*/ | ||
const LIQUIDACAO = 'liquidacao'; | ||
|
||
/** | ||
* @var | ||
*/ | ||
const DDA = 'DDA'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: ewerson | ||
* Date: 29/08/18 | ||
* Time: 15:09 | ||
*/ | ||
|
||
namespace Ewersonfc\CNABPagamento\Exceptions; | ||
|
||
|
||
class FileRetornoException extends CNABPagamentoException | ||
{ | ||
/** | ||
* FileRetornoException constructor. | ||
* @param string $message | ||
* @param int $code | ||
* @param Throwable|null $previous | ||
*/ | ||
function __construct(string $message = "", int $code = 0, Throwable $previous = null) | ||
{ | ||
if($message == "") | ||
$message = "Não foi possível ler o arquivo, verifique o caminho ou a permissão de leitura."; | ||
|
||
parent::__construct($message, $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: ewerson | ||
* Date: 29/08/18 | ||
* Time: 15:13 | ||
*/ | ||
|
||
namespace Ewersonfc\CNABPagamento\Factories; | ||
|
||
|
||
use Ewersonfc\CNABPagamento\Entities\DataFile; | ||
|
||
class RetornoFactory | ||
{ | ||
/** | ||
* @var | ||
*/ | ||
private $header; | ||
|
||
/** | ||
* @var | ||
*/ | ||
private $detail; | ||
|
||
/** | ||
* RetornoFactory constructor. | ||
* @param $header | ||
* @param $detail | ||
* @param $trailer | ||
*/ | ||
function __construct($header, $detail) | ||
{ | ||
$this->header = $header; | ||
$this->detail = $detail; | ||
} | ||
|
||
/** | ||
* @return DataFile | ||
*/ | ||
public function generateResponse() | ||
{ | ||
$dataFile = new DataFile(); | ||
$dataFile->header = $this->header; | ||
$dataFile->detail = $this->detail; | ||
|
||
return $dataFile; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.