收藏
回答

微信支付v3 回调通知 验证签名出错 20211?

支付成功后回调通知,验签一直不能通过,用工具验证提示:验证签名出错!ret:20211(对签名串Base64解码失败)

验签证书使用的是微信平台的公共证书

收到的参数如下:

[Wechatpay-Signature] => PYBEWw4yluNSdes7wMnMsneDlZOhIUB4SgCQ5mMITVAiAW2T1HF034HEuhBaKC9kJSnx55THswgnWMexzeoDBtPDAN5TTRxXAeVkzyGIjwJ4wP0xCSslx78OotVmMXYcftpVM4F8Ue3peacObYCWNIiCepitik2Z05+eZMWUEf\/gCtiwYhQ7V4QqAXSJbd+Qf2GkNHx2PHYyPFD129pDf+Xb5+9UUpO13YaNH7w\/Cv0FAHhjTKchcxuEJmpkUaoPtNqQ1k4E4R6BcX4\/wJa2EMy\/0tse4xeoKAaJNWwQK6UzziaQGSe6oSEI8XfOvGbLim1V+ZHbOEXIj2I6Z6PDTA==
[Wechatpay-TimeStamp] => 1605690156
[Wechatpay-Nonce] => a2DkytR3PBXhuzlhBgcpVWFh0lmZahRq
[Wechatpay-Serial] => 607D2488CF07CC41BC8A050D5B97A40D88E1CA35

body:

{"id":"b3cd9e12-734b-5d2e-b07c-3d066814177f","create_time":"2020-11-18T17:02:36+08:00","resource_type":"encrypt-resource","event_type":"TRANSACTION.SUCCESS","summary":"支付成功","resource":{"original_type":"transaction","algorithm":"AEAD_AES_256_GCM","ciphertext":"1Ji7HsKaK4OspmKN2VsMQ0zSMsit1XEjljlW1W6PHQ5wT/PUzpkD1Nx/qeqtuY635RX4lcnptZqgmpbtdBcvMFyDzbiFNXyfeXl1ZhOz3bXdedZZKCvuJhVQ+S6eSYWJkRb/t4s4DRrcKYHa9UHtuGp/asLtVD6ThjcfquH5voGWrsD5RQke5KeyARIODSgUB4opEE/oOXU7VRi7OyqH9Coj8zbbS9D6BS5ymLiOitXZ+Ke1MTSXHvcRYP07n6X0fHUIM7oSi/T6pBdmwHv49BXeKjV90nW3nTR2cYwlxjhvQ9oa6XIdYJlsVNO+ICXTTn2KErFN6w7sK1p6uLe7alk3h1arcGFl2iasCPu7Zykibh6i5lBpBvvDprFtye99PkmND7w/rnCmC4y9msSsyx9T+vokVzel1EyGRQNcJtAW67vlRcz0b8IbcimLp+Q+O0aveUy0e69bGujoUfXqu6LnXkEX/AlG4sQZ5Ofghl3ggSiS4M7zS+AKI26JxrSM5CIFLCeHCN4z+rJFuXtZRdnw+uqFwVjTZZ0nhr4woVFFGYCQByPxl4eAjYq9V7x7yLY=","associated_data":"transaction","nonce":"xkPG9z5j8OQr"}}

验签名串:

1605690156
a2DkytR3PBXhuzlhBgcpVWFh0lmZahRq
{"id":"b3cd9e12-734b-5d2e-b07c-3d066814177f","create_time":"2020-11-18T17:02:36+08:00","resource_type":"encrypt-resource","event_type":"TRANSACTION.SUCCESS","summary":"支付成功","resource":{"original_type":"transaction","algorithm":"AEAD_AES_256_GCM","ciphertext":"1Ji7HsKaK4OspmKN2VsMQ0zSMsit1XEjljlW1W6PHQ5wT\/PUzpkD1Nx\/qeqtuY635RX4lcnptZqgmpbtdBcvMFyDzbiFNXyfeXl1ZhOz3bXdedZZKCvuJhVQ+S6eSYWJkRb\/t4s4DRrcKYHa9UHtuGp\/asLtVD6ThjcfquH5voGWrsD5RQke5KeyARIODSgUB4opEE\/oOXU7VRi7OyqH9Coj8zbbS9D6BS5ymLiOitXZ+Ke1MTSXHvcRYP07n6X0fHUIM7oSi\/T6pBdmwHv49BXeKjV90nW3nTR2cYwlxjhvQ9oa6XIdYJlsVNO+ICXTTn2KErFN6w7sK1p6uLe7alk3h1arcGFl2iasCPu7Zykibh6i5lBpBvvDprFtye99PkmND7w\/rnCmC4y9msSsyx9T+vokVzel1EyGRQNcJtAW67vlRcz0b8IbcimLp+Q+O0aveUy0e69bGujoUfXqu6LnXkEX\/AlG4sQZ5Ofghl3ggSiS4M7zS+AKI26JxrSM5CIFLCeHCN4z+rJFuXtZRdnw+uqFwVjTZZ0nhr4woVFFGYCQByPxl4eAjYq9V7x7yLY=","associated_data":"transaction","nonce":"xkPG9z5j8OQr"}}




搞了一天,硬是没明白问题出在哪里。


回答关注问题邀请回答
收藏

3 个回答

  • NULL🔚
    NULL🔚
    2021-05-18

    我和你的情况一样 就是不好使

    2021-05-18
    有用
    回复
  • 天空
    天空
    2021-03-01

    你好,能具体说下怎么解决的么,我这边一直是签名验证不通过

    2021-03-01
    有用
    回复 1
    • 天空
      天空
      2021-03-02
      已经解决了,应该直接读取Request.Body中的内容
      2021-03-02
      回复
  • 放牛娃
    放牛娃
    2020-11-18

    已解决,注意字符转义的问题

    2020-11-18
    有用
    回复 1
    • 最多两杯
      最多两杯
      2020-12-05
      老哥,在吗 我这边支付也有点问题
      2020-12-05
      回复
登录 后发表内容
问题标签