Skip to content

Commit a02f368

Browse files
author
Bozhidar Hristov
committed
[Validator] Add Belarus IBAN format
1 parent 338597c commit a02f368

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Constraints/IbanValidator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class IbanValidator extends ConstraintValidator
5151
'BH' => 'BH\d{2}[A-Z]{4}[\dA-Z]{14}', // Bahrain
5252
'BI' => 'BI\d{2}\d{12}', // Burundi
5353
'BJ' => 'BJ\d{2}[A-Z]{1}\d{23}', // Benin
54+
'BY' => 'BY\d{2}[\dA-Z]{4}\d{4}[\dA-Z]{16}', // Belarus - https://bank.codes/iban/structure/belarus/
5455
'BL' => 'FR\d{2}\d{5}\d{5}[\dA-Z]{11}\d{2}', // Saint Barthelemy
5556
'BR' => 'BR\d{2}\d{8}\d{5}\d{10}[A-Z][\dA-Z]', // Brazil
5657
'CG' => 'CG\d{2}\d{23}', // Congo

Tests/Constraints/IbanValidatorTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ public function getValidIbans()
6868
array('BE62 5100 0754 7061'), //Belgium
6969
array('BA39 1290 0794 0102 8494'), //Bosnia and Herzegovina
7070
array('BG80 BNBG 9661 1020 3456 78'), //Bulgaria
71+
array('BY 13 NBRB 3600 900000002Z00AB00'), //Belarus
72+
array('BY13 NBRB 3600 900000002Z00AB00'), //Belarus
73+
array('BY22NB23324232T78YR7823HR32U'), //Belarus
7174
array('HR12 1001 0051 8630 0016 0'), //Croatia
7275
array('CY17 0020 0128 0000 0012 0052 7600'), //Cyprus
7376
array('CZ65 0800 0000 1920 0014 5399'), //Czech Republic
@@ -183,6 +186,10 @@ public function getIbansWithInvalidFormat()
183186
array('BA39 1290 0794 0102 8494 4'), //Bosnia and Herzegovina
184187
array('BG80 BNBG 9661 1020 3456 7'), //Bulgaria
185188
array('BG80 B2BG 9661 1020 3456 78'), //Bulgaria
189+
array('BY 13 NBRB 3600 900000002Z00AB001'), //Belarus
190+
array('BY 13 NBRB 3600 900000002Z00AB0'), //Belarus
191+
array('BYRO NBRB 3600 900000002Z00AB0'), //Belarus
192+
array('BY 13 3600 NBRB 900000002Z00AB05'), //Belarus
186193
array('HR12 1001 0051 8630 0016 01'), //Croatia
187194
array('CY17 0020 0128 0000 0012 0052 7600 1'), //Cyprus
188195
array('CZ65 0800 0000 1920 0014 5399 1'), //Czech Republic
@@ -293,6 +300,7 @@ public function getIbansWithValidFormatButIncorrectChecksum()
293300
array('BE62 5100 0754 7062'), //Belgium
294301
array('BA39 1290 0794 0102 8495'), //Bosnia and Herzegovina
295302
array('BG80 BNBG 9661 1020 3456 79'), //Bulgaria
303+
array('BY90 NBRB 3600 900000002Z00AB00'), //Belarus
296304
array('HR12 1001 0051 8630 0016 1'), //Croatia
297305
array('CY17 0020 0128 0000 0012 0052 7601'), //Cyprus
298306
array('CZ65 0800 0000 1920 0014 5398'), //Czech Republic

0 commit comments

Comments
 (0)