setAppId($WxClient->appID); * $AccessTokenRequest->setSecret($WxClient->appsecret); * $AccessTokenRequest=$WxClient->execute($AccessTokenRequest); * */ class AccessTokenRequest extends Base { private $apiParas = array(); private $appid; private $secret; private $code; public function init(){ $this->apiParas['grant_type'] = 'client_credential'; $this->setAppId(''); $this->setSecret(''); } public function getApiMethodName(){ return "cgi-bin/token"; } public function getApiParas(){ return $this->apiParas; } public function putOtherTextParam($key, $value){ $this->apiParas[$key] = $value; $this->$key = $value; } public function setAppId($appid){ $this->appid = $appid; $this->apiParas["appid"] = $appid; } public function getAppId(){ return $this->appid; } public function setSecret($secret){ $this->secret = $secret; $this->apiParas["secret"] = $secret; } public function getSecret(){ return $this->secret; } }