klover2 / wechatpay-node-v3-ts

微信支付v3
MIT License
575 stars 88 forks source link

处理回调的时候,总提示Unsupported state or unable to authenticate data #50

Closed shiliu2023 closed 1 year ago

shiliu2023 commented 1 year ago

Error: Unsupported state or unable to authenticate data at Decipheriv.final (node:internal/crypto/cipher:193:29) at Pay2.Pay2.decipher_gcm (/home9/chatgpt-web/chatgpt-web/service/node_modules/wechatpay-node-v3/dist/index.js:332:18)

这是什么原因吗?解密方式不对吗?如下是信息:

{ description: '计算机电脑', out_trade_no: '79568867678022209', notify_url: 'https://gpt89.shiliucrm.com/pay/notify', amount: { total: 1 }, scene_info: { payer_client_ip: '::ffff:127.0.0.1' } } { status: 200, code_url: 'weixin://wxpay/bizpayurl?pr=IGZN4mtzz' } 接收信息2: F3FNBOLGTtrK02e+CTqwnWcJycCh6jy9C4+SK/mLcuz1iDS3M1y4OSI6kSMU2sombf5Kh8z4qTRfUdMXh35I7e15jH1ys7NZzKBmvCOS88pWIz1YsRhuSxefqgwiS89KGh3MjZfbB/NU5SgVyiQ5tezTJFito2GG9/UwttqahC4jWwvuR9P4NPpJYIebFsiudOKA1inKLZXIxhs5CEkbxxgnpAz5aPbDxj8I8JtKLaSNO5H0ZZ4DhwS9l8OfIo9VBGTRyEn5BZwbFtEc94chJZrZw+2JtnHuGdYM0kigtkzcB4goze3BDXFTGpgo7rLc/YfoaiYRZrExrJ6FkbuecTFlI+NjRxMnBKyu1JJnHb1517zPOHqPa3kJ3Q2Xe+fUtgw5zig+iFft+BxVgrCv/9TAIopfk8FNn1+swGhfyGjkFJaCKUV1u2+9UheP3kXFOIdK0cePP0GBIsFNyj6m2220BavBGF1U6+FMjjQvU8uK0e2sizBJSqMx11ghaZXnWtm0wzeZZJ4ctL1JEPh8BCWheCoO1ijHhYyJMY/5TGAiGeJf4lV/H6NYBOeyFyhf7w== 接收信息22: Ui0GBRYeMZ6Y 接收信息23: transaction 解密出错: Error: Unsupported state or unable to authenticate data

klover2 commented 1 year ago

Error: Unsupported state or unable to authenticate data at Decipheriv.final (node:internal/crypto/cipher:193:29) at Pay2.Pay2.decipher_gcm (/home9/chatgpt-web/chatgpt-web/service/node_modules/wechatpay-node-v3/dist/index.js:332:18)

这是什么原因吗?解密方式不对吗?如下是信息:

{ description: '计算机电脑', out_trade_no: '79568867678022209', notify_url: 'https://gpt89.shiliucrm.com/pay/notify', amount: { total: 1 }, scene_info: { payer_client_ip: '::ffff:127.0.0.1' } } { status: 200, code_url: 'weixin://wxpay/bizpayurl?pr=IGZN4mtzz' } 接收信息2: F3FNBOLGTtrK02e+CTqwnWcJycCh6jy9C4+SK/mLcuz1iDS3M1y4OSI6kSMU2sombf5Kh8z4qTRfUdMXh35I7e15jH1ys7NZzKBmvCOS88pWIz1YsRhuSxefqgwiS89KGh3MjZfbB/NU5SgVyiQ5tezTJFito2GG9/UwttqahC4jWwvuR9P4NPpJYIebFsiudOKA1inKLZXIxhs5CEkbxxgnpAz5aPbDxj8I8JtKLaSNO5H0ZZ4DhwS9l8OfIo9VBGTRyEn5BZwbFtEc94chJZrZw+2JtnHuGdYM0kigtkzcB4goze3BDXFTGpgo7rLc/YfoaiYRZrExrJ6FkbuecTFlI+NjRxMnBKyu1JJnHb1517zPOHqPa3kJ3Q2Xe+fUtgw5zig+iFft+BxVgrCv/9TAIopfk8FNn1+swGhfyGjkFJaCKUV1u2+9UheP3kXFOIdK0cePP0GBIsFNyj6m2220BavBGF1U6+FMjjQvU8uK0e2sizBJSqMx11ghaZXnWtm0wzeZZJ4ctL1JEPh8BCWheCoO1ijHhYyJMY/5TGAiGeJf4lV/H6NYBOeyFyhf7w== 接收信息22: Ui0GBRYeMZ6Y 接收信息23: transaction 解密出错: Error: Unsupported state or unable to authenticate data

请看 https://github.com/klover2/wechatpay-node-v3-ts/blob/master/docs/transactions_h5.md

HitHuf commented 1 year ago

同问,我也是一模一样的问题

klover2 commented 1 year ago

==

把密文后面的 两个 == 去掉试试

Locter9001 commented 1 year ago

一样的问题

Locter9001 commented 1 year ago

@klover2 @klover2 @klover2

Locter9001 commented 1 year ago

回调报错!!!!!!!!!!!!!!

(node:694005) UnhandledPromiseRejectionWarning: Error: Unsupported state or unable to authenticate data
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at Pay.decipher_gcm (/www/dating/serve/node_modules/wechatpay-node-v3/dist/index.js:332:18)
    at /www/dating/serve/src/pay/pay.js:64:24
    at Layer.handle [as handle_request] (/www/dating/serve/node_modules/express/lib/router/layer.js:95:5)
    at next (/www/dating/serve/node_modules/express/lib/router/route.js:144:13)
    at Route.dispatch (/www/dating/serve/node_modules/express/lib/router/route.js:114:3)
    at Layer.handle [as handle_request] (/www/dating/serve/node_modules/express/lib/router/layer.js:95:5)
    at /www/dating/serve/node_modules/express/lib/router/index.js:284:15
    at Function.process_params (/www/dating/serve/node_modules/express/lib/router/index.js:346:12)
    at next (/www/dating/serve/node_modules/express/lib/router/index.js:280:10)
(node:694005) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
klover2 commented 1 year ago

回调报错!!!!!!!!!!!!!!

(node:694005) UnhandledPromiseRejectionWarning: Error: Unsupported state or unable to authenticate data
    at Decipheriv.final (internal/crypto/cipher.js:174:29)
    at Pay.decipher_gcm (/www/dating/serve/node_modules/wechatpay-node-v3/dist/index.js:332:18)
    at /www/dating/serve/src/pay/pay.js:64:24
    at Layer.handle [as handle_request] (/www/dating/serve/node_modules/express/lib/router/layer.js:95:5)
    at next (/www/dating/serve/node_modules/express/lib/router/route.js:144:13)
    at Route.dispatch (/www/dating/serve/node_modules/express/lib/router/route.js:114:3)
    at Layer.handle [as handle_request] (/www/dating/serve/node_modules/express/lib/router/layer.js:95:5)
    at /www/dating/serve/node_modules/express/lib/router/index.js:284:15
    at Function.process_params (/www/dating/serve/node_modules/express/lib/router/index.js:346:12)
    at next (/www/dating/serve/node_modules/express/lib/router/index.js:280:10)
(node:694005) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

把密文后面的 两个 == 去掉试试

Locter9001 commented 1 year ago

没有用

发送自我的盖乐世

-------- 原始信息 -------- 发件人: klover @.> 日期: 2023/7/5 11:20 (GMT+08:00) 收件人: klover2/wechatpay-node-v3-ts @.> 抄送: Locter @.>, Comment @.> 主题: Re: [klover2/wechatpay-node-v3-ts] 处理回调的时候,总提示Unsupported state or unable to authenticate data (Issue #50)

回调报错!!!!!!!!!!!!!!

(node:694005) UnhandledPromiseRejectionWarning: Error: Unsupported state or unable to authenticate data at Decipheriv.final (internal/crypto/cipher.js:174:29) at Pay.decipher_gcm (/www/dating/serve/node_modules/wechatpay-node-v3/dist/index.js:332:18) at /www/dating/serve/src/pay/pay.js:64:24 at Layer.handle [as handle_request] (/www/dating/serve/node_modules/express/lib/router/layer.js:95:5) at next (/www/dating/serve/node_modules/express/lib/router/route.js:144:13) at Route.dispatch (/www/dating/serve/node_modules/express/lib/router/route.js:114:3) at Layer.handle [as handle_request] (/www/dating/serve/node_modules/express/lib/router/layer.js:95:5) at /www/dating/serve/node_modules/express/lib/router/index.js:284:15 at Function.process_params (/www/dating/serve/node_modules/express/lib/router/index.js:346:12) at next (/www/dating/serve/node_modules/express/lib/router/index.js:280:10) (node:694005) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

把密文后面的 两个 == 去掉试试

― Reply to this email directly, view it on GitHubhttps://github.com/klover2/wechatpay-node-v3-ts/issues/50#issuecomment-1620958170, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AW66LK5ZINDQWEESPKCAZOTXOTMQLANCNFSM6AAAAAAXWZOX5M. You are receiving this because you commented.Message ID: @.***>

klover2 commented 1 year ago

没有用 发送自我的盖乐世 -------- 原始信息 -------- 发件人: klover @.> 日期: 2023/7/5 11:20 (GMT+08:00) 收件人: klover2/wechatpay-node-v3-ts @.> 抄送: Locter @.>, Comment @.> 主题: Re: [klover2/wechatpay-node-v3-ts] 处理回调的时候,总提示Unsupported state or unable to authenticate data (Issue #50) 回调报错!!!!!!!!!!!!!! (node:694005) UnhandledPromiseRejectionWarning: Error: Unsupported state or unable to authenticate data at Decipheriv.final (internal/crypto/cipher.js:174:29) at Pay.decipher_gcm (/www/dating/serve/node_modules/wechatpay-node-v3/dist/index.js:332:18) at /www/dating/serve/src/pay/pay.js:64:24 at Layer.handle [as handle_request] (/www/dating/serve/node_modules/express/lib/router/layer.js:95:5) at next (/www/dating/serve/node_modules/express/lib/router/route.js:144:13) at Route.dispatch (/www/dating/serve/node_modules/express/lib/router/route.js:114:3) at Layer.handle [as handle_request] (/www/dating/serve/node_modules/express/lib/router/layer.js:95:5) at /www/dating/serve/node_modules/express/lib/router/index.js:284:15 at Function.process_params (/www/dating/serve/node_modules/express/lib/router/index.js:346:12) at next (/www/dating/serve/node_modules/express/lib/router/index.js:280:10) (node:694005) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) 把密文后面的 两个 == 去掉试试 ― Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AW66LK5ZINDQWEESPKCAZOTXOTMQLANCNFSM6AAAAAAXWZOX5M. You are receiving this because you commented.Message ID: @.***>

你能把你的密钥key 私发我吗 ,还有微信回调原始 参数 ,我这边给你调试一下 ,调试好了 你那边可以重置这个key 邮箱 49420645@qq.com

klover2 commented 1 year ago

没有用 发送自我的盖乐世 -------- 原始信息 -------- 发件人: klover @.> 日期: 2023/7/5 11:20 (GMT+08:00) 收件人: klover2/wechatpay-node-v3-ts @.> 抄送: Locter @.>, Comment @.> 主题: Re: [klover2/wechatpay-node-v3-ts] 处理回调的时候,总提示Unsupported state or unable to authenticate data (Issue #50) 回调报错!!!!!!!!!!!!!! (node:694005) UnhandledPromiseRejectionWarning: Error: Unsupported state or unable to authenticate data at Decipheriv.final (internal/crypto/cipher.js:174:29) at Pay.decipher_gcm (/www/dating/serve/node_modules/wechatpay-node-v3/dist/index.js:332:18) at /www/dating/serve/src/pay/pay.js:64:24 at Layer.handle [as handle_request] (/www/dating/serve/node_modules/express/lib/router/layer.js:95:5) at next (/www/dating/serve/node_modules/express/lib/router/route.js:144:13) at Route.dispatch (/www/dating/serve/node_modules/express/lib/router/route.js:114:3) at Layer.handle [as handle_request] (/www/dating/serve/node_modules/express/lib/router/layer.js:95:5) at /www/dating/serve/node_modules/express/lib/router/index.js:284:15 at Function.process_params (/www/dating/serve/node_modules/express/lib/router/index.js:346:12) at next (/www/dating/serve/node_modules/express/lib/router/index.js:280:10) (node:694005) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) 把密文后面的 两个 == 去掉试试 ― Reply to this email directly, view it on GitHub<#50 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AW66LK5ZINDQWEESPKCAZOTXOTMQLANCNFSM6AAAAAAXWZOX5M. You are receiving this because you commented.Message ID: @.***>

你有没有重新设置 v3 支付的key ,v2的key 对于v3 是没有用的 请看 https://github.com/klover2/wechatpay-node-v3-ts/issues/18

Locter9001 commented 1 year ago

@klover2 我尝试过,但并没有用处,控制台一直报错,这或许是程序问题?我看你的源代码里面有很多已弃用的方法

klover2 commented 1 year ago

@klover2 我尝试过,但并没有用处,控制台一直报错,这或许是程序问题?我看你的源代码里面有很多已弃用的方法

不是程序的问题 你看下你那几个参数放的对不对

Locter9001 commented 1 year ago

@klover2 我尝试过,但并没有用处,控制台一直报错,这或许是程序问题?我看你的源代码里面有很多已弃用的方法

不是程序的问题 你看下你那几个参数放的对不对

或许您应该出一个完整的案例?😬