Skip to content

Commit 19b8bf1

Browse files
authored
Merge pull request #31 from trishrempel/add-vatican-city
Add Vatican City rules
2 parents 8dfc480 + 33c9a19 commit 19b8bf1

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

lib/iban-tools/conversion_rules.yml

+4
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@
317317
reserved: 1!c
318318
account_number: 16!c
319319

320+
'VA':
321+
bank_code: 3!n
322+
account_number: 15!n
323+
320324
'VG':
321325
bank_code: 4!c
322326
account_number: 16!n

lib/iban-tools/rules.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@
249249
# Montenegro
250250
length: 22
251251
bban_pattern: '\d{18}'
252-
252+
253253
'MG':
254254
# Madagascar
255255
length: 27
256256
bban_pattern: '\d{23}'
257-
257+
258258
'MK':
259259
# Macedonia
260260
length: 19
@@ -370,6 +370,11 @@
370370
length: 29
371371
bban_pattern: '\d{25}'
372372

373+
'VA':
374+
# Vatican City
375+
length: 22
376+
bban_pattern: '\d{18}'
377+
373378
'VG':
374379
# Virgin Islands
375380
length: 24

spec/iban-tools/conversion_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ module IBANTools
6666
'SM86U0322509800000000270100' => {check_char: 'U', bank_code: '3225', branch_code: '9800', account_number: '270100'},
6767
'TN5914207207100707129648' => {bank_code: '14', branch_code: '207', account_number: '207100707129648'},
6868
'TR330006100519786457841326' => {bank_code: '61', reserved: '0', account_number: '519786457841326'},
69+
'VA59001123000012345678' => {bank_code: '1', account_number: '123000012345678'},
6970
'VG96VPVG0000012345678901' => {bank_code: 'VPVG', account_number: '12345678901'},
7071
}
7172

spec/iban-tools/iban_spec.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ module IBANTools
174174
"XK051212012345678906",
175175
"SC52BAHL01031234567890123456USD",
176176
"PS92PALS000000000400123456702",
177-
"CR05015202001026284066"
177+
"CR05015202001026284066",
178+
"VA59001123000012345678"
178179
].each do |iban_code|
179180
describe iban_code do
180181
it "should be valid" do

0 commit comments

Comments
 (0)