Skip to content

Commit

Permalink
santander pix cnab exemplo
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardokum committed Nov 17, 2023
1 parent efd1cd9 commit fbb96f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 4 additions & 0 deletions exemplos/arquivos/santander_pix.ret
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
02RETORNO0000000000000000011110000000009999999000000000000000000000000000000033000000000000000201016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
10000000000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000002201016 10000000000000000000020101600000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000099000000000000002
25 39a1178e-db6b-4407-bc7b-b674390acf5f id-da-transcao-pix 000003
9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004
8 changes: 8 additions & 0 deletions exemplos/santander_retorno_pix.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

require 'autoload.php';
$retorno = \Eduardokum\LaravelBoleto\Cnab\Retorno\Factory::make(__DIR__.DIRECTORY_SEPARATOR.'arquivos'.DIRECTORY_SEPARATOR.'santander_pix.ret');
$retorno->processar();

echo $retorno->getBancoNome();
dd($retorno->getDetalhes());
11 changes: 6 additions & 5 deletions src/Cnab/Retorno/Cnab400/Banco/Santander.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ protected function processarTrailer(array $trailer)

/**
* @param array $detalhe
* @return true
* @return bool
* @throws ValidationException
*/
private function processarPix(array $detalhe)
Expand All @@ -377,11 +377,12 @@ private function processarPix(array $detalhe)
5 => AbstractBoleto::TIPO_CHAVEPIX_ALEATORIA,
];

$d = $this->detalheAtual();

$d = $this->getDetalhe($this->increment - 1);
$d->setPixChaveTipo(Arr::get($tipoChave, $this->rem(2, 2, $detalhe)));
$d->setPixChave(Arr::get($tipoChave, $this->rem(3, 79, $detalhe)));
$d->setId(Arr::get($tipoChave, $this->rem(80, 114, $detalhe)));
$d->setPixChave($this->rem(3, 79, $detalhe));
$d->setId($this->rem(80, 114, $detalhe));

return true;
return false;
}
}

0 comments on commit fbb96f4

Please sign in to comment.