callmez\wechat\sdk\components\BaseWechat::encryptXml PHP Метод

encryptXml() публичный Метод

加密XML数据
public encryptXml ( string $xml, string $timestamp, string $nonce ) : string | boolean
$xml string 加密的XML
$timestamp string 加密时间戳
$nonce string 加密随机串
Результат string | boolean
    public function encryptXml($xml, $timestamp, $nonce)
    {
        $errorCode = $this->getMessageCrypt()->encryptMsg($xml, $timestamp, $nonce, $xml);
        if ($errorCode) {
            $this->lastError = ['errcode' => $errorCode, 'errmsg' => 'XML数据加密失败!'];
            return false;
        }
        return $xml;
    }