wechatpay-apiv3 / wechatpay-guzzle-middleware

微信支付 APIv3 Guzzle HTTP Client中间件(middleware)
Apache License 2.0
209 stars 46 forks source link

用文档里面的方式请求下载证书接口的时候 回应参数没有data与ciphertext数据 #23

Closed ouyanghui-git closed 4 years ago

ouyanghui-git commented 4 years ago

用文档里面的方式请求下载证书接口的时候 回应参数没有data与ciphertext数据
$resp = $client->request('GET', 'https://api.mch.weixin.qq.com/v3/certificates', [ 'headers' => [ 'Accept' => 'application/json'] ]); $resp 里面只有hearder信息 没有data数据内容

tpirc3 commented 4 years ago

使用这种方式打印下获取到的证书

$resp = $client->request('GET', 'https://api.mch.weixin.qq.com/v3/certificates', [
    'headers' => [
        'Accept' => 'application/json'
    ]
]);  

echo $resp->getStatusCode().' '.$resp->getReasonPhrase()."\n";
echo $resp->getBody();
echo "\n";

也可以用附带的Certificate Downloader命令行工具

php tool/CertificateDownloader.php -k ${apiV3key} -m ${mchId} -f ${mchPrivateKeyFilePath} -s ${mchSerialNo} -o ${outputFilePath} -c ${wechatpayCertificateFilePath}
TheNorthMemory commented 4 years ago

更新一把文档呗 😄

tpirc3 commented 4 years ago

已更新~ 😄