PFinal\Wechat\Api::decryptMsg PHP Метод

decryptMsg() защищенный Метод

解密
protected decryptMsg ( string $msgSignature, string $timestamp, string $nonce, string $encryptMsg ) : string
$msgSignature string
$timestamp string
$nonce string
$encryptMsg string
Результат string
    protected function decryptMsg($msgSignature, $timestamp, $nonce, $encryptMsg)
    {
        $msg = '';
        //传入公众号第三方平台的token(申请公众号第三方平台时填写的接收消息的校验token), 公众号第三方平台的appid, 公众号第三方平台的 EncodingAESKey(申请公众号第三方平台时填写的接收消息的加密symmetric_key)
        $pc = new WXBizMsgCrypt($this->token, $this->encodingAesKey, $this->appId);
        // 第三方收到公众号平台发送的消息
        $errCode = $pc->decryptMsg($msgSignature, $timestamp, $nonce, $encryptMsg, $msg);
        if ($errCode == 0) {
            Log::debug((string) $msg);
            return $msg;
        }
        throw new WechatException('decrypt msg error. error code ' . $errCode);
    }