JeffreySu / WeiXinMPSDK

微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 8.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#.

Home Page:https://weixin.senparc.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RequestAsync 签名验证失败:The computed authentication tag did not match the input authentication tag.

Qintai opened this issue · comments

commented

此版块专为反馈 bug 及提交需求服务,不负责解答开发问题,请勿发表开发问题,
如果您需要这方面的帮助,请移步问答社区https://weixin.senparc.com/QA

问题描述

RequestAsync 签名验证失败:The computed authentication tag did not match the input authentication tag.

重现问题步骤(如果可以)
  1. 调用下单接口,拿不到 prepay_id 的值
var basePayApis2 = new Senparc.Weixin.TenPayV3.TenPayHttpClient.BasePayApis2(_senparchttpClient, _tenpayV3Setting);
if (result.VerifySignSuccess != true)
{
        _logger.LogWarning($"获取prepay_id出错: {result.ResultCode.ToJson()}");
        throw new WeixinException("获取 prepay_id 结果校验出错!");
}

引用包如下
<ItemGroup>
		<PackageReference Include="Senparc.Weixin.AspNet" Version="0.8.5.8" />
		<PackageReference Include="Senparc.Weixin.MP" Version="16.18.10.6" />
		<PackageReference Include="Senparc.Weixin.TenpayV3" Version="0.6.8.13" />
		<PackageReference Include="ZXing.Net" Version="0.16.8" />
</ItemGroup>

使用的是 TenPayV3 最新版本,此代码是从 Samples V3拷贝过来的

当前项目 webapi 版本是 .net 6.0

  1. ...
微信官方文档 URL
微信官方文档快照(直接复制关键内容到下方)
发现问题的模块
  • Senparc.Weixin.TenPayV3
模块对应的 .net 版本
  • .net 6.0
开发环境
  • Visual Studio 2022
缓存环境
  • 服务器内存缓存(默认)
系统环境
  • [x ] Linux,版本:
联系方式

Email:1767363071@qq.com

检查一下所有参数配置是否有问题,比如 privateKey
另外 Senparc.Weixin.TenPayV3 建议升级到最新的版本,方便我们同步做测试。最新版本是稳定的。