1 | <?php |
||
34 | class PreAuthCode extends AbstractComponent |
||
35 | { |
||
36 | /** |
||
37 | * Create pre auth code url. |
||
38 | */ |
||
39 | const CREATE_PRE_AUTH_CODE = 'https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode'; |
||
40 | |||
41 | /** |
||
42 | * Pre auth link. |
||
43 | */ |
||
44 | const PRE_AUTH_LINK = 'https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s'; |
||
45 | |||
46 | /** |
||
47 | * Redirect Uri. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | protected $redirectUri; |
||
52 | |||
53 | |||
54 | /** |
||
55 | * Get pre auth code. |
||
56 | * |
||
57 | * @throws InvalidArgumentException |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | public function getCode() |
||
75 | |||
76 | /** |
||
77 | * Get Redirect url. |
||
78 | * |
||
79 | * @return string |
||
80 | * |
||
81 | * @throws RuntimeException |
||
82 | */ |
||
83 | public function getRedirectUri() |
||
91 | |||
92 | /** |
||
93 | * Set redirect uri. |
||
94 | * |
||
95 | * @param string $uri |
||
96 | * |
||
97 | * @return $this |
||
98 | */ |
||
99 | public function setRedirectUri($uri) |
||
105 | |||
106 | /** |
||
107 | * Get auth page link. |
||
108 | * |
||
109 | * @return string |
||
110 | */ |
||
111 | public function getAuthLink() |
||
119 | } |
||
120 |