Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | protected function getBankInfoByCardNo($cardNo) |
||
17 | { |
||
18 | $url = "https://ccdcapi.alipay.com/validateAndCacheCardInfo.json" |
||
19 | . "?_input_charset=utf-8&cardNo={$cardNo}&cardBinCheck=true"; |
||
20 | |||
21 | $content = file_get_contents($url); |
||
22 | if (!$content) { |
||
23 | throw new HttpException(); |
||
24 | } |
||
25 | |||
26 | $bankInfo = json_decode($content, true); |
||
27 | if (!$bankInfo['validated']) { |
||
28 | throw new ValidationException(); |
||
29 | } |
||
30 | |||
31 | return $bankInfo; |
||
32 | } |
||
33 | |||
56 |