1 | <?php |
||
33 | class PreAuthorization extends AbstractComponent |
||
34 | { |
||
35 | /** |
||
36 | * Create pre auth code url. |
||
37 | */ |
||
38 | const CREATE_PRE_AUTH_CODE = 'https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode'; |
||
39 | |||
40 | /** |
||
41 | * Pre auth link. |
||
42 | */ |
||
43 | const PRE_AUTH_LINK = 'https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s'; |
||
44 | |||
45 | /** |
||
46 | * Redirect Uri. |
||
47 | * |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $redirectUri; |
||
51 | |||
52 | /** |
||
53 | * Get pre auth code. |
||
54 | * |
||
55 | * @throws \EasyWeChat\Core\Exceptions\InvalidArgumentException |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | 2 | public function getCode() |
|
73 | |||
74 | /** |
||
75 | * Redirect to WeChat PreAuthorization page. |
||
76 | * |
||
77 | * @param string $url |
||
78 | * |
||
79 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
||
80 | */ |
||
81 | 1 | public function redirect($url) |
|
87 | } |
||
88 |