Skip to content

Commit 2e9415d

Browse files
committed
Add iban specifications for Congo, Algeria, Egypt, Gabon, Jordan, Quatar, Timor Leste, Seychelles, Sao Tome and Principe, Saint Lucia
1 parent aecc0bb commit 2e9415d

File tree

2 files changed

+66
-21
lines changed

2 files changed

+66
-21
lines changed

data/iban.yml

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# http://en.wikipedia.org/wiki/International_Bank_Account_Number#IBAN_formats_by_country
22
# http://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf
3+
# https://bank.codes/iban/structure/
34

45
al: # Albania
56
length: 28
@@ -492,20 +493,58 @@ sn: # Senegal
492493
length: 28
493494
regexp: '[A-Z]\d{23}'
494495

495-
# not quite sure about these:
496-
497-
# cg: # Republic Congo
498-
# length: 27
499-
# # regexp: ''
500-
#
501-
# dz: # Algeria
502-
# length: 24
503-
# # regexp: ''
504-
#
505-
# eg: # Egypt
506-
# length: 27
507-
# # regexp: ''
508-
#
509-
# ga: # Gabun
510-
# length: 27
511-
# # regexp: ''
496+
cg: # Republic Congo
497+
length: 27
498+
regexp: '\d{23}'
499+
500+
dz: # Algeria
501+
length: 24
502+
regexp: '\d{20}'
503+
504+
eg: # Egypt
505+
length: 27
506+
regexp: '\d{23}'
507+
508+
ga: # Gabon
509+
length: 27
510+
regexp: '\d{23}'
511+
512+
jo: # Jordan https://bank.codes/iban/structure/jordan/
513+
length: 30
514+
regexp: >
515+
(?<bank_identifier> [A-Z]{4})
516+
(?<branch_identifier> \d{4})
517+
(?<account_number> [A-Z0-9]{18})
518+
519+
qa: # Qatar https://bank.codes/iban/structure/qatar/
520+
length: 29
521+
regexp: >
522+
(?<bank_identifier> [A-Z]{4})
523+
(?<account_number> [A-Z0-9]{21})
524+
525+
tl: # Timor Leste https://bank.codes/iban/structure/timor-leste/
526+
length: 23
527+
regexp: >
528+
(?<bank_identifier> \d{3})
529+
(?<account_number> \d{16})
530+
531+
sc: #Seychelles https://bank.codes/iban/structure/seychelles/
532+
length: 31
533+
regexp: >
534+
(?<bank_identifier> [A-Z]{4})
535+
(?<branch_identifier> \d{4})
536+
(?<account_number> \d{16})
537+
(?<currency> [A-Z]{3})
538+
539+
st: #Sao Tome and Principe https://bank.codes/iban/structure/sao-tome-and-principe/
540+
length: 25
541+
regexp: >
542+
(?<bank_identifier> \d{4})
543+
(?<branch_identifier> \d{4})
544+
(?<account_number> \d{13})
545+
546+
lc: #Saint Lucia https://bank.codes/iban/structure/saint-lucia/
547+
length: 32
548+
regexp: >
549+
(?<bank_identifier> [A-Z]{4})
550+
(?<account_number> \d{24})

spec/iban_spec.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
'CH9300762011623852957',
103103
'UA573543470006762462054925026',
104104
'GB29NWBK60161331926819',
105-
# 'DZ4000400174401001050486',
105+
'DZ4000400174401001050486',
106106
'AO06000600000100037131174',
107107
'AZ21NABZ00000000137010001944',
108108
'BH29BMAG1299123456BH00',
@@ -114,11 +114,11 @@
114114
'CM2110003001000500000605306',
115115
'CV64000300004547069110176',
116116
'FR7630007000110009970004942',
117-
# 'CG5230011000202151234567890',
117+
'CG5230011000202151234567890',
118118
'CR0515202001026284066',
119119
'DO28BAGR00000001212453611324',
120-
# 'EG1100006001880800100014553',
121-
# 'GA2140002000055602673300064',
120+
'EG1100006001880800100014553',
121+
'GA2140002000055602673300064',
122122
'GT82TRAJ01020000001210029690',
123123
'IR580540105180021273113007',
124124
'IL620108000000099999999',
@@ -140,6 +140,12 @@
140140
'TR330006100519786457841326',
141141
'AE260211000000230064016',
142142
'XK051212012345678906',
143+
'JO94CBJO0010000000000131000302',
144+
'QA58DOHB00001234567890ABCDEFG',
145+
'TL380030000000025923744',
146+
'SC18SSCB11010000000000001497USD',
147+
'ST23000200000289355710148',
148+
'LC55HEMM000100010012001200023015',
143149
].each do |code|
144150
describe code do
145151
it 'should be valid' do

0 commit comments

Comments
 (0)