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

Implement IBAN generation #172

Merged
merged 4 commits into from
Apr 24, 2024
Merged

Implement IBAN generation #172

merged 4 commits into from
Apr 24, 2024

Conversation

antfroger
Copy link
Contributor

@antfroger antfroger commented Apr 22, 2024

Description

Implement IBAN generation. Generated IBANs are random but valid.
IBAN format is based on the country format of the IBAN.
Support many countries, based on PHP's faker implementation.

p := New().Payment()
iban := p.Iban()

Are you trying to fix an existing issue?

#168

Go Version

$ go version
go version go1.22.2 darwin/amd64

Go Tests

$ go test
2024/04/22 21:10:24 Error while requesting https://loremflickr.com/300/200 : request failed
2024/04/22 21:10:25 Error while creating a temp file: temp file creation failed
2024/04/22 21:10:25 Error while requesting https://randomuser.me : request failed
2024/04/22 21:10:25 Error while creating a temp file: temp file creation failed
PASS
ok  	github.com/jaswdr/faker/v2	3.600s

@jaswdr
Copy link
Owner

jaswdr commented Apr 23, 2024

Hey @antfroger thank you very much for the PR, my only general comment would be related to code organization, instead of having part of the code in payment.go/payment_test.go can you move everything to the iban.go/iban_test.go files?

This way we keep logic related to IBAN's in their proper files. Then you can use IBAN's methods in Payment to also generate IBAN's from Payment instances.

payment.go Outdated Show resolved Hide resolved
payment_test.go Outdated Show resolved Hide resolved
@jaswdr jaswdr merged commit 937f93c into jaswdr:master Apr 24, 2024
16 of 17 checks passed
@jaswdr
Copy link
Owner

jaswdr commented Apr 24, 2024

@antfroger LGTM, I merged and release it under v2.3.0. Congratulations on your first PR 🎉

@antfroger antfroger deleted the iban branch April 24, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants