Skip to content

Commit

Permalink
[WeChatPay] 签名探测流量
Browse files Browse the repository at this point in the history
  • Loading branch information
roc916 committed Feb 7, 2025
1 parent 58be6a2 commit 4b451cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public class WeChatPayNotifyClient(IWeChatPayPlatformCertificateManagerFactory c
{
public Task<T> ExecuteAsync<T>(WeChatPayHeaders headers, string body, WeChatPayClientOptions options) where T : IWeChatPayNotifyResource
{
if (headers.Signature.StartsWith(WeChatPayConstants.SignTestPrefix)) // 签名探测流量
{
throw new WeChatPayException("验签失败: 签名探测流量");
}

// 验签
string certPublicKey;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ namespace Essensoft.Paylinks.WeChatPay.Core;

public static class WeChatPayConstants
{
public const string SignTestPrefix = "WECHATPAY/SIGNTEST/";
public const string PublicKeyIdPrefix = "PUB_KEY_ID_";
}

0 comments on commit 4b451cf

Please sign in to comment.