|
4 | 4 | * |
5 | 5 | * @license GNU LGPL v3.0 - For details have a look at the LICENSE file |
6 | 6 | * @copyright ©2015 Alexander Schickedanz |
7 | | - * @link https://github.com/AbcAeffchen/Sephpa |
| 7 | + * @link https://github.com/AbcAeffchen/SepaUtilities |
8 | 8 | * |
9 | | - * @author Alexander Schickedanz <[email protected]> |
| 9 | + * @author Alexander Schickedanz <[email protected]> |
10 | 10 | */ |
| 11 | + |
11 | 12 | namespace AbcAeffchen\SepaUtilities; |
12 | 13 |
|
13 | 14 | /** |
@@ -40,10 +41,11 @@ class SepaUtilities |
40 | 41 | const SEPA_PAIN_001_001_03 = 100103; |
41 | 42 | const SEPA_PAIN_001_001_03_GBIC = 1001031; |
42 | 43 | // direct debit versions |
43 | | - const SEPA_PAIN_008_002_02 = 800202; |
44 | | - const SEPA_PAIN_008_003_02 = 800302; |
45 | | - const SEPA_PAIN_008_001_02 = 800102; |
46 | | - const SEPA_PAIN_008_001_02_GBIC = 8001021; |
| 44 | + const SEPA_PAIN_008_002_02 = 800202; |
| 45 | + const SEPA_PAIN_008_003_02 = 800302; |
| 46 | + const SEPA_PAIN_008_001_02 = 800102; |
| 47 | + const SEPA_PAIN_008_001_02_GBIC = 8001021; |
| 48 | + const SEPA_PAIN_008_001_02_AUSTRIAN_003 = 8001022; |
47 | 49 |
|
48 | 50 | const HTML_PATTERN_IBAN = '([a-zA-Z]\s*){2}([0-9]\s?){2}\s*([a-zA-Z0-9]\s*){1,30}'; |
49 | 51 | const HTML_PATTERN_BIC = '([a-zA-Z]\s*){6}[a-zA-Z2-9]\s*[a-nA-Np-zP-Z0-9]\s*(([A-Z0-9]\s*){3}){0,1}'; |
@@ -222,6 +224,11 @@ class SepaUtilities |
222 | 224 | 'PF', 'TF', 'YT', 'NC', |
223 | 225 | 'BL', 'MF', 'PM', 'WF'), |
224 | 226 | 'GB' => array('IM', 'GG', 'JE')); |
| 227 | + |
| 228 | + private static $exceptionalBics = array( |
| 229 | + 'NOTAVAIL' // used in Austria to mark that no BIC is provided |
| 230 | + ); |
| 231 | + |
225 | 232 | /* |
226 | 233 | * Checks if an creditor identifier (ci) is valid. Note that also if the ci is valid it does |
227 | 234 | * not have to exist |
@@ -398,6 +405,10 @@ public static function isEEATransaction($iban1, $iban2) |
398 | 405 | */ |
399 | 406 | public static function crossCheckIbanBic($iban, $bic) |
400 | 407 | { |
| 408 | + // check for special cases |
| 409 | + if(in_array(strtoupper($bic), self::$exceptionalBics)) |
| 410 | + return true; |
| 411 | + |
401 | 412 | // remove whitespaces |
402 | 413 | $iban = preg_replace('#\s+#','',$iban); |
403 | 414 | $bic = preg_replace('#\s+#','',$bic); |
|
0 commit comments