Ajuda Open Boleto
Gente por favor me ajudem !
Eu estou tentando homologar um boleto bradesco , no banco e eles já reprovaram umas 10 vezes minha linha digitavel e o meu nosso numero alguem tem conhecimento pra me ajudar???
Estou fazendo assim aonde criar o boleto, passo o nosso numero com 11 digitos mas apenas completando o id do boleto
$nossoNum = $idBoleto;
$nossoNum_INT = str_pad($nossoNum, 11, '0', STR_PAD_LEFT);
$boleto = new Bradesco(array(
'dataVencimento' => new DateTime($diaVencimento),
'valor' => $dadosPagamento[0]->valor_bruto,
'sequencial' => $nossoNum_INT, // Até 11 dígitos
O banco disse que minha carteira é 9 e meu digito verificador é modulo 11 com base 7
Só que estava vendo a classe de linha digitavel e esta totalmente diferente , não sei o que passar no começo do open boleto , tento tratar na classe abstrata e nada
Metodo da linha digitavel
public function getLinhaDigitavel()
{
$chave = $this->getCampoLivre();
// Break down febraban positions 20 to 44 into 3 blocks of 5, 10 and 10
// characters each.
$blocks = array(
'20-24' => substr($chave, 0, 5),
'25-34' => substr($chave, 5, 10),
'35-44' => substr($chave, 15, 10),
);
// Concatenates bankCode + currencyCode + first block of 5 characters and
// calculates its check digit for part1.
$check_digit = static::modulo10($this->getCodigoBanco() . $this->getMoeda() . $blocks['20-24']);
// Shift in a dot on block 20-24 (5 characters) at its 2nd position.
$blocks['20-24'] = substr_replace($blocks['20-24'], '.', 1, 0);
// Concatenates bankCode + currencyCode + first block of 5 characters +
// checkDigit.
$part1 = $this->getCodigoBanco(). $this->getMoeda() . $blocks['20-24'] . $check_digit;
// Calculates part2 check digit from 2nd block of 10 characters.
$check_digit = static::modulo10($blocks['25-34']);
$part2 = $blocks['25-34'] . $check_digit;
// Shift in a dot at its 6th position.
$part2 = substr_replace($part2, '.', 5, 0);
// Calculates part3 check digit from 3rd block of 10 characters.
$check_digit = static::modulo10($blocks['35-44']);
// As part2, we do the same process again for part3.
$part3 = $blocks['35-44'] . $check_digit;
$part3 = substr_replace($part3, '.', 5, 0);
// Check digit for the human readable number.
$cd = $this->getDigitoVerificador();
// Put part4 together.
$part4 = $this->getFatorVencimento() . $this->getValorZeroFill();
// Now put everything together.
return "$part1 $part2 $part3 $cd $part4";
}
Alguem pra me dar uma luz uma direção proque nao sei o que fazer ..
Discussão (3)
Carregando comentários...