Payment control via boleto
- Generate the billing slip
- Record billing data in database (subscriber, maturity, value, etc.)
- Get the bank’s return file (every business day)
- Process the return file (here you know the details of the payments)
- Update the database with the information obtained (mark up paid charges, etc.)
- Check late payments (not yet paid after due date) and effect blocking
Generating the billet
Always on the client’s side, I was involved with the generation of billets using PHP since 2007, having used the services of Banco do Brasil, Bradesco and Caixa Econômica Federal, in the unregistered and registered modalities.
Last year, I made a Billet generation bundle for Symfony 2 that does the same service as Boletophp: from the informed billing data, generates the corresponding billet. But this is only part of the system.
The following information is valid for the banks mentioned above, within the experience I had. I believe that the others follow the same model.
Getting the return file
To control the monthly fees, IE, know which tickets were paid, you need to get the return file which is generated every business day by the bank, and contains the information about the billets processed that day.
How do you get the return file bank?
Or through Internet Banking, or any software owner to be installed by a bank technician. Unfortunately, there is no API or other simpler and more automated way for the client. The routine of getting the file-return from the bank, and then sending it to your system to process it, is a manual task.
The exact answer on how to obtain these files will be given by the bank itself, either when hiring the collection portfolio, or at any other time.
Generating and sending the file-shipment
In registered contracts, it is also necessary to generate and send to the bank the call consignment file, so that the tickets generated by your system are registered in the bank system. The submissions are made in a similar way (Internet Banking or software owner). In Caixa Econômica there is a process of homologation for validate formatting your shipping files. After a testing phase, the "production" phase is activated, when the sent consignment files are effectively recorded.
Also last year, on the same system in Symfony 2, I implemented a class to generate file-shipments from the billing data and billets generated by the system - but this code is not in the public domain.
CNAB standard
Both files sent to the bank (consignment file, only for the registered wallet) as to the files received from the bank (return file daily) follow a standard formatting.
The CNAB (National Bank Automation Center) standard has some variations - CNAB 240, CNAB 400, etc.. Us websites Banco do Brasil and Caixa Econômica Federal technical documents are available detailing the standard used for this communication between the bank and the customer.
Each bank must maintain similar documentation, which is required to implement any solution that needs to generate or process "return" and/or "shipment".
Processing the return file
As there are variations between each bank, there is no ready-made solution for everyone. It is necessary to be with the technical documentation, and to implement it accordingly. Just as we have "various types of billets" in Boletophp... we have several "return-file types" and various "file-shipment types".
I have already made file-return processing implementations, in PHP, for the three banks mentioned, of which my clients were clients. This is another part of the system whose code is not in the public domain.
It’s not difficult, but it’s laborious - there are many details, many fields... it’s not pleasant at all.
In short
What you’ll need is:
Dialogue with the bank in order to gain access to the return files
Routine to get the file and send to your system
Implementation of script process the return files received by the system
could you be a little more specific? Also show a little of the relevant/problematic part of your code so we can help
– Math
There’s no code that can get that kind of information without accessing some API, either from the intermediaries you quoted, or directly with the financial institution responsible for the boleto.
– bfavaretto
The bank that generates the billet does not provide a file of payments made or something similar?
– rray
This type of information will be specific to each banking institution. You need to consult the institution you work with and check if and as they provide this type of service.
– utluiz
@lost looking for how to do just read examples of billets without registration and in this case the bank only takes notice of the billet when it is paid and the way to verify payment is manual.
– Lucas Marçal Dos Santos
@bfavaretto and utluiz I have to see how each bank treats this to make the proper integrations with the billets registered, correct? If that’s it, they took away my doubt.
– Lucas Marçal Dos Santos
I will let this pro @utluiz confirm, I have little practical experience with banks. But I believe you only need to deal with the bank issuing the ticket.
– bfavaretto
At least in Brazil, banks report payments made with file shipments. There are several file patterns, all of which are required to use the FEBRABAN standard (CNAB, with fixed column quantities). If anyone wants to elaborate on that in an answer, feel free.
– Oralista de Sistemas