Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有时会出现TypeError: Cannot read property 'nonce_str' of undefined #10

Closed
zlm919 opened this issue Apr 28, 2016 · 3 comments · Fixed by lymanlai/weixin-pay#1 · May be fixed by #17
Closed

有时会出现TypeError: Cannot read property 'nonce_str' of undefined #10

zlm919 opened this issue Apr 28, 2016 · 3 comments · Fixed by lymanlai/weixin-pay#1 · May be fixed by #17

Comments

@zlm919
Copy link

zlm919 commented Apr 28, 2016

使用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)

@lymanlai
Copy link

lymanlai commented Nov 6, 2016

@zlm919 参数不对,导致微信返回错误,然后他没有正确的处理导致的。

lymanlai added a commit to lymanlai/weixin-pay that referenced this issue Nov 6, 2016
@tvrcgo
Copy link
Owner

tvrcgo commented Jul 2, 2017

@zlm919 @lymanlai working on v2.0,有可能的话帮助测试

@tvrcgo tvrcgo closed this as completed Jul 2, 2017
@genru
Copy link

genru commented Jan 13, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants