How to control tuition and access to the application?

Asked

Viewed 2,241 times

9

I’m developing a system that should block the access of those who do not pay the monthly bill.

I took a look at the design Boletophp for generating billets and partially attends me. I can generate the billets, but I do not know when and if they were paid.

What I need is system-level feedback on billet payment, something like the Paypal API does, so account blocking is automatic.

For now I can not use Apis as Pagseguro, Mercadopago etc.

  • 1

    could you be a little more specific? Also show a little of the relevant/problematic part of your code so we can help

  • 1

    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.

  • 1

    The bank that generates the billet does not provide a file of payments made or something similar?

  • 3

    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.

  • @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.

  • 1

    @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.

  • 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.

  • 1

    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.

Show 3 more comments

3 answers

8


Payment control via boleto

  1. Generate the billing slip
  2. Record billing data in database (subscriber, maturity, value, etc.)
  3. Get the bank’s return file (every business day)
  4. Process the return file (here you know the details of the payments)
  5. Update the database with the information obtained (mark up paid charges, etc.)
  6. 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:

  1. Dialogue with the bank in order to gain access to the return files

  2. Routine to get the file and send to your system

  3. Implementation of script process the return files received by the system

2

I have always worked in companies in the financial sector, which provide services and develop systems for banks. However, I don’t have much experience with the bulletin systems because I didn’t work directly with them.

Meanwhile, having already worked on systems client, That is, they generate the billets and receive the return, I can say that financial institutions use standards for sending and receiving information about billets. The most common where I worked is CNAB.

But your problem is not the format itself, but how the institution will (or will not) make that information available to your customers through a web service.

You see, the systems I work with run internally in the bank, so we read the Return of CNAB through a Procedure, a table or a TXT file in a directory configured by the database.

But to make that information available to third party, each bank will create its own solution, like the internet bankings that are out there.

My suggestion is that you go to the agency to talk to your manager and question about this service. He will probably direct this question to someone in the bank’s IT, who will be able to inform the format of the data and the way it is made available.

Maybe this service is expensive, since the bank needs to worry about security, availability and does not want anyone accessing services directly.

Something I see in many smaller virtual stores is a feature where the user himself controls paid slips, since he can access the internet banking of the company. Some banks (Banco do Brasil, for example) have exports of data from the internet banking in CSV and XLS formats, so it would be possible to make it a little easier and allow the user to upload these files to his system and identify if there are paid slips in the statement.

2

To do this control it is necessary that you query the status of the boletos (whether it was paid or not, late, etc...) in the system of the bank, this query is done via text files exchange with the bank through the CNAB standard, However, each bank has its own extensions to the CNAB standard which obliges you to have a different model of sending and receiving for each bank. The specification of these models can be found on the internet or on the website of each bank.

It is important to note that each time you make a query the bank charges you a fee, so limit the amount of queries.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.