supersheep / wechat-pay

wechat payment api for document v3.3.5
583 stars 144 forks source link

调用企业付款接口时,出现{"error":"wrong tag","code":-1},一头雾水,显示 #69

Open yecao007 opened 6 years ago

yecao007 commented 6 years ago

nodejs.Error: wrong tag at Object.createSecureContext (_tls_common.js:196:19) at Object.exports.connect (_tls_wrap.js:1116:48) at Agent.createConnection (https.js:122:22) at Agent.createSocket (_http_agent.js:227:26) at Agent.addRequest (_http_agent.js:185:10) at new ClientRequest (_http_client.js:263:16) at Object.request (https.js:275:10)

stiekel commented 6 years ago

我是退款时遇到。支付是没问题的。

[2018-10-21T21:27:09.353] [ERROR] default - [WePay][createRefund] Error: wrong tag
 at Object.createSecureContext (_tls_common.js:196:19)
 at Object.exports.connect (_tls_wrap.js:1111:48)
 at Agent.createConnection (https.js:116:22)
 at Agent.createSocket (_http_agent.js:227:26)
 at Agent.addRequest (_http_agent.js:185:10)
 at new ClientRequest (_http_client.js:257:16)
 at Object.request (https.js:245:10)
 at Payment._httpsRequest (/srv/demo/node_modules/wechat-pay/lib/payment.js:178:19)
 at Payment._signedQuery (/srv/demo/node_modules/wechat-pay/lib/payment.js:254:3)4|
 at Payment.refund (/srv/demo/node_modules/wechat-pay/lib/:8)
 at Promise (/srv/demo/node_modules/wechat-pay/lib/payment.js:493:16)
 at new Promise (<anonymous>)
 at Payment.(anonymous function) [as refund] (/srv/demo/node_modules/wechat-pay/lib/:16)
 at Object.createRefund (/srv/demo/app/libs/wxpay.js:155:29)
 at <anonymous>
 at process._tickCallback (internal/process/next_tick.js:160:7)
stiekel commented 6 years ago

经检查,出现这个问题的原因在于 p12 证书,报错是 ssl 报的。 务必确认文件是没有打包过的 p12 文件,可以试着在操作系统中导入,如果有问题则会无法导入。

yecao007 commented 5 years ago

是啊,最后我使用重新生成的p12证书,就可以了!