Generate Boleto in Java

Asked

Viewed 10,187 times

5

I stuck here looking at some libs for bankroll generation and it seems that most have been abandoned. I wonder if there are any updated, better or easy to customize.

Analized libs:

Bopepo - http://jrimum.org/bopepo/

Stella-boleto - https://github.com/caelum/caelum-stella

Among the two, the documentation of the Bopepo is more complete, but has some banks that do not work. The forum has more than 1 year that has no posting.

The Stella-boleto has only a few banks. And I have not seen example or documentation to implement a new.

My question is: are there other similar open source projects that are active?

  • Amazing how something so important this without support by the community.

  • Look for someone to help you set up a Gradlew project and I couldn’t find !

2 answers

4

The ones you mentioned, apparently Stella-boleto is the most used today, even by other utilities of Caelum-Stella, like the Stella-bean-validation. Looking at the repository of Stella-boleto the last change is 16 days ago, and bopepo, 14 days ago.

Today I use the Stella-boleto. It actually has far fewer banks implemented than the bopepo (supports 13 more banks at the moment). I never used bopepo, so I can’t talk much about the project.

In the Stella-boleto, until then did not need to implement for a new bank, the current (BB, Bradesco, CEF, HSBC, Itaú, Santander and Safra) meet me, but it is not very difficult to implement a new.

Basically you must extend from the abstract class AbstractBanco and implement the interface Bench, doing the following:

  • implement methods that are not implemented in AbstractBanco, with geraCodigoDeBarrasPara (This is where you should consider portfolios if the bank has more than one), getNossoNumeroFormatado, getNumeroFormatadoComDigito, etc..
  • if the check digit generation is different from the standard, implement the interface GeradorDeDigito or extend GeradorDeDigitoPadrao and overwrite getGeradorDeDigito().

Other interesting points of these two projects are:

  • both are under the Apache V2 License, so you can make a Fork projects and follow their own path;
  • both are on github, so you can also make a Fork and adjust what you need (how to implement the billet you need) and make a pull request. Meets your requirement and collaborates with the community as well.

Jboleto, as well noted @Victorstafusa, is discontinued a long time ago, about 5 years ago I did a test with him with a development team and well, he had a kind of messy design and macaroni code =D

Other solutions, if you do not want to adopt these, is to integrate with some third party, such as Copper Free, Boleto Bancário, etc..

That said, I would (and will) go from Stella-boleto even, by the simplicity of use and extension (even without having specific documentation of the framework, you will have to read code to learn the structure, which incidentally is very simple). It may be interesting to test both and if more specific questions arise, include them here.

  • On the issuance of billet, is there no fee payment required, no pay book or anything like that? that libs like Bopepo and Stella-Caelum simply generate the Boleto?

  • 1

    @Raphaelandrade, that is, they generate from how you configure it (or inputa data), costs may exist in certain cases.

0

Try the jBoleto

I have worked with jBoleto and it was simple to use, accredited to be a good candidate for your application. In this case, I think the most active is the same Stella, ie with greater community and "buzz"

https://code.google.com/p/jboleto/

  • 1

    I worked with him in October 2008 and it was horrible. Full of bugs and gambiarras. It generated slips with wrong numbers. Looking at the link you posted there is no code, no commit and no download. The official website is dead and there are almost no references to it after 2009. It is difficult to find him nowadays, as he no longer exists in the places where he should be staying officially. In the meantime I found it on this link, but only the binaries without the source code: https://code.google.com/p/projetofinal2009/source/browse/trunk/buyfast/buyFastNegocio/lib/jBoleto-1.jar.

  • By the way, I found a version with the fonts. Again, nothing very reliable. Last update of 2009. It’s definitely not an active project. https://code.google.com/p/xmlboletojava2/source/browse/#svn%2FDeskBoleto%2Fsrc%2Forg%2Fjboleto%253Fstate%253Dclosed

  • I will try with Stella and see what happens, in the worst case as mentioned above I will try with Free Copper, Boleto Bancário.

Browser other questions tagged

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