Roc 3 years ago
parent
commit
36707f9da9

+ 1 - 1
src/Essensoft.Paylink.WeChatPay/V2/Request/WeChatPayTransitPartnerPayPayApplyRequest.cs

@@ -79,7 +79,7 @@ namespace Essensoft.Paylink.WeChatPay.V2.Request
         public string ProfitSharing { get; set; }
 
         #region IWeChatPayRequest Members
-        // Url修正:https://pay.weixin.qq.com/wiki/doc/api/pap_sl_jt_v2.php?chapter=19_99&index=5
+
         private string requestUrl = "https://api.mch.weixin.qq.com/transit/partnerpay/payapply";
         private WeChatPaySignType signType = WeChatPaySignType.HMAC_SHA256;
 

+ 6 - 2
src/Essensoft.Paylink.WeChatPay/V2/WeChatPayNotifyClient.cs

@@ -95,12 +95,16 @@ namespace Essensoft.Paylink.WeChatPay.V2
                 throw new WeChatPayException("sign check fail: sign is Empty!");
             }
 
-            // 部分通知返回需要使用HMAC-SHA256验签
             string cal_sign;
-            if (notify.Parameters.TryGetValue("sign_type", out var sign_type) && sign_type == "HMAC-SHA256")
+            if (notify.Parameters.TryGetValue("sign_type", out var sign_type) && sign_type == WeChatPayConsts.HMAC_SHA256)
+            {
                 cal_sign = WeChatPaySignature.SignWithKey(notify.Parameters, options.APIKey, WeChatPaySignType.HMAC_SHA256);
+            }
             else
+            {
                 cal_sign = WeChatPaySignature.SignWithKey(notify.Parameters, options.APIKey, WeChatPaySignType.MD5);
+            }
+
             if (cal_sign != sign)
             {
                 throw new WeChatPayException("sign check fail: check Sign and Data Fail!");