1
Good evening friends,
I need to develop a script to decode the digitable line of a boleto in PHP, to my surprise I did not find anything pre-made about it, already for line encoding there are dozens of scripts. I could make an adaptation using an encoding script following the reverse path, but my script would still be incomplete for decoding light accounts, water, telephone, etc. And by the information I collected some companies do not follow the normal standard for line emission, which can make it even more difficult.
My question is, does anyone have a solution for me? I need the salary, company name and value, I actually wish I could check if the ticket is registered, but that seems impossible so I’ve given up. I couldn’t find an API to provide this service.
How are you trying to do? Are you reading the boleto image or just the barcode? Have you tried through OCR?
– Valdeir Psr
When you say "decode" the digitable line you mean "mount" the line?
– Rogério Dec
I think I understand what you want. You want to enter the barcode (type or use a reader) and separate CNPJ, MATURITY, VALUE, so you will have a relation of all this. But the barcode does not contain CNPJ or CPF, so it will no longer work. There are several free parts in the composition, but there is no standard. Examples
– rbz
I don’t think you can extract all this from the barcode. What you can do is identify the code of the bank that issued the boleto and, thus, consult in his service the data of the boleto. If I remember correctly, he only manages to extract the bank’s code, currency, due date and total value. Any other information I believe comes from the service of the issuing bank.
– Woss
Why then when I put in the internet banking the water account he can identify even the company that issued the billet ?
– Pedro Augusto
@Pedroaugusto because they are all registered. There is a unique code (some call "our number") of the bank referring to the boleto, so when you consult, it already has the internal record. Today, by law, all billets must be registered, IE, who generates the billet have to send a file to the bank to register them.
– rbz