Property | Type | Description | |
---|---|---|---|
$accessToken | |||
$appId | |||
$appSecret | |||
$encodingAesKey | |||
$encodingAesKeyLast | |||
$middleUrl | |||
$token |
Method | Description | |
---|---|---|
__construct ( array | string $appId, string | null $appSecret = null, string | null $token = null, string | null $encodingAesKey = null, string | null $encodingAesKeyLast = null, $middleUrl = null ) | 构造方法 可以使用一个数组作为参数 | |
buildReply ( mixed $reply ) : string | 构造响应xml字符串,用于微信服务器请求时被动响应 | |
checkSignature ( ) : boolean | 验证请求是否来自微信公共平台 | |
getAccessToken ( boolean $useCache = true ) : string | null | 获取公众号的全局唯一票据accessToken,公众号主动调用各接口时都需使用accessToken accessToken默认有效时间为7200秒,每天调用次数有限制,认证服务号每天最多100000次 | |
getAppId ( ) : string | 返回appId | |
getAppSecret ( ) : string | 返回appSecret | |
getMessage ( ) : |
返回消息对象,字段大小写与开放平台文档一致 | |
getMiddleUrl ( ) : string | null | ||
setAccessToken ( string $accessToken ) | 设置AccessToken |
Method | Description | |
---|---|---|
attemptDecrypt ( string $message ) : string | 尝试解密数据,从$_GET['encrypt_type']中获取加密类型,如果未加密,原样返回 | |
attemptEncrypt ( string $message ) : string | 对响应给微信服务器的消息进行加密,自动识别是否需要加密,本次请求未加密时,数据原样返回 | |
decryptMsg ( string $msgSignature, string $timestamp, string $nonce, string $encryptMsg ) : string | 解密 | |
encryptMsg ( $replyMsg, $timestamp, $nonce ) : string | 解密 |
public __construct ( array | string $appId, string | null $appSecret = null, string | null $token = null, string | null $encodingAesKey = null, string | null $encodingAesKeyLast = null, $middleUrl = null ) | ||
$appId | array | string | |
$appSecret | string | null | |
$token | string | null | |
$encodingAesKey | string | null | |
$encodingAesKeyLast | string | null |
protected attemptDecrypt ( string $message ) : string | ||
$message | string | |
return | string |
protected attemptEncrypt ( string $message ) : string | ||
$message | string | |
return | string |
public buildReply ( mixed $reply ) : string | ||
$reply | mixed | 被动响应的内容,ReplyMessage对象,News数组 或string |
return | string |
protected encryptMsg ( $replyMsg, $timestamp, $nonce ) : string | ||
$replyMsg | ||
$timestamp | ||
$nonce | ||
return | string |
public getMessage ( ) : |
||
return |
public setAccessToken ( string $accessToken ) | ||
$accessToken | string |