1 | <?php |
||
44 | class OpenPlatform |
||
45 | { |
||
46 | use PrefixedContainer; |
||
47 | |||
48 | /** |
||
49 | * Create an instance of the EasyWeChat for the given authorizer. |
||
50 | * |
||
51 | * @param string $appId Authorizer AppId |
||
52 | * @param string $refreshToken Authorizer refresh-token |
||
53 | * |
||
54 | * @return \EasyWeChat\Foundation\Application |
||
55 | */ |
||
56 | 1 | public function createAuthorizerApplication($appId, $refreshToken) |
|
57 | { |
||
58 | 1 | $this->fetch('authorization') |
|
59 | 1 | ->setAuthorizerAppId($appId) |
|
60 | 1 | ->setAuthorizerRefreshToken($refreshToken); |
|
61 | |||
62 | 1 | $application = $this->fetch('app'); |
|
63 | 1 | $application['access_token'] = $this->fetch('authorizer_access_token'); |
|
64 | 1 | $application['oauth'] = $this->fetch('oauth'); |
|
65 | |||
66 | 1 | return $application; |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * Quick access to the base-api. |
||
71 | * |
||
72 | * @param string $method |
||
73 | * @param array $args |
||
74 | * |
||
75 | * @return mixed |
||
76 | */ |
||
77 | public function __call($method, $args) |
||
81 | } |
||
82 |