Closed zlm919 closed 7 years ago
@zlm919 参数不对,导致微信返回错误,然后他没有正确的处理导致的。
@zlm919 @lymanlai working on v2.0,有可能的话帮助测试
why close is issue? apperently, this lib does not handle failure properly, a proper error should be return, not a exception.
I believe it can be more robust.
使用wxpay.getBrandWCPayRequestParams时有时会出现 TypeError: Cannot read property 'nonce_str' of undefined at C:\node_modules\weixin-pay\lib\wxpay.js:87:18 at Parser. (C:\node_modules\weixin-pay\node_modules\xml2js\lib\xml2js.js:488:18)
at emitOne (events.js:77:13)
at Parser.emit (events.js:169:7)
at Parser.exports.Parser.Parser.parseString (C:\node_modules\weixin-pay\node_modules\xml2js\lib\xml2js.js:507:16)
at Parser.parseString (C:\node_modules\weixin-pay\node_modules\xml2js\lib\xml2js.js:7:59)
at Object.exports.parseXML (C:\node_modules\weixin-pay\lib\util.js:11:9)
at Request._callback (C:\node_modules\weixin-pay\lib\wxpay.js:75:8)
at self.callback (C:\node_modules\weixin-pay\node_modules\request\request.js:200:22)
at emitOne (events.js:77:13)