Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Febraban Type #168

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Added Febraban Type #168

wants to merge 1 commit into from

Conversation

devdiogenes
Copy link

"Boleto" is the one of the most used payment methods in Brazil.

Febraban is the type of barcode used in boletos. It's is basically a interleaved of 2:5, but the digits order is different, then I ajusted to generate barcode in that order.

boleto

@casperbakker
Copy link
Member

@diogenes-souza-dev Would love to add this. Please add some basic tests for this barcode type and I will merge it.

@devdiogenes
Copy link
Author

Ok, I will do it soon

@devdiogenes
Copy link
Author

A boleto has a code and a barcode. The barcode has a differente value of the code.
Let's suppose that someone wants to develop a new document that contains the barcode of a boleto, typing only the code.

For this example, I generated a R$ 200,00 document.

That is the code: 07797.77705 11661.514114 78006.780429 1 92180000020000

That is the barcode:
image
And that is the value of barcode: 07791921800000200007777011661514117800678042

As you can see, the barcode value is very different of the code, It remove spaces, dots and some numbers, and changes the order of the numbers.

Then I will simulate that someone wants to generate this barcode, by only typing the code:

image

That is the result:

image

After trying to pay it using the barcode I generated, that was the result of the digital bank:

image

As you can see, I can pay sussessfully a boleto barcode that I generate only using the number of the boleto.

Copy link

@epcgrs epcgrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devdiogenes @casperbakker I tested the code too, all its good, I guess we can merge this

my tests:

image
Sem título

@casperbakker
Copy link
Member

I am sorry, but the code itself does not have unit tests for this type. Please add tests like the ones in https://github.com/picqer/php-barcode-generator/tree/main/tests, at least you need a verified file for this type so it will be automatically test. That way we know for sure that it will keep working in the future.

@epcgrs
Copy link

epcgrs commented Feb 1, 2024

Ok of course, I'll try to contribute to this PR then and add the unit tests when I get a little time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants