diff --git a/CHANGELOG.md b/CHANGELOG.md index bc7bfb2..deb3f2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # 变更历史 +## v0.8.5 (2022-03-09) +- 优化`README`,增加v2版付款到零钱示例不验签使用方法; +- 解决`CLI`下初始化参数`mchid`必须是字符串类型的遗留问题; + ## v0.8.4 (2022-01-27) - 修正`Hash.md5`当给正确的`key`时,返回错误的签名值问题; diff --git a/bin/cli.js b/bin/cli.js index 0cb56f6..f0b8870 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -19,6 +19,8 @@ yargs(hideBin(process.argv)) }) .epilog('for more information visit https://github.com/TheNorthMemory/wechatpay-axios-plugin') .middleware((argv) => { + if (argv.c && argv.c.mchid) { Reflect.set(argv.config, 'mchid', `${argv.config.mchid}`); } + if (argv.c && argv.c.privateKey && argv.c.privateKey !== 'any') { Reflect.set(argv.config, 'privateKey', readFileSync(argv.c.privateKey)); } diff --git a/bin/cli/request.js b/bin/cli/request.js index 593d3ba..a5bf9eb 100644 --- a/bin/cli/request.js +++ b/bin/cli/request.js @@ -46,7 +46,6 @@ module.exports = { const { baseURL, uri, config, method, data, params, headers, } = argv; - config.mchid = `${config.mchid}` const responseType = argv.binary && typeof argv.binary === 'boolean' ? 'arraybuffer' : undefined; const structure = [{ params, headers, responseType }]; diff --git a/package.json b/package.json index 265625d..ff824f9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wechatpay-axios-plugin", - "version": "0.8.4", + "version": "0.8.5", "description": "微信支付APIv2及v3 NodeJS SDK,支持CLI模式请求OpenAPI,支持v3证书下载,v2付款码支付、企业付款、退款,企业微信-企业支付-企业红包/向员工付款,v2&v3 Native支付、扫码支付、H5支付、JSAPI/小程序支付、合单支付...", "main": "index.js", "typings": "index.d.ts",