Skip to content

Commit

Permalink
Merge pull request #26 from timobleeker/add-benin
Browse files Browse the repository at this point in the history
Add Benin
  • Loading branch information
toreriklinnerud committed Dec 5, 2023
2 parents d9da87f + e139a5d commit 507d403
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/iban-tools/conversion_rules.yml
Expand Up @@ -62,6 +62,10 @@
bank_code: 4!a
account_number: 14!c

'BJ':
bank_code: 2!c
account_number: 22!n

'CH':
bank_code: 5!n
account_number: 12!c
Expand Down
5 changes: 5 additions & 0 deletions lib/iban-tools/rules.yml
Expand Up @@ -45,6 +45,11 @@
length: 22
bban_pattern: '[A-Z]{4}[A-Z0-9]{14}'

'BJ':
# Benin
length: 28
bban_pattern: '[A-Z0-9]{2}[0-9]{22}'

'BR':
# Brazil
length: 29
Expand Down
1 change: 1 addition & 0 deletions spec/iban-tools/conversion_spec.rb
Expand Up @@ -13,6 +13,7 @@ module IBANTools
'BE68539007547034' => {bank_code: '539', account_number: '75470', check_digits: '34'},
'BG80BNBG96611020345678' => {bank_code: 'BNBG', branch_code: '9661', account_type: '10', account_number: '20345678'},
'BH67BMAG00001299123456' => {bank_code: 'BMAG', account_number: '1299123456'},
'BJ66BJ0610100100144390000769' => {bank_code: 'BJ', account_number: '610100100144390000769'},
'CH9300762011623852957' => {bank_code: '762', account_number: '11623852957'},
'CY17002001280000001200527600' => {bank_code: '2', branch_code: '128', account_number: '1200527600'},
'CZ6508000000192000145399' => {bank_code: '800', account_prefix: '19', account_number: '2000145399'},
Expand Down
1 change: 1 addition & 0 deletions spec/iban-tools/iban_spec.rb
Expand Up @@ -102,6 +102,7 @@ module IBANTools
"BE68539007547034",
"BG80BNBG96611020345678",
"BH67BMAG00001299123456",
"BJ66BJ0610100100144390000769",
"BR9700360305000010009795493P1",
"CH9300762011623852957",
"CY17002001280000001200527600",
Expand Down

0 comments on commit 507d403

Please sign in to comment.