1 | <?php |
||
16 | class Client |
||
17 | { |
||
18 | const API_ADDRESS = 'https://ssl.captcha.qq.com/ticket/verify'; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $appid; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $secretKey; |
||
29 | |||
30 | /** |
||
31 | * Register appid and secretkey. |
||
32 | * |
||
33 | * @param string $appid |
||
34 | * @param string $secretKey |
||
35 | * |
||
36 | * @throws \RuntimeException |
||
37 | */ |
||
38 | 6 | public function __construct($appid = null, $secretKey = null) |
|
47 | |||
48 | /** |
||
49 | * Get http client instance. |
||
50 | * |
||
51 | * @return \GuzzleHttp\Client |
||
52 | */ |
||
53 | 2 | public function getHttpClient() |
|
57 | |||
58 | /** |
||
59 | * Static method call. |
||
60 | * |
||
61 | * @param string $ticket |
||
62 | * @param string $randstr |
||
63 | * @param string $ip |
||
64 | * |
||
65 | * @return mixed |
||
66 | */ |
||
67 | 1 | public static function check($ticket, $randstr, $ip = null) |
|
71 | |||
72 | /** |
||
73 | * Verify request ticket. |
||
74 | * |
||
75 | * @param string $ticket |
||
76 | * @param string $randstr |
||
77 | * @param string $ip |
||
78 | * |
||
79 | * @return \Godruoyi\Tencent007\Response |
||
80 | */ |
||
81 | 1 | public function ticketVerify($ticket, $randstr, $ip = null) |
|
99 | } |
||
100 |