tvrcgo / weixin-pay

微信支付 Nodejs SDK
MIT License
919 stars 241 forks source link

Node.js v7.2.1 环境下,调用接口 getBrandWCPayRequestParams 出错 #33

Closed billie66 closed 7 years ago

billie66 commented 7 years ago
node_modules/weixin-pay/lib/wxpay.js:87
   nonceStr: data.nonce_str,

Cannot read property 'nonce_str' of undefined
genru commented 6 years ago

same issue. it's still persist on "weixin-pay": "^1.1.7"

genru commented 6 years ago

@billie66 could you please share us how to resolve this issue?

billie66 commented 6 years ago

This api has no problem. The error was caused by wrong params passed to weixin payment api,so you should check your code to find the problem

genru commented 6 years ago

@billie66 this is a defect of lib, when WeChat response error lib failed to handle such case. Yes, this is a wrong parameter case, but I believe lib could be more robust return error to developer, not a crash.

@tvrcgo it would be great and helpful to fix this issue.