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 rules for Guatemala (GT) and Kosovo (XK) #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/iban-tools/rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@
length: 27
bban_pattern: '\d{7}[A-Z0-9]{16}'

'GT':
# Guatemala
length: 28
bban_pattern: '[A-Z]{4}\d{20}'

'HR':
# Croatia
length: 21
Expand Down Expand Up @@ -324,3 +329,8 @@
# Virgin Islands
length: 24
bban_pattern: '[A-Z0-9]{4}\d{16}'

'XK':
# Kosovo
length: 20
bban_pattern: '\d{16}'
4 changes: 3 additions & 1 deletion spec/iban-tools/iban_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ module IBANTools
"GI75NWBK000000007099453",
"GL4330003330229543",
"GR1601101250000000012300695",
"GT82TRAJ01020000001210029690",
"HR1210010051863000160",
"HU42117730161111101800000000",
"IE29AIBK93115212345678",
Expand Down Expand Up @@ -155,7 +156,8 @@ module IBANTools
"SM86U0322509800000000270100",
"TN5914207207100707129648",
"TR330006100519786457841326",
"UA173052990006762462622943782"
"UA173052990006762462622943782",
"XK051212012345678906"
].each do |iban_code|
describe iban_code do
it "should be valid" do
Expand Down