Completed
Push — master ( 76d08b...6e0b93 )
by wen
02:53
created

RegexProvider::getBankIcon()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
4
namespace Sco\Bankcard\Providers;
5
6
use Sco\Bankcard\BankName;
7
use Sco\Bankcard\CardType;
8
use Sco\Bankcard\Exceptions\ValidationException;
9
use Sco\Bankcard\Info;
10
11
class RegexProvider extends AbstractProvider
12
{
13
    protected $patterns = [
14
        [
15
            'bankCode' => 'PSBC',
16
            'patterns' => [
17
                [
18
                    'regex'    => '/^(621096|621098|622150|622151|622181|622188|622199|955100|621095|620062|621285|621798|621799|621797|620529|621622|621599|621674|623218|623219)\d{13}$/',
19
                    'cardType' => 'DC',
20
                ],
21
                [
22
                    'regex'    => '/^(62215049|62215050|62215051|62218850|62218851|62218849)\d{11}$/',
23
                    'cardType' => 'DC',
24
                ],
25
                [
26
                    'regex'    => '/^(622812|622810|622811|628310|625919)\d{10}$/',
27
                    'cardType' => 'CC',
28
                ],
29
            ],
30
        ],
31
        [
32
            'bankCode' => 'ICBC',
33
            'patterns' => [
34
                [
35
                    'regex'    => '/^(620200|620302|620402|620403|620404|620406|620407|620409|620410|620411|620412|620502|620503|620405|620408|620512|620602|620604|620607|620611|620612|620704|620706|620707|620708|620709|620710|620609|620712|620713|620714|620802|620711|620904|620905|621001|620902|621103|621105|621106|621107|621102|621203|621204|621205|621206|621207|621208|621209|621210|621302|621303|621202|621305|621306|621307|621309|621311|621313|621211|621315|621304|621402|621404|621405|621406|621407|621408|621409|621410|621502|621317|621511|621602|621603|621604|621605|621608|621609|621610|621611|621612|621613|621614|621615|621616|621617|621607|621606|621804|621807|621813|621814|621817|621901|621904|621905|621906|621907|621908|621909|621910|621911|621912|621913|621915|622002|621903|622004|622005|622006|622007|622008|622010|622011|622012|621914|622015|622016|622003|622018|622019|622020|622102|622103|622104|622105|622013|622111|622114|622017|622110|622303|622304|622305|622306|622307|622308|622309|622314|622315|622317|622302|622402|622403|622404|622313|622504|622505|622509|622513|622517|622502|622604|622605|622606|622510|622703|622715|622806|622902|622903|622706|623002|623006|623008|623011|623012|622904|623015|623100|623202|623301|623400|623500|623602|623803|623901|623014|624100|624200|624301|624402|623700|624000)\d{12}$/',
36
                    'cardType' => 'DC',
37
                ],
38
                [
39
                    'regex'    => '/^(622200|622202|622203|622208|621225|620058|621281|900000|621558|621559|621722|621723|620086|621226|621618|620516|621227|621288|621721|900010|623062|621670|621720|621379|621240|621724|621762|621414|621375|622926|622927|622928|622929|622930|622931|621733|621732|621372|621369|621763)\d{13}$/',
40
                    'cardType' => 'DC',
41
                ],
42
                [
43
                    'regex'    => '/^(402791|427028|427038|548259|621376|621423|621428|621434|621761|621749|621300|621378|622944|622949|621371|621730|621734|621433|621370|621764|621464|621765|621750|621377|621367|621374|621731|621781)\d{10}$/',
44
                    'cardType' => 'DC',
45
                ],
46
                [
47
                    'regex'    => '/^(9558)\d{15}$/',
48
                    'cardType' => 'DC',
49
                ],
50
                [
51
                    'regex'    => '/^(370246|370248|370249|370247|370267|374738|374739)\d{9}$/',
52
                    'cardType' => 'CC',
53
                ],
54
                [
55
                    'regex'    => '/^(427010|427018|427019|427020|427029|427030|427039|438125|438126|451804|451810|451811|458071|489734|489735|489736|510529|427062|524091|427064|530970|530990|558360|524047|525498|622230|622231|622232|622233|622234|622235|622237|622239|622240|622245|622238|451804|451810|451811|458071|628288|628286|622206|526836|513685|543098|458441|622246|544210|548943|356879|356880|356881|356882|528856|625330|625331|625332|622236|524374|550213|625929|625927|625939|625987|625930|625114|622159|625021|625022|625932|622889|625900|625915|625916|622171|625931|625113|625928|625914|625986|625925|625921|625926|625942|622158|625917|625922|625934|625933|625920|625924|625017|625018|625019)\d{10}$/',
56
                    'cardType' => 'CC',
57
                ],
58
                [
59
                    'regex'    => '/^(45806|53098|45806|53098)\d{11}$/',
60
                    'cardType' => 'CC',
61
                ],
62
                [
63
                    'regex'    => '/^(622210|622211|622212|622213|622214|622220|622223|622225|622229|622215|622224)\d{10}$/',
64
                    'cardType' => 'SCC',
65
                ],
66
                [
67
                    'regex'    => '/^(620054|620142|620184|620030|620050|620143|620149|620124|620183|620094|620186|620148|620185)\d{10}$/',
68
                    'cardType' => 'PC',
69
                ],
70
                [
71
                    'regex'    => '/^(620114|620187|620046)\d{13}$/',
72
                    'cardType' => 'PC',
73
                ],
74
            ],
75
        ],
76
        [
77
            'bankCode' => 'ABC',
78
            'patterns' => [
79
                [
80
                    'regex'    => '/^(622841|622824|622826|622848|620059|621282|622828|622823|621336|621619|622821|622822|622825|622827|622845|622849|623018|623206|621671|622840|622843|622844|622846|622847|620501)\d{13}$/',
81
                    'cardType' => 'DC',
82
                ],
83
                [
84
                    'regex'    => '/^(95595|95596|95597|95598|95599)\d{14}$/',
85
                    'cardType' => 'DC',
86
                ],
87
                [
88
                    'regex'    => '/^(103)\d{16}$/',
89
                    'cardType' => 'DC',
90
                ],
91
                [
92
                    'regex'    => '/^(403361|404117|404118|404119|404120|404121|463758|519412|519413|520082|520083|552599|558730|514027|622836|622837|628268|625996|625998|625997|622838|625336|625826|625827|544243|548478|628269)\d{10}$/',
93
                    'cardType' => 'CC',
94
                ],
95
                [
96
                    'regex'    => '/^(622820|622830)\d{10}$/',
97
                    'cardType' => 'SCC',
98
                ],
99
            ],
100
        ],
101
        [
102
            'bankCode' => 'BOC',
103
            'patterns' => [
104
                [
105
                    'regex'    => '/^(621660|621661|621662|621663|621665|621667|621668|621669|621666|456351|601382|621256|621212|621283|620061|621725|621330|621331|621332|621333|621297|621568|621569|621672|623208|621620|621756|621757|621758|621759|621785|621786|621787|621788|621789|621790|622273|622274|622771|622772|622770|621741|621041)\d{13}$/',
106
                    'cardType' => 'DC',
107
                ],
108
                [
109
                    'regex'    => '/^(621293|621294|621342|621343|621364|621394|621648|621248|621215|621249|621231|621638|621334|621395|623040|622348)\d{10}$/',
110
                    'cardType' => 'DC',
111
                ],
112
                [
113
                    'regex'    => '/^(625908|625910|625909|356833|356835|409665|409666|409668|409669|409670|409671|409672|512315|512316|512411|512412|514957|409667|438088|552742|553131|514958|622760|628388|518377|622788|628313|628312|622750|622751|625145|622479|622480|622789|625140|622346|622347)\d{10}$/',
114
                    'cardType' => 'CC',
115
                ],
116
                [
117
                    'regex'    => '/^(518378|518379|518474|518475|518476|524865|525745|525746|547766|558868|622752|622753|622755|524864|622757|622758|622759|622761|622762|622763|622756|622754|622764|622765|558869|625905|625906|625907|625333)\d{10}$/',
118
                    'cardType' => 'SCC',
119
                ],
120
                [
121
                    'regex'    => '/^(53591|49102|377677)\d{11}$/',
122
                    'cardType' => 'SCC',
123
                ],
124
                [
125
                    'regex'    => '/^(620514|620025|620026|620210|620211|620019|620035|620202|620203|620048|620515|920000)\d{10}$/',
126
                    'cardType' => 'PC',
127
                ],
128
                [
129
                    'regex'    => '/^(620040|620531|620513|921000|620038)\d{13}$/',
130
                    'cardType' => 'PC',
131
                ],
132
            ],
133
        ],
134
        [
135
            'bankCode' => 'CCB',
136
            'patterns' => [
137
                [
138
                    'regex'    => '/^(621284|436742|589970|620060|621081|621467|621598|621621|621700|622280|622700|623211|623668)\d{13}$/',
139
                    'cardType' => 'DC',
140
                ],
141
                [
142
                    'regex'    => '/^(421349|434061|434062|524094|526410|552245|621080|621082|621466|621488|621499|622966|622988|622382|621487|621083|621084|620107)\d{10}$/',
143
                    'cardType' => 'DC',
144
                ],
145
                [
146
                    'regex'    => '/^(436742193|622280193)\d{10}$/',
147
                    'cardType' => 'DC',
148
                ],
149
                [
150
                    'regex'    => '/^(553242)\d{12}$/',
151
                    'cardType' => 'CC',
152
                ],
153
                [
154
                    'regex'    => '/^(625362|625363|628316|628317|356896|356899|356895|436718|436738|436745|436748|489592|531693|532450|532458|544887|552801|557080|558895|559051|622166|622168|622708|625964|625965|625966|628266|628366|622381|622675|622676|622677)\d{10}$/',
155
                    'cardType' => 'CC',
156
                ],
157
                [
158
                    'regex'    => '/^(5453242|5491031|5544033)\d{11}$/',
159
                    'cardType' => 'CC',
160
                ],
161
                [
162
                    'regex'    => '/^(622725|622728|436728|453242|491031|544033|622707|625955|625956)\d{10}$/',
163
                    'cardType' => 'SCC',
164
                ],
165
                [
166
                    'regex'    => '/^(53242|53243)\d{11}$/',
167
                    'cardType' => 'SCC',
168
                ],
169
            ],
170
        ],
171
        [
172
            'bankCode' => 'COMM',
173
            'patterns' => [
174
                [
175
                    'regex'    => '/^(622261|622260|622262|621002|621069|621436|621335)\d{13}$/',
176
                    'cardType' => 'DC',
177
                ],
178
                [
179
                    'regex'    => '/^(620013)\d{10}$/',
180
                    'cardType' => 'DC',
181
                ],
182
                [
183
                    'regex'    => '/^(405512|601428|405512|601428|622258|622259|405512|601428)\d{11}$/',
184
                    'cardType' => 'DC',
185
                ],
186
                [
187
                    'regex'    => '/^(49104|53783)\d{11}$/',
188
                    'cardType' => 'CC',
189
                ],
190
                [
191
                    'regex'    => '/^(434910|458123|458124|520169|522964|552853|622250|622251|521899|622253|622656|628216|622252|955590|955591|955592|955593|628218|625028|625029)\d{10}$/',
192
                    'cardType' => 'CC',
193
                ],
194
                [
195
                    'regex'    => '/^(622254|622255|622256|622257|622284)\d{10}$/',
196
                    'cardType' => 'SCC',
197
                ],
198
                [
199
                    'regex'    => '/^(620021|620521)\d{13}$/',
200
                    'cardType' => 'PC',
201
                ],
202
            ],
203
        ],
204
        [
205
            'bankCode' => 'CMB',
206
            'patterns' => [
207
                [
208
                    'regex'    => '/^(402658|410062|468203|512425|524011|622580|622588|622598|622609|95555|621286|621483|621485|621486|621299)\d{10}$/',
209
                    'cardType' => 'DC',
210
                ],
211
                [
212
                    'regex'    => '/^(690755)\d{9}$/',
213
                    'cardType' => 'DC',
214
                ],
215
                [
216
                    'regex'    => '/^(690755)\d{12}$/',
217
                    'cardType' => 'DC',
218
                ],
219
                [
220
                    'regex'    => '/^(356885|356886|356887|356888|356890|439188|439227|479228|479229|521302|356889|545620|545621|545947|545948|552534|552587|622575|622576|622577|622578|622579|545619|622581|622582|545623|628290|439225|518710|518718|628362|439226|628262|625802|625803)\d{10}$/',
221
                    'cardType' => 'CC',
222
                ],
223
                [
224
                    'regex'    => '/^(370285|370286|370287|370289)\d{9}$/',
225
                    'cardType' => 'CC',
226
                ],
227
                [
228
                    'regex'    => '/^(620520)\d{13}$/',
229
                    'cardType' => 'PC',
230
                ],
231
            ],
232
        ],
233
        [
234
            'bankCode' => 'CMBC',
235
            'patterns' => [
236
                [
237
                    'regex'    => '/^(622615|622616|622618|622622|622617|622619|415599|421393|421865|427570|427571|472067|472068|622620)\d{10}$/',
238
                    'cardType' => 'DC',
239
                ],
240
                [
241
                    'regex'    => '/^(545392|545393|545431|545447|356859|356857|407405|421869|421870|421871|512466|356856|528948|552288|622600|622601|622602|517636|622621|628258|556610|622603|464580|464581|523952|545217|553161|356858|622623|625912|625913|625911)\d{10}$/',
242
                    'cardType' => 'CC',
243
                ],
244
                [
245
                    'regex'    => '/^(377155|377152|377153|377158)\d{9}$/',
246
                    'cardType' => 'CC',
247
                ],
248
            ],
249
        ],
250
        [
251
            'bankCode' => 'CEB',
252
            'patterns' => [
253
                [
254
                    'regex'    => '/^(303)\d{13}$/',
255
                    'cardType' => 'DC',
256
                ],
257
                [
258
                    'regex'    => '/^(90030)\d{11}$/',
259
                    'cardType' => 'DC',
260
                ],
261
                [
262
                    'regex'    => '/^(620535)\d{13}$/',
263
                    'cardType' => 'DC',
264
                ],
265
                [
266
                    'regex'    => '/^(620085|622660|622662|622663|622664|622665|622666|622667|622669|622670|622671|622672|622668|622661|622674|622673|620518|621489|621492)\d{10}$/',
267
                    'cardType' => 'DC',
268
                ],
269
                [
270
                    'regex'    => '/^(356837|356838|486497|622657|622685|622659|622687|625978|625980|625981|625979|356839|356840|406252|406254|425862|481699|524090|543159|622161|622570|622650|622655|622658|625975|625977|628201|628202|625339|625976)\d{10}$/',
271
                    'cardType' => 'CC',
272
                ],
273
            ],
274
        ],
275
        [
276
            'bankCode' => 'CITIC',
277
            'patterns' => [
278
                [
279
                    'regex'    => '/^(433670|433680|442729|442730|620082|622690|622691|622692|622696|622698|622998|622999|433671|968807|968808|968809|621771|621767|621768|621770|621772|621773|622453|622456)\d{10}$/',
280
                    'cardType' => 'DC',
281
                ],
282
                [
283
                    'regex'    => '/^(622459)\d{11}$/',
284
                    'cardType' => 'DC',
285
                ],
286
                [
287
                    'regex'    => '/^(376968|376969|376966)\d{9}$/',
288
                    'cardType' => 'CC',
289
                ],
290
                [
291
                    'regex'    => '/^(400360|403391|403392|404158|404159|404171|404172|404173|404174|404157|433667|433668|433669|514906|403393|520108|433666|558916|622678|622679|622680|622688|622689|628206|556617|628209|518212|628208|356390|356391|356392|622916|622918|622919)\d{10}$/',
292
                    'cardType' => 'CC',
293
                ],
294
            ],
295
        ],
296
        [
297
            'bankCode' => 'HXBANK',
298
            'patterns' => [
299
                [
300
                    'regex'    => '/^(622630|622631|622632|622633|999999|621222|623020|623021|623022|623023)\d{10}$/',
301
                    'cardType' => 'DC',
302
                ],
303
                [
304
                    'regex'    => '/^(523959|528709|539867|539868|622637|622638|628318|528708|622636|625967|625968|625969)\d{10}$/',
305
                    'cardType' => 'CC',
306
                ],
307
            ],
308
        ],
309
        [
310
            'bankCode' => 'SPABANK',
311
            'patterns' => [
312
                [
313
                    'regex'    => '/^(621626|623058)\d{13}$/',
314
                    'cardType' => 'DC',
315
                ],
316
                [
317
                    'regex'    => '/^(602907|622986|622989|622298|627069|627068|627066|627067|412963|415752|415753|622535|622536|622538|622539|998800|412962|622983)\d{10}$/',
318
                    'cardType' => 'DC',
319
                ],
320
                [
321
                    'regex'    => '/^(531659|622157|528020|622155|622156|526855|356869|356868|625360|625361|628296|435744|435745|483536|622525|622526|998801|998802)\d{10}$/',
322
                    'cardType' => 'CC',
323
                ],
324
                [
325
                    'regex'    => '/^(620010)\d{10}$/',
326
                    'cardType' => 'PC',
327
                ],
328
            ],
329
        ],
330
        [
331
            'bankCode' => 'CIB',
332
            'patterns' => [
333
                [
334
                    'regex'    => '/^(438589)\d{12}$/',
335
                    'cardType' => 'DC',
336
                ],
337
                [
338
                    'regex'    => '/^(90592)\d{11}$/',
339
                    'cardType' => 'DC',
340
                ],
341
                [
342
                    'regex'    => '/^(966666|622909|438588|622908)\d{12}$/',
343
                    'cardType' => 'DC',
344
                ],
345
                [
346
                    'regex'    => '/^(461982|486493|486494|486861|523036|451289|527414|528057|622901|622902|622922|628212|451290|524070|625084|625085|625086|625087|548738|549633|552398|625082|625083|625960|625961|625962|625963)\d{10}$/',
347
                    'cardType' => 'CC',
348
                ],
349
                [
350
                    'regex'    => '/^(620010)\d{10}$/',
351
                    'cardType' => 'PC',
352
                ],
353
            ],
354
        ],
355
        [
356
            'bankCode' => 'SHBANK',
357
            'patterns' => [
358
                [
359
                    'regex'    => '/^(621050|622172|622985|622987|620522|622267|622278|622279|622468|622892|940021)\d{12}$/',
360
                    'cardType' => 'DC',
361
                ],
362
                [
363
                    'regex'    => '/^(438600)\d{10}$/',
364
                    'cardType' => 'DC',
365
                ],
366
                [
367
                    'regex'    => '/^(356827|356828|356830|402673|402674|486466|519498|520131|524031|548838|622148|622149|622268|356829|622300|628230|622269|625099|625953)\d{10}$/',
368
                    'cardType' => 'CC',
369
                ],
370
            ],
371
        ],
372
        [
373
            'bankCode' => 'SPDB',
374
            'patterns' => [
375
                [
376
                    'regex'    => '/^(622516|622517|622518|622521|622522|622523|984301|984303|621352|621793|621795|621796|621351|621390|621792|621791)\d{10}$/',
377
                    'cardType' => 'DC',
378
                ],
379
                [
380
                    'regex'    => '/^(84301|84336|84373|84385|84390|87000|87010|87030|87040|84380|84361|87050|84342)\d{11}$/',
381
                    'cardType' => 'DC',
382
                ],
383
                [
384
                    'regex'    => '/^(356851|356852|404738|404739|456418|498451|515672|356850|517650|525998|622177|622277|628222|622500|628221|622176|622276|622228|625957|625958|625993|625831)\d{10}$/',
385
                    'cardType' => 'CC',
386
                ],
387
                [
388
                    'regex'    => '/^(622520|622519)\d{10}$/',
389
                    'cardType' => 'SCC',
390
                ],
391
                [
392
                    'regex'    => '/^(620530)\d{13}$/',
393
                    'cardType' => 'PC',
394
                ],
395
            ],
396
        ],
397
        [
398
            'bankCode' => 'GDB',
399
            'patterns' => [
400
                [
401
                    'regex'    => '/^(622516|622517|622518|622521|622522|622523|984301|984303|621352|621793|621795|621796|621351|621390|621792|621791)\d{10}$/',
402
                    'cardType' => 'DC',
403
                ],
404
                [
405
                    'regex'    => '/^(622568|6858001|6858009|621462)\d{13}$/',
406
                    'cardType' => 'DC',
407
                ],
408
                [
409
                    'regex'    => '/^(9111)\d{15}$/',
410
                    'cardType' => 'DC',
411
                ],
412
                [
413
                    'regex'    => '/^(406365|406366|428911|436768|436769|436770|487013|491032|491033|491034|491035|491036|491037|491038|436771|518364|520152|520382|541709|541710|548844|552794|493427|622555|622556|622557|622558|622559|622560|528931|558894|625072|625071|628260|628259|625805|625806|625807|625808|625809|625810)\d{10}$/',
414
                    'cardType' => 'CC',
415
                ],
416
                [
417
                    'regex'    => '/^(685800|6858000)\d{13}$/',
418
                    'cardType' => 'CC',
419
                ],
420
            ],
421
        ],
422
        [
423
            'bankCode' => 'BOHAIB',
424
            'patterns' => [
425
                [
426
                    'regex'    => '/^(621268|622684|622884|621453)\d{10}$/',
427
                    'cardType' => 'DC',
428
                ],
429
            ],
430
        ],
431
        [
432
            'bankCode' => 'GCB',
433
            'patterns' => [
434
                [
435
                    'regex'    => '/^(603445|622467|940016|621463)\d{13}$/',
436
                    'cardType' => 'DC',
437
                ],
438
            ],
439
        ],
440
        [
441
            'bankCode' => 'JHBANK',
442
            'patterns' => [
443
                [
444
                    'regex'    => '/^(622449|940051)\d{10}$/',
445
                    'cardType' => 'DC',
446
                ],
447
                [
448
                    'regex'    => '/^(622450|628204)\d{10}$/',
449
                    'cardType' => 'CC',
450
                ],
451
            ],
452
        ],
453
        [
454
            'bankCode' => 'WZCB',
455
            'patterns' => [
456
                [
457
                    'regex'    => '/^(621977)\d{10}$/',
458
                    'cardType' => 'DC',
459
                ],
460
                [
461
                    'regex'    => '/^(622868|622899|628255)\d{10}$/',
462
                    'cardType' => 'CC',
463
                ],
464
            ],
465
        ],
466
        [
467
            'bankCode' => 'HSBANK',
468
            'patterns' => [
469
                [
470
                    'regex'    => '/^(622877|622879|621775|623203)\d{13}$/',
471
                    'cardType' => 'DC',
472
                ],
473
                [
474
                    'regex'    => '/^(603601|622137|622327|622340|622366)\d{11}$/',
475
                    'cardType' => 'DC',
476
                ],
477
                [
478
                    'regex'    => '/^(628251|622651|625828)\d{10}$/',
479
                    'cardType' => 'CC',
480
                ],
481
            ],
482
        ],
483
        [
484
            'bankCode' => 'JSBANK',
485
            'patterns' => [
486
                [
487
                    'regex'    => '/^(621076|622173|622131|621579|622876)\d{13}$/',
488
                    'cardType' => 'DC',
489
                ],
490
                [
491
                    'regex'    => '/^(504923|622422|622447|940076)\d{10}$/',
492
                    'cardType' => 'DC',
493
                ],
494
                [
495
                    'regex'    => '/^(628210|622283|625902)\d{10}$/',
496
                    'cardType' => 'CC',
497
                ],
498
            ],
499
        ],
500
        [
501
            'bankCode' => 'NJCB',
502
            'patterns' => [
503
                [
504
                    'regex'    => '/^(621777|622305|621259)\d{10}$/',
505
                    'cardType' => 'DC',
506
                ],
507
                [
508
                    'regex'    => '/^(622303|628242|622595|622596)\d{10}$/',
509
                    'cardType' => 'CC',
510
                ],
511
            ],
512
        ],
513
        [
514
            'bankCode' => 'NBBANK',
515
            'patterns' => [
516
                [
517
                    'regex'    => '/^(621279|622281|622316|940022)\d{10}$/',
518
                    'cardType' => 'DC',
519
                ],
520
                [
521
                    'regex'    => '/^(621418)\d{13}$/',
522
                    'cardType' => 'DC',
523
                ],
524
                [
525
                    'regex'    => '/^(625903|622778|628207|512431|520194|622282|622318)\d{10}$/',
526
                    'cardType' => 'CC',
527
                ],
528
            ],
529
        ],
530
        [
531
            'bankCode' => 'BJBANK',
532
            'patterns' => [
533
                [
534
                    'regex'    => '/^(623111|421317|422161|602969|422160|621030|621420|621468)\d{10}$/',
535
                    'cardType' => 'DC',
536
                ],
537
                [
538
                    'regex'    => '/^(522001|622163|622853|628203|622851|622852)\d{10}$/',
539
                    'cardType' => 'CC',
540
                ],
541
            ],
542
        ],
543
        [
544
            'bankCode' => 'BJRCB',
545
            'patterns' => [
546
                [
547
                    'regex'    => '/^(620088|621068|622138|621066|621560)\d{13}$/',
548
                    'cardType' => 'DC',
549
                ],
550
                [
551
                    'regex'    => '/^(625526|625186|628336)\d{10}$/',
552
                    'cardType' => 'CC',
553
                ],
554
            ],
555
        ],
556
        [
557
            'bankCode' => 'HSBC',
558
            'patterns' => [
559
                [
560
                    'regex'    => '/^(622946)\d{10}$/',
561
                    'cardType' => 'DC',
562
                ],
563
                [
564
                    'regex'    => '/^(622406|621442)\d{11}$/',
565
                    'cardType' => 'DC',
566
                ],
567
                [
568
                    'regex'    => '/^(622407|621443)\d{13}$/',
569
                    'cardType' => 'DC',
570
                ],
571
                [
572
                    'regex'    => '/^(622360|622361|625034|625096|625098)\d{10}$/',
573
                    'cardType' => 'CC',
574
                ],
575
            ],
576
        ],
577
        [
578
            'bankCode' => 'SCB',
579
            'patterns' => [
580
                [
581
                    'regex'    => '/^(622948|621740|622942|622994)\d{10}$/',
582
                    'cardType' => 'DC',
583
                ],
584
                [
585
                    'regex'    => '/^(622482|622483|622484)\d{10}$/',
586
                    'cardType' => 'CC',
587
                ],
588
            ],
589
        ],
590
        [
591
            'bankCode' => 'CITI',
592
            'patterns' => [
593
                [
594
                    'regex'    => '/^(621062|621063)\d{10}$/',
595
                    'cardType' => 'DC',
596
                ],
597
                [
598
                    'regex'    => '/^(625076|625077|625074|625075|622371|625091)\d{10}$/',
599
                    'cardType' => 'CC',
600
                ],
601
            ],
602
        ],
603
        [
604
            'bankCode' => 'HKBEA',
605
            'patterns' => [
606
                [
607
                    'regex'    => '/^(622933|622938|623031|622943|621411)\d{13}$/',
608
                    'cardType' => 'DC',
609
                ],
610
                [
611
                    'regex'    => '/^(622372|622471|622472|622265|622266|625972|625973)\d{10}$/',
612
                    'cardType' => 'CC',
613
                ],
614
                [
615
                    'regex'    => '/^(622365)\d{11}$/',
616
                    'cardType' => 'CC',
617
                ],
618
            ],
619
        ],
620
        [
621
            'bankCode' => 'GHB',
622
            'patterns' => [
623
                [
624
                    'regex'    => '/^(621469|621625)\d{13}$/',
625
                    'cardType' => 'DC',
626
                ],
627
            ],
628
        ],
629
        [
630
            'bankCode' => 'SRCB',
631
            'patterns' => [
632
                [
633
                    'regex'    => '/^(622128|622129|623035)\d{10}$/',
634
                    'cardType' => 'DC',
635
                ],
636
            ],
637
        ],
638
        [
639
            'bankCode' => 'GZRCU',
640
            'patterns' => [
641
                [
642
                    'regex'    => '/^(909810|940035|621522|622439)\d{12}$/',
643
                    'cardType' => 'DC',
644
                ],
645
            ],
646
        ],
647
        [
648
            'bankCode' => 'DRCBCL',
649
            'patterns' => [
650
                [
651
                    'regex'    => '/^(622328|940062|623038)\d{13}$/',
652
                    'cardType' => 'DC',
653
                ],
654
                [
655
                    'regex'    => '/^(625288|625888)\d{10}$/',
656
                    'cardType' => 'CC',
657
                ],
658
            ],
659
        ],
660
        [
661
            'bankCode' => 'BOD',
662
            'patterns' => [
663
                [
664
                    'regex'    => '/^(622333|940050)\d{10}$/',
665
                    'cardType' => 'DC',
666
                ],
667
                [
668
                    'regex'    => '/^(621439|623010)\d{13}$/',
669
                    'cardType' => 'DC',
670
                ],
671
                [
672
                    'regex'    => '/^(622888)\d{10}$/',
673
                    'cardType' => 'CC',
674
                ],
675
            ],
676
        ],
677
        [
678
            'bankCode' => 'GDRCC',
679
            'patterns' => [
680
                [
681
                    'regex'    => '/^(622302)\d{10}$/',
682
                    'cardType' => 'DC',
683
                ],
684
                [
685
                    'regex'    => '/^(622477|622509|622510|622362|621018|621518)\d{13}$/',
686
                    'cardType' => 'DC',
687
                ],
688
            ],
689
        ],
690
        [
691
            'bankCode' => 'DSB',
692
            'patterns' => [
693
                [
694
                    'regex'    => '/^(622297|621277)\d{10}$/',
695
                    'cardType' => 'DC',
696
                ],
697
                [
698
                    'regex'    => '/^(622375|622489)\d{11}$/',
699
                    'cardType' => 'DC',
700
                ],
701
                [
702
                    'regex'    => '/^(622293|622295|622296|622373|622451|622294|625940)\d{10}$/',
703
                    'cardType' => 'CC',
704
                ],
705
            ],
706
        ],
707
        [
708
            'bankCode' => 'WHB',
709
            'patterns' => [
710
                [
711
                    'regex'    => '/^(622871|622958|622963|622957|622861|622932|622862|621298)\d{10}$/',
712
                    'cardType' => 'DC',
713
                ],
714
                [
715
                    'regex'    => '/^(622798|625010|622775|622785)\d{10}$/',
716
                    'cardType' => 'CC',
717
                ],
718
            ],
719
        ],
720
        [
721
            'bankCode' => 'DBS',
722
            'patterns' => [
723
                [
724
                    'regex'    => '/^(621016|621015)\d{13}$/',
725
                    'cardType' => 'DC',
726
                ],
727
                [
728
                    'regex'    => '/^(622487|622490|622491|622492)\d{10}$/',
729
                    'cardType' => 'DC',
730
                ],
731
                [
732
                    'regex'    => '/^(622487|622490|622491|622492|621744|621745|621746|621747)\d{11}$/',
733
                    'cardType' => 'DC',
734
                ],
735
            ],
736
        ],
737
        [
738
            'bankCode' => 'EGBANK',
739
            'patterns' => [
740
                [
741
                    'regex'    => '/^(623078)\d{13}$/',
742
                    'cardType' => 'DC',
743
                ],
744
                [
745
                    'regex'    => '/^(622384|940034)\d{11}$/',
746
                    'cardType' => 'DC',
747
                ],
748
            ],
749
        ],
750
        [
751
            'bankCode' => 'TCCB',
752
            'patterns' => [
753
                [
754
                    'regex'    => '/^(940015|622331)\d{12}$/',
755
                    'cardType' => 'DC',
756
                ],
757
                [
758
                    'regex'    => '/^(6091201)\d{11}$/',
759
                    'cardType' => 'DC',
760
                ],
761
                [
762
                    'regex'    => '/^(622426|628205)\d{10}$/',
763
                    'cardType' => 'CC',
764
                ],
765
            ],
766
        ],
767
        [
768
            'bankCode' => 'CZBANK',
769
            'patterns' => [
770
                [
771
                    'regex'    => '/^(621019|622309|621019)\d{13}$/',
772
                    'cardType' => 'DC',
773
                ],
774
                [
775
                    'regex'    => '/^(6223091100|6223092900|6223093310|6223093320|6223093330|6223093370|6223093380|6223096510|6223097910)\d{9}$/',
776
                    'cardType' => 'DC',
777
                ],
778
            ],
779
        ],
780
        [
781
            'bankCode' => 'NCB',
782
            'patterns' => [
783
                [
784
                    'regex'    => '/^(621213|621289|621290|621291|621292|621042|621743)\d{13}$/',
785
                    'cardType' => 'DC',
786
                ],
787
                [
788
                    'regex'    => '/^(623041|622351)\d{10}$/',
789
                    'cardType' => 'DC',
790
                ],
791
                [
792
                    'regex'    => '/^(625046|625044|625058|622349|622350)\d{10}$/',
793
                    'cardType' => 'CC',
794
                ],
795
                [
796
                    'regex'    => '/^(620208|620209|625093|625095)\d{10}$/',
797
                    'cardType' => 'PC',
798
                ],
799
            ],
800
        ],
801
        [
802
            'bankCode' => 'XMBANK',
803
            'patterns' => [
804
                [
805
                    'regex'    => '/^(622393|940023)\d{10}$/',
806
                    'cardType' => 'DC',
807
                ],
808
                [
809
                    'regex'    => '/^(6886592)\d{11}$/',
810
                    'cardType' => 'DC',
811
                ],
812
                [
813
                    'regex'    => '/^(623019|621600|)\d{13}$/',
814
                    'cardType' => 'DC',
815
                ],
816
            ],
817
        ],
818
        [
819
            'bankCode' => 'FJHXBC',
820
            'patterns' => [
821
                [
822
                    'regex'    => '/^(622388)\d{10}$/',
823
                    'cardType' => 'DC',
824
                ],
825
                [
826
                    'regex'    => '/^(621267|623063)\d{12}$/',
827
                    'cardType' => 'DC',
828
                ],
829
                [
830
                    'regex'    => '/^(620043|)\d{12}$/',
831
                    'cardType' => 'PC',
832
                ],
833
            ],
834
        ],
835
        [
836
            'bankCode' => 'JLBANK',
837
            'patterns' => [
838
                [
839
                    'regex'    => '/^(622865|623131)\d{13}$/',
840
                    'cardType' => 'DC',
841
                ],
842
                [
843
                    'regex'    => '/^(940012)\d{10}$/',
844
                    'cardType' => 'DC',
845
                ],
846
                [
847
                    'regex'    => '/^(622178|622179|628358)\d{10}$/',
848
                    'cardType' => 'CC',
849
                ],
850
            ],
851
        ],
852
        [
853
            'bankCode' => 'HKB',
854
            'patterns' => [
855
                [
856
                    'regex'    => '/^(990027)\d{12}$/',
857
                    'cardType' => 'DC',
858
                ],
859
                [
860
                    'regex'    => '/^(622325|623105|623029)\d{10}$/',
861
                    'cardType' => 'DC',
862
                ],
863
            ],
864
        ],
865
        [
866
            'bankCode' => 'SJBANK',
867
            'patterns' => [
868
                [
869
                    'regex'    => '/^(566666)\d{12}$/',
870
                    'cardType' => 'DC',
871
                ],
872
                [
873
                    'regex'    => '/^(622455|940039)\d{13}$/',
874
                    'cardType' => 'DC',
875
                ],
876
                [
877
                    'regex'    => '/^(623108|623081)\d{10}$/',
878
                    'cardType' => 'DC',
879
                ],
880
                [
881
                    'regex'    => '/^(622466|628285)\d{10}$/',
882
                    'cardType' => 'CC',
883
                ],
884
            ],
885
        ],
886
        [
887
            'bankCode' => 'DLB',
888
            'patterns' => [
889
                [
890
                    'regex'    => '/^(603708)\d{11}$/',
891
                    'cardType' => 'DC',
892
                ],
893
                [
894
                    'regex'    => '/^(622993|623069|623070|623172|623173)\d{13}$/',
895
                    'cardType' => 'DC',
896
                ],
897
                [
898
                    'regex'    => '/^(622383|622385|628299)\d{10}$/',
899
                    'cardType' => 'CC',
900
                ],
901
            ],
902
        ],
903
        [
904
            'bankCode' => 'BHB',
905
            'patterns' => [
906
                [
907
                    'regex'    => '/^(622498|622499|623000|940046)\d{13}$/',
908
                    'cardType' => 'DC',
909
                ],
910
                [
911
                    'regex'    => '/^(622921|628321)\d{10}$/',
912
                    'cardType' => 'CC',
913
                ],
914
            ],
915
        ],
916
        [
917
            'bankCode' => 'URMQCCB',
918
            'patterns' => [
919
                [
920
                    'regex'    => '/^(621751|622143|940001|621754)\d{13}$/',
921
                    'cardType' => 'DC',
922
                ],
923
                [
924
                    'regex'    => '/^(622476|628278)\d{10}$/',
925
                    'cardType' => 'CC',
926
                ],
927
            ],
928
        ],
929
        [
930
            'bankCode' => 'SXCB',
931
            'patterns' => [
932
                [
933
                    'regex'    => '/^(622486)\d{10}$/',
934
                    'cardType' => 'DC',
935
                ],
936
                [
937
                    'regex'    => '/^(603602|623026|623086)\d{12}$/',
938
                    'cardType' => 'DC',
939
                ],
940
                [
941
                    'regex'    => '/^(628291)\d{10}$/',
942
                    'cardType' => 'CC',
943
                ],
944
            ],
945
        ],
946
        [
947
            'bankCode' => 'CDCB',
948
            'patterns' => [
949
                [
950
                    'regex'    => '/^(622152|622154|622996|622997|940027|622153|622135|621482|621532)\d{13}$/',
951
                    'cardType' => 'DC',
952
                ],
953
            ],
954
        ],
955
        [
956
            'bankCode' => 'FSCB',
957
            'patterns' => [
958
                [
959
                    'regex'    => '/^(622442)\d{11}$/',
960
                    'cardType' => 'DC',
961
                ],
962
                [
963
                    'regex'    => '/^(940053)\d{12}$/',
964
                    'cardType' => 'DC',
965
                ],
966
                [
967
                    'regex'    => '/^(622442|623099)\d{13}$/',
968
                    'cardType' => 'DC',
969
                ],
970
            ],
971
        ],
972
        [
973
            'bankCode' => 'ZZBANK',
974
            'patterns' => [
975
                [
976
                    'regex'    => '/^(622421)\d{13}$/',
977
                    'cardType' => 'DC',
978
                ],
979
                [
980
                    'regex'    => '/^(940056)\d{11}$/',
981
                    'cardType' => 'DC',
982
                ],
983
                [
984
                    'regex'    => '/^(96828)\d{11}$/',
985
                    'cardType' => 'DC',
986
                ],
987
            ],
988
        ],
989
        [
990
            'bankCode' => 'NXBANK',
991
            'patterns' => [
992
                [
993
                    'regex'    => '/^(621529|622429|621417|623089|623200)\d{13}$/',
994
                    'cardType' => 'DC',
995
                ],
996
                [
997
                    'regex'    => '/^(628214|625529|622428)\d{10}$/',
998
                    'cardType' => 'CC',
999
                ],
1000
            ],
1001
        ],
1002
        [
1003
            'bankCode' => 'CQBANK',
1004
            'patterns' => [
1005
                [
1006
                    'regex'    => '/^(9896)\d{12}$/',
1007
                    'cardType' => 'DC',
1008
                ],
1009
                [
1010
                    'regex'    => '/^(622134|940018|623016)\d{10}$/',
1011
                    'cardType' => 'DC',
1012
                ],
1013
            ],
1014
        ],
1015
        [
1016
            'bankCode' => 'HRBANK',
1017
            'patterns' => [
1018
                [
1019
                    'regex'    => '/^(621577|622425)\d{13}$/',
1020
                    'cardType' => 'DC',
1021
                ],
1022
                [
1023
                    'regex'    => '/^(940049)\d{12}$/',
1024
                    'cardType' => 'DC',
1025
                ],
1026
                [
1027
                    'regex'    => '/^(622425)\d{11}$/',
1028
                    'cardType' => 'DC',
1029
                ],
1030
            ],
1031
        ],
1032
        [
1033
            'bankCode' => 'LZYH',
1034
            'patterns' => [
1035
                [
1036
                    'regex'    => '/^(622139|940040|628263)\d{10}$/',
1037
                    'cardType' => 'DC',
1038
                ],
1039
                [
1040
                    'regex'    => '/^(621242|621538|621496)\d{13}$/',
1041
                    'cardType' => 'DC',
1042
                ],
1043
            ],
1044
        ],
1045
        [
1046
            'bankCode' => 'QDCCB',
1047
            'patterns' => [
1048
                [
1049
                    'regex'    => '/^(621252|622146|940061|628239)\d{10}$/',
1050
                    'cardType' => 'DC',
1051
                ],
1052
                [
1053
                    'regex'    => '/^(621419|623170)\d{13}$/',
1054
                    'cardType' => 'DC',
1055
                ],
1056
            ],
1057
        ],
1058
        [
1059
            'bankCode' => 'QHDCCB',
1060
            'patterns' => [
1061
                [
1062
                    'regex'    => '/^(62249802|94004602)\d{11}$/',
1063
                    'cardType' => 'DC',
1064
                ],
1065
                [
1066
                    'regex'    => '/^(621237|623003)\d{13}$/',
1067
                    'cardType' => 'DC',
1068
                ],
1069
            ],
1070
        ],
1071
        [
1072
            'bankCode' => 'BOQH',
1073
            'patterns' => [
1074
                [
1075
                    'regex'    => '/^(622310|940068)\d{11}$/',
1076
                    'cardType' => 'DC',
1077
                ],
1078
                [
1079
                    'regex'    => '/^(622817|628287|625959)\d{10}$/',
1080
                    'cardType' => 'CC',
1081
                ],
1082
                [
1083
                    'regex'    => '/^(62536601)\d{8}$/',
1084
                    'cardType' => 'CC',
1085
                ],
1086
            ],
1087
        ],
1088
        [
1089
            'bankCode' => 'TZCB',
1090
            'patterns' => [
1091
                [
1092
                    'regex'    => '/^(622427)\d{10}$/',
1093
                    'cardType' => 'DC',
1094
                ],
1095
                [
1096
                    'regex'    => '/^(940069)\d{11}$/',
1097
                    'cardType' => 'DC',
1098
                ],
1099
                [
1100
                    'regex'    => '/^(623039)\d{13}$/',
1101
                    'cardType' => 'DC',
1102
                ],
1103
                [
1104
                    'regex'    => '/^(622321|628273)\d{10}$/',
1105
                    'cardType' => 'CC',
1106
                ],
1107
                [
1108
                    'regex'    => '/^(625001)\d{10}$/',
1109
                    'cardType' => 'SCC',
1110
                ],
1111
            ],
1112
        ],
1113
        [
1114
            'bankCode' => 'CSCB',
1115
            'patterns' => [
1116
                [
1117
                    'regex'    => '/^(694301)\d{12}$/',
1118
                    'cardType' => 'DC',
1119
                ],
1120
                [
1121
                    'regex'    => '/^(940071|622368|621446)\d{13}$/',
1122
                    'cardType' => 'DC',
1123
                ],
1124
                [
1125
                    'regex'    => '/^(625901|622898|622900|628281|628282|622806|628283)\d{10}$/',
1126
                    'cardType' => 'CC',
1127
                ],
1128
                [
1129
                    'regex'    => '/^(620519)\d{13}$/',
1130
                    'cardType' => 'PC',
1131
                ],
1132
            ],
1133
        ],
1134
        [
1135
            'bankCode' => 'BOQZ',
1136
            'patterns' => [
1137
                [
1138
                    'regex'    => '/^(683970|940074)\d{12}$/',
1139
                    'cardType' => 'DC',
1140
                ],
1141
                [
1142
                    'regex'    => '/^(622370)\d{13}$/',
1143
                    'cardType' => 'DC',
1144
                ],
1145
                [
1146
                    'regex'    => '/^(621437)\d{13}$/',
1147
                    'cardType' => 'DC',
1148
                ],
1149
                [
1150
                    'regex'    => '/^(628319)\d{10}$/',
1151
                    'cardType' => 'CC',
1152
                ],
1153
            ],
1154
        ],
1155
        [
1156
            'bankCode' => 'BSB',
1157
            'patterns' => [
1158
                [
1159
                    'regex'    => '/^(622336|621760)\d{11}$/',
1160
                    'cardType' => 'DC',
1161
                ],
1162
                [
1163
                    'regex'    => '/^(622165)\d{10}$/',
1164
                    'cardType' => 'DC',
1165
                ],
1166
                [
1167
                    'regex'    => '/^(622315|625950|628295)\d{10}$/',
1168
                    'cardType' => 'CC',
1169
                ],
1170
            ],
1171
        ],
1172
        [
1173
            'bankCode' => 'DAQINGB',
1174
            'patterns' => [
1175
                [
1176
                    'regex'    => '/^(621037|621097|621588|622977)\d{13}$/',
1177
                    'cardType' => 'DC',
1178
                ],
1179
                [
1180
                    'regex'    => '/^(62321601)\d{11}$/',
1181
                    'cardType' => 'DC',
1182
                ],
1183
                [
1184
                    'regex'    => '/^(622860)\d{10}$/',
1185
                    'cardType' => 'DC',
1186
                ],
1187
                [
1188
                    'regex'    => '/^(622644|628333)\d{10}$/',
1189
                    'cardType' => 'CC',
1190
                ],
1191
            ],
1192
        ],
1193
        [
1194
            'bankCode' => 'SHRCB',
1195
            'patterns' => [
1196
                [
1197
                    'regex'    => '/^(622478|940013|621495)\d{10}$/',
1198
                    'cardType' => 'DC',
1199
                ],
1200
                [
1201
                    'regex'    => '/^(625500)\d{10}$/',
1202
                    'cardType' => 'SCC',
1203
                ],
1204
                [
1205
                    'regex'    => '/^(622611|622722|628211|625989)\d{10}$/',
1206
                    'cardType' => 'CC',
1207
                ],
1208
            ],
1209
        ],
1210
        [
1211
            'bankCode' => 'ZJQL',
1212
            'patterns' => [
1213
                [
1214
                    'regex'    => '/^(622717)\d{10}$/',
1215
                    'cardType' => 'SCC',
1216
                ],
1217
                [
1218
                    'regex'    => '/^(628275|622565|622287)\d{10}$/',
1219
                    'cardType' => 'CC',
1220
                ],
1221
            ],
1222
        ],
1223
        [
1224
            'bankCode' => 'H3CB',
1225
            'patterns' => [
1226
                [
1227
                    'regex'    => '/^(622147|621633)\d{13}$/',
1228
                    'cardType' => 'DC',
1229
                ],
1230
                [
1231
                    'regex'    => '/^(628252)\d{10}$/',
1232
                    'cardType' => 'CC',
1233
                ],
1234
            ],
1235
        ],
1236
        [
1237
            'bankCode' => 'BGB',
1238
            'patterns' => [
1239
                [
1240
                    'regex'    => '/^(623001)\d{10}$/',
1241
                    'cardType' => 'DC',
1242
                ],
1243
                [
1244
                    'regex'    => '/^(628227)\d{10}$/',
1245
                    'cardType' => 'CC',
1246
                ],
1247
            ],
1248
        ],
1249
        [
1250
            'bankCode' => 'GLBANK',
1251
            'patterns' => [
1252
                [
1253
                    'regex'    => '/^(621456)\d{11}$/',
1254
                    'cardType' => 'DC',
1255
                ],
1256
                [
1257
                    'regex'    => '/^(621562)\d{13}$/',
1258
                    'cardType' => 'DC',
1259
                ],
1260
                [
1261
                    'regex'    => '/^(628219)\d{10}$/',
1262
                    'cardType' => 'CC',
1263
                ],
1264
            ],
1265
        ],
1266
        [
1267
            'bankCode' => 'DAQINGB',
1268
            'patterns' => [
1269
                [
1270
                    'regex'    => '/^(621037|621097|621588|622977)\d{13}$/',
1271
                    'cardType' => 'DC',
1272
                ],
1273
                [
1274
                    'regex'    => '/^(62321601)\d{11}$/',
1275
                    'cardType' => 'DC',
1276
                ],
1277
                [
1278
                    'regex'    => '/^(622475|622860)\d{10}$/',
1279
                    'cardType' => 'DC',
1280
                ],
1281
                [
1282
                    'regex'    => '/^(625588)\d{10}$/',
1283
                    'cardType' => 'SCC',
1284
                ],
1285
                [
1286
                    'regex'    => '/^(622270|628368|625090|622644|628333)\d{10}$/',
1287
                    'cardType' => 'CC',
1288
                ],
1289
            ],
1290
        ],
1291
        [
1292
            'bankCode' => 'CDRCB',
1293
            'patterns' => [
1294
                [
1295
                    'regex'    => '/^(623088)\d{13}$/',
1296
                    'cardType' => 'DC',
1297
                ],
1298
                [
1299
                    'regex'    => '/^(622829|628301|622808|628308)\d{10}$/',
1300
                    'cardType' => 'CC',
1301
                ],
1302
            ],
1303
        ],
1304
        [
1305
            'bankCode' => 'FJNX',
1306
            'patterns' => [
1307
                [
1308
                    'regex'    => '/^(622127|622184|621701|621251|621589|623036)\d{13}$/',
1309
                    'cardType' => 'DC',
1310
                ],
1311
                [
1312
                    'regex'    => '/^(628232|622802|622290)\d{10}$/',
1313
                    'cardType' => 'CC',
1314
                ],
1315
            ],
1316
        ],
1317
        [
1318
            'bankCode' => 'TRCB',
1319
            'patterns' => [
1320
                [
1321
                    'regex'    => '/^(622531|622329)\d{13}$/',
1322
                    'cardType' => 'DC',
1323
                ],
1324
                [
1325
                    'regex'    => '/^(622829|628301)\d{10}$/',
1326
                    'cardType' => 'CC',
1327
                ],
1328
            ],
1329
        ],
1330
        [
1331
            'bankCode' => 'JSRCU',
1332
            'patterns' => [
1333
                [
1334
                    'regex'    => '/^(621578|623066|622452|622324)\d{13}$/',
1335
                    'cardType' => 'DC',
1336
                ],
1337
                [
1338
                    'regex'    => '/^(622815|622816|628226)\d{10}$/',
1339
                    'cardType' => 'CC',
1340
                ],
1341
            ],
1342
        ],
1343
        [
1344
            'bankCode' => 'SLH',
1345
            'patterns' => [
1346
                [
1347
                    'regex'    => '/^(622906|628386|625519|625506)\d{10}$/',
1348
                    'cardType' => 'CC',
1349
                ],
1350
            ],
1351
        ],
1352
        [
1353
            'bankCode' => 'JXNCX',
1354
            'patterns' => [
1355
                [
1356
                    'regex'    => '/^(621592)\d{10}$/',
1357
                    'cardType' => 'DC',
1358
                ],
1359
                [
1360
                    'regex'    => '/^(628392)\d{10}$/',
1361
                    'cardType' => 'CC',
1362
                ],
1363
            ],
1364
        ],
1365
        [
1366
            'bankCode' => 'SCBBANK',
1367
            'patterns' => [
1368
                [
1369
                    'regex'    => '/^(621748)\d{13}$/',
1370
                    'cardType' => 'DC',
1371
                ],
1372
                [
1373
                    'regex'    => '/^(628271)\d{10}$/',
1374
                    'cardType' => 'CC',
1375
                ],
1376
            ],
1377
        ],
1378
        [
1379
            'bankCode' => 'HRXJB',
1380
            'patterns' => [
1381
                [
1382
                    'regex'    => '/^(621366|621388)\d{13}$/',
1383
                    'cardType' => 'DC',
1384
                ],
1385
                [
1386
                    'regex'    => '/^(628328)\d{10}$/',
1387
                    'cardType' => 'CC',
1388
                ],
1389
            ],
1390
        ],
1391
        [
1392
            'bankCode' => 'HSBK',
1393
            'patterns' => [
1394
                [
1395
                    'regex'    => '/^(621239|623068)\d{13}$/',
1396
                    'cardType' => 'DC',
1397
                ],
1398
            ],
1399
        ],
1400
        [
1401
            'bankCode' => 'CQNCSYCZ',
1402
            'patterns' => [
1403
                [
1404
                    'regex'    => '/^(621653004)\d{10}$/',
1405
                    'cardType' => 'DC',
1406
                ],
1407
            ],
1408
        ],
1409
        [
1410
            'bankCode' => 'HNRCC',
1411
            'patterns' => [
1412
                [
1413
                    'regex'    => '/^(622169|621519|621539|623090)\d{13}$/',
1414
                    'cardType' => 'DC',
1415
                ],
1416
            ],
1417
        ],
1418
        [
1419
            'bankCode' => 'XTB',
1420
            'patterns' => [
1421
                [
1422
                    'regex'    => '/^(621238|620528)\d{13}$/',
1423
                    'cardType' => 'DC',
1424
                ],
1425
            ],
1426
        ],
1427
        [
1428
            'bankCode' => 'LPRDNCXYS',
1429
            'patterns' => [
1430
                [
1431
                    'regex'    => '/^(628382|625158)\d{10}$/',
1432
                    'cardType' => 'CC',
1433
                ],
1434
            ],
1435
        ],
1436
        [
1437
            'bankCode' => 'DYCCB',
1438
            'patterns' => [
1439
                [
1440
                    'regex'    => '/^(621004)\d{12}$/',
1441
                    'cardType' => 'DC',
1442
                ],
1443
                [
1444
                    'regex'    => '/^(628217)\d{10}$/',
1445
                    'cardType' => 'CC',
1446
                ],
1447
            ],
1448
        ],
1449
        [
1450
            'bankCode' => 'SRBANK',
1451
            'patterns' => [
1452
                [
1453
                    'regex'    => '/^(621416)\d{10}$/',
1454
                    'cardType' => 'DC',
1455
                ],
1456
                [
1457
                    'regex'    => '/^(628217)\d{10}$/',
1458
                    'cardType' => 'CC',
1459
                ],
1460
            ],
1461
        ],
1462
        [
1463
            'bankCode' => 'DZBANK',
1464
            'patterns' => [
1465
                [
1466
                    'regex'    => '/^(622937)\d{13}$/',
1467
                    'cardType' => 'DC',
1468
                ],
1469
                [
1470
                    'regex'    => '/^(628397)\d{10}$/',
1471
                    'cardType' => 'CC',
1472
                ],
1473
            ],
1474
        ],
1475
        [
1476
            'bankCode' => 'CDB',
1477
            'patterns' => [
1478
                [
1479
                    'regex'    => '/^(628229)\d{10}$/',
1480
                    'cardType' => 'CC',
1481
                ],
1482
            ],
1483
        ],
1484
        [
1485
            'bankCode' => 'YNRCC',
1486
            'patterns' => [
1487
                [
1488
                    'regex'    => '/^(622469|628307)\d{10}$/',
1489
                    'cardType' => 'CC',
1490
                ],
1491
            ],
1492
        ],
1493
        [
1494
            'bankCode' => 'LZCCB',
1495
            'patterns' => [
1496
                [
1497
                    'regex'    => '/^(622292|622291|621412)\d{12}$/',
1498
                    'cardType' => 'DC',
1499
                ],
1500
                [
1501
                    'regex'    => '/^(622880|622881)\d{10}$/',
1502
                    'cardType' => 'DC',
1503
                ],
1504
                [
1505
                    'regex'    => '/^(62829)\d{10}$/',
1506
                    'cardType' => 'CC',
1507
                ],
1508
            ],
1509
        ],
1510
        [
1511
            'bankCode' => 'WHSYBANK',
1512
            'patterns' => [
1513
                [
1514
                    'regex'    => '/^(623102)\d{10}$/',
1515
                    'cardType' => 'DC',
1516
                ],
1517
                [
1518
                    'regex'    => '/^(628234)\d{10}$/',
1519
                    'cardType' => 'CC',
1520
                ],
1521
            ],
1522
        ],
1523
        [
1524
            'bankCode' => 'HZBANK',
1525
            'patterns' => [
1526
                [
1527
                    'regex'    => '/^(628306)\d{10}$/',
1528
                    'cardType' => 'CC',
1529
                ],
1530
            ],
1531
        ],
1532
        [
1533
            'bankCode' => 'BANKWF',
1534
            'patterns' => [
1535
                [
1536
                    'regex'    => '/^(622391|940072)\d{10}$/',
1537
                    'cardType' => 'DC',
1538
                ],
1539
                [
1540
                    'regex'    => '/^(628391)\d{10}$/',
1541
                    'cardType' => 'CC',
1542
                ],
1543
            ],
1544
        ],
1545
        [
1546
            'bankCode' => 'GZB',
1547
            'patterns' => [
1548
                [
1549
                    'regex'    => '/^(622967|940073)\d{13}$/',
1550
                    'cardType' => 'DC',
1551
                ],
1552
                [
1553
                    'regex'    => '/^(628233)\d{10}$/',
1554
                    'cardType' => 'CC',
1555
                ],
1556
            ],
1557
        ],
1558
        [
1559
            'bankCode' => 'RZGWYBANK',
1560
            'patterns' => [
1561
                [
1562
                    'regex'    => '/^(628257)\d{10}$/',
1563
                    'cardType' => 'CC',
1564
                ],
1565
            ],
1566
        ],
1567
        [
1568
            'bankCode' => 'NCB',
1569
            'patterns' => [
1570
                [
1571
                    'regex'    => '/^(621269|622275)\d{10}$/',
1572
                    'cardType' => 'DC',
1573
                ],
1574
                [
1575
                    'regex'    => '/^(940006)\d{11}$/',
1576
                    'cardType' => 'DC',
1577
                ],
1578
                [
1579
                    'regex'    => '/^(628305)\d{11}$/',
1580
                    'cardType' => 'CC',
1581
                ],
1582
            ],
1583
        ],
1584
        [
1585
            'bankCode' => 'GYCB',
1586
            'patterns' => [
1587
                [
1588
                    'regex'    => '/^(622133|621735)\d{13}$/',
1589
                    'cardType' => 'DC',
1590
                ],
1591
                [
1592
                    'regex'    => '/^(888)\d{13}$/',
1593
                    'cardType' => 'DC',
1594
                ],
1595
                [
1596
                    'regex'    => '/^(628213)\d{10}$/',
1597
                    'cardType' => 'CC',
1598
                ],
1599
            ],
1600
        ],
1601
        [
1602
            'bankCode' => 'BOJZ',
1603
            'patterns' => [
1604
                [
1605
                    'regex'    => '/^(622990|940003)\d{11}$/',
1606
                    'cardType' => 'DC',
1607
                ],
1608
                [
1609
                    'regex'    => '/^(628261)\d{10}$/',
1610
                    'cardType' => 'CC',
1611
                ],
1612
            ],
1613
        ],
1614
        [
1615
            'bankCode' => 'QSBANK',
1616
            'patterns' => [
1617
                [
1618
                    'regex'    => '/^(622311|940057)\d{11}$/',
1619
                    'cardType' => 'DC',
1620
                ],
1621
                [
1622
                    'regex'    => '/^(628311)\d{10}$/',
1623
                    'cardType' => 'CC',
1624
                ],
1625
            ],
1626
        ],
1627
        [
1628
            'bankCode' => 'RBOZ',
1629
            'patterns' => [
1630
                [
1631
                    'regex'    => '/^(622363|940048)\d{13}$/',
1632
                    'cardType' => 'DC',
1633
                ],
1634
                [
1635
                    'regex'    => '/^(628270)\d{10}$/',
1636
                    'cardType' => 'CC',
1637
                ],
1638
            ],
1639
        ],
1640
        [
1641
            'bankCode' => 'HLDCCB',
1642
            'patterns' => [
1643
                [
1644
                    'regex'    => '/^(622398|940054)\d{10}$/',
1645
                    'cardType' => 'DC',
1646
                ],
1647
            ],
1648
        ],
1649
        [
1650
            'bankCode' => 'HBC',
1651
            'patterns' => [
1652
                [
1653
                    'regex'    => '/^(940055)\d{11}$/',
1654
                    'cardType' => 'DC',
1655
                ],
1656
                [
1657
                    'regex'    => '/^(622397)\d{11}$/',
1658
                    'cardType' => 'CC',
1659
                ],
1660
            ],
1661
        ],
1662
        [
1663
            'bankCode' => 'HZCB',
1664
            'patterns' => [
1665
                [
1666
                    'regex'    => '/^(603367|622878)\d{12}$/',
1667
                    'cardType' => 'DC',
1668
                ],
1669
                [
1670
                    'regex'    => '/^(622397)\d{11}$/',
1671
                    'cardType' => 'CC',
1672
                ],
1673
            ],
1674
        ],
1675
        [
1676
            'bankCode' => 'JSBANK',
1677
            'patterns' => [
1678
                [
1679
                    'regex'    => '/^(603506)\d{13}$/',
1680
                    'cardType' => 'DC',
1681
                ],
1682
            ],
1683
        ],
1684
        [
1685
            'bankCode' => 'LYCB',
1686
            'patterns' => [
1687
                [
1688
                    'regex'    => '/^(622399|940043)\d{11}$/',
1689
                    'cardType' => 'DC',
1690
                ],
1691
            ],
1692
        ],
1693
        [
1694
            'bankCode' => 'LYB',
1695
            'patterns' => [
1696
                [
1697
                    'regex'    => '/^(622420|940041)\d{11}$/',
1698
                    'cardType' => 'DC',
1699
                ],
1700
            ],
1701
        ],
1702
        [
1703
            'bankCode' => 'JZCBANK',
1704
            'patterns' => [
1705
                [
1706
                    'regex'    => '/^(622338)\d{13}$/',
1707
                    'cardType' => 'DC',
1708
                ],
1709
                [
1710
                    'regex'    => '/^(940032)\d{10}$/',
1711
                    'cardType' => 'DC',
1712
                ],
1713
            ],
1714
        ],
1715
        [
1716
            'bankCode' => 'ZJCCB',
1717
            'patterns' => [
1718
                [
1719
                    'regex'    => '/^(622394|940025)\d{10}$/',
1720
                    'cardType' => 'DC',
1721
                ],
1722
            ],
1723
        ],
1724
        [
1725
            'bankCode' => 'FGXYBANK',
1726
            'patterns' => [
1727
                [
1728
                    'regex'    => '/^(621245)\d{10}$/',
1729
                    'cardType' => 'DC',
1730
                ],
1731
            ],
1732
        ],
1733
        [
1734
            'bankCode' => 'DYBANK',
1735
            'patterns' => [
1736
                [
1737
                    'regex'    => '/^(621328)\d{13}$/',
1738
                    'cardType' => 'DC',
1739
                ],
1740
            ],
1741
        ],
1742
        [
1743
            'bankCode' => 'DIYEBANK',
1744
            'patterns' => [
1745
                [
1746
                    'regex'    => '/^(621651)\d{13}$/',
1747
                    'cardType' => 'DC',
1748
                ],
1749
            ],
1750
        ],
1751
        [
1752
            'bankCode' => 'HQBANK',
1753
            'patterns' => [
1754
                [
1755
                    'regex'    => '/^(621077)\d{10}$/',
1756
                    'cardType' => 'DC',
1757
                ],
1758
            ],
1759
        ],
1760
        [
1761
            'bankCode' => 'HSB',
1762
            'patterns' => [
1763
                [
1764
                    'regex'    => '/^(622409|621441)\d{13}$/',
1765
                    'cardType' => 'DC',
1766
                ],
1767
                [
1768
                    'regex'    => '/^(622410|621440)\d{11}$/',
1769
                    'cardType' => 'DC',
1770
                ],
1771
                [
1772
                    'regex'    => '/^(622950|622951)\d{10}$/',
1773
                    'cardType' => 'DC',
1774
                ],
1775
                [
1776
                    'regex'    => '/^(625026|625024|622376|622378|622377|625092)\d{10}$/',
1777
                    'cardType' => 'CC',
1778
                ],
1779
            ],
1780
        ],
1781
        [
1782
            'bankCode' => 'LSB',
1783
            'patterns' => [
1784
                [
1785
                    'regex'    => '/^(622359|940066)\d{13}$/',
1786
                    'cardType' => 'DC',
1787
                ],
1788
            ],
1789
        ],
1790
        [
1791
            'bankCode' => 'YTCB',
1792
            'patterns' => [
1793
                [
1794
                    'regex'    => '/^(622886)\d{10}$/',
1795
                    'cardType' => 'DC',
1796
                ],
1797
            ],
1798
        ],
1799
        [
1800
            'bankCode' => 'QLB',
1801
            'patterns' => [
1802
                [
1803
                    'regex'    => '/^(940008|622379)\d{13}$/',
1804
                    'cardType' => 'DC',
1805
                ],
1806
                [
1807
                    'regex'    => '/^(628379)\d{10}$/',
1808
                    'cardType' => 'CC',
1809
                ],
1810
            ],
1811
        ],
1812
        [
1813
            'bankCode' => 'BCCC',
1814
            'patterns' => [
1815
                [
1816
                    'regex'    => '/^(620011|620027|620031|620039|620103|620106|620120|620123|620125|620220|620278|620812|621006|621011|621012|621020|621023|621025|621027|621031|620132|621039|621078|621220|621003)\d{10}$/',
1817
                    'cardType' => 'DC',
1818
                ],
1819
                [
1820
                    'regex'    => '/^(625003|625011|625012|625020|625023|625025|625027|625031|621032|625039|625078|625079|625103|625106|625006|625112|625120|625123|625125|625127|625131|625032|625139|625178|625179|625220|625320|625111|625132|625244)\d{10}$/',
1821
                    'cardType' => 'CC',
1822
                ],
1823
            ],
1824
        ],
1825
        [
1826
            'bankCode' => 'CYB',
1827
            'patterns' => [
1828
                [
1829
                    'regex'    => '/^(622355|623042)\d{10}$/',
1830
                    'cardType' => 'DC',
1831
                ],
1832
                [
1833
                    'regex'    => '/^(621043|621742)\d{13}$/',
1834
                    'cardType' => 'DC',
1835
                ],
1836
                [
1837
                    'regex'    => '/^(622352|622353|625048|625053|625060)\d{10}$/',
1838
                    'cardType' => 'CC',
1839
                ],
1840
                [
1841
                    'regex'    => '/^(620206|620207)\d{10}$/',
1842
                    'cardType' => 'PC',
1843
                ],
1844
            ],
1845
        ],
1846
        [
1847
            'bankCode' => 'TFB',
1848
            'patterns' => [
1849
                [
1850
                    'regex'    => '/^(622547|622548|622546)\d{13}$/',
1851
                    'cardType' => 'DC',
1852
                ],
1853
                [
1854
                    'regex'    => '/^(625198|625196|625147)\d{10}$/',
1855
                    'cardType' => 'CC',
1856
                ],
1857
                [
1858
                    'regex'    => '/^(620072)\d{13}$/',
1859
                    'cardType' => 'PC',
1860
                ],
1861
                [
1862
                    'regex'    => '/^(620204|620205)\d{10}$/',
1863
                    'cardType' => 'PC',
1864
                ],
1865
            ],
1866
        ],
1867
        [
1868
            'bankCode' => 'AEON',
1869
            'patterns' => [
1870
                [
1871
                    'regex'    => '/^(621064|622941|622974)\d{10}$/',
1872
                    'cardType' => 'DC',
1873
                ],
1874
                [
1875
                    'regex'    => '/^(622493)\d{10}$/',
1876
                    'cardType' => 'CC',
1877
                ],
1878
            ],
1879
        ],
1880
        [
1881
            'bankCode' => 'MABDA',
1882
            'patterns' => [
1883
                [
1884
                    'regex'    => '/^(621274|621324)\d{13}$/',
1885
                    'cardType' => 'DC',
1886
                ],
1887
            ],
1888
        ],
1889
    ];
1890
1891
    protected function getBankInfoByCardNo($cardNo)
1892
    {
1893
        foreach ($this->patterns as $val) {
1894
            foreach ($val['patterns'] as $pattern) {
1895
                if (preg_match($pattern['regex'], $cardNo)) {
1896
                    return [
1897
                        'bankCode' => $val['bankCode'],
1898
                        'cardType' => $pattern['cardType'],
1899
                    ];
1900
                }
1901
            }
1902
        }
1903
1904
        throw new ValidationException();
1905
    }
1906
1907
    protected function mapInfoToObject(array $bankInfo)
1908
    {
1909
        return new Info([
1910
            'bankCode'     => $bankInfo['bankCode'],
1911
            'bankName'     => BankName::get($bankInfo['bankCode']),
1912
            'bankIcon'     => $this->getBankIcon($bankInfo['bankCode']),
1913
            'cardType'     => $bankInfo['cardType'],
1914
            'cardTypeName' => CardType::get($bankInfo['cardType']),
1915
        ]);
1916
    }
1917
1918
    protected function getBankIcon($bankCode)
0 ignored issues
show
Unused Code introduced by
The parameter $bankCode is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
1919
    {
1920
        return '';
1921
    }
1922
}
1923