From 0a66edacd03fbd0e46c263ae025eb0a724cb695d Mon Sep 17 00:00:00 2001 From: 403 <403@baseio.net> Date: Wed, 27 Nov 2024 18:53:06 +0800 Subject: [PATCH 01/11] =?UTF-8?q?Senparc.Weixin.Open.OAuthAPIs=20=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0=20is=5Fs?= =?UTF-8?q?napshotuser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs index 48ef5c0fa0..00d48fd38a 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs @@ -44,5 +44,9 @@ public class OAuthAccessTokenResult : WxJsonResult /// 用户授权的作用域,使用逗号(,)分隔 /// public string scope { get; set; } + /// + /// 是否为快照页模式虚拟账号,只有当用户是快照页模式虚拟账号是返回,值为1 + /// + public int? is_snapshotuser { get; set; } } } From aafc3cd0262917a360c7f8896b8c24072aeff10c Mon Sep 17 00:00:00 2001 From: 403 <403@baseio.net> Date: Wed, 27 Nov 2024 19:05:50 +0800 Subject: [PATCH 02/11] =?UTF-8?q?Senparc.Weixin.Open.OAuthAPIs=20=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=80=BC=E6=B7=BB=E5=8A=A0=E5=8F=82=E6=95=B0=20unioni?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs index 00d48fd38a..ce0ca01cee 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs @@ -45,6 +45,10 @@ public class OAuthAccessTokenResult : WxJsonResult /// public string scope { get; set; } /// + /// 用户统一标识(针对一个微信开放平台账号下的应用,同一用户的 unionid 是唯一的),只有当scope为"snsapi_userinfo"时返回 + /// + public string unionid { get; set; } + /// /// 是否为快照页模式虚拟账号,只有当用户是快照页模式虚拟账号是返回,值为1 /// public int? is_snapshotuser { get; set; } From 2c6c9098355ae347250bd8b1c4b168e979a8f926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=83=BD?= Date: Thu, 28 Nov 2024 13:02:11 +0800 Subject: [PATCH 03/11] =?UTF-8?q?tenpayv3=20=E6=94=AF=E6=8C=81=20=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E5=85=AC=E9=92=A5=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=85=8D=E7=BD=AE=EF=BC=9ATenPayV3=5FWeixinPubKey=20?= =?UTF-8?q?=20=20TenPayV3=5FWeixinPubKeySerialNo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Senparc.Weixin.TenPayV3.Test.net8.csproj | 5 - .../appsettings.json | 2 + .../Apis/BasePay/BasePayApis.cs | 15 +- .../Apis/Profitsharing/ProfitsharingApis.cs | 28 ++- .../Senparc.Weixin.TenPayV3/Enums.cs | 5 +- .../Helpers/SecurityHelper.cs | 175 +++++++++++++----- .../SenparcWeixinSettingItem.Interfaces.cs | 12 ++ .../SenparcWeixinSettingItem.cs | 44 ++++- .../Helpers/TenPay/TenPayHelper.cs | 24 +++ 9 files changed, 246 insertions(+), 64 deletions(-) diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/Senparc.Weixin.TenPayV3.Test.net8.csproj b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/Senparc.Weixin.TenPayV3.Test.net8.csproj index 0b00522295..e9b023f2fc 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/Senparc.Weixin.TenPayV3.Test.net8.csproj +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/Senparc.Weixin.TenPayV3.Test.net8.csproj @@ -18,11 +18,6 @@ true PreserveNewest - - PreserveNewest - true - PreserveNewest - PreserveNewest true diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json index d5cecc784d..332d7ca1b0 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json @@ -72,6 +72,8 @@ "TenPayV3_PrivateKey": "#{TenPayV3_PrivateKey}#", //(新)证书私钥 "TenPayV3_SerialNumber": "#{TenPayV3_SerialNumber}#", //(新)证书序列号 "TenPayV3_ApiV3Key": "#{TenPayV3_APIv3Key}#", //(新)APIv3 密钥 + "TenPayV3_WeixinPubKey": "#{TenPayV3_WeixinPubKey}#", // (新)微信支付公钥证书-验证微信支付身份,支持路径/网络路径/字符串,空则代表使用原来的平台证书,如:D:\\cert\\cert.pem + "TenPayV3_WeixinPubKeySerialNo": "#{TenPayV3_WeixinPubKeySerialNo}#", // (新)微信支付公钥ID-验证微信支付身份,空则代表使用原来的平台证书,如PUB_KEY_ID_0000000000000000000000 //如果不设置TenPayV3_WxOpenTenpayNotify,默认在 TenPayV3_TenpayNotify 的值最后加上 "WxOpen" "TenPayV3_WxOpenTenpayNotify": "#{TenPayV3_WxOpenTenpayNotify}#", //http://YourDomainName/TenpayV3/PayNotifyUrlWxOpen //开放平台 diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs index 627e5ef2f1..3c93040ef7 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs @@ -118,7 +118,7 @@ internal static string GetPayApiUrl(string urlFormat, string sp_mchid = "") /// public async Task CertificatesAsync(string algorithmType = "RSA", int timeOut = Config.TIME_OUT) { - var url = BasePayApis.GetPayApiUrl(Senparc.Weixin.Config.TenPayV3Host + "/{0}v3/certificates?algorithm_type=" + algorithmType); + var url = GetPayApiUrl(Senparc.Weixin.Config.TenPayV3Host + "/{0}v3/certificates?algorithm_type=" + algorithmType); TenPayApiRequest tenPayApiRequest = new(_tenpayV3Setting); //var responseMessge = await tenPayApiRequest.GetHttpResponseMessageAsync(url, null, timeOut); //return await responseMessge.Content.ReadAsStringAsync(); @@ -132,7 +132,15 @@ public async Task CertificatesAsync(string algorithmType /// public async Task GetPublicKeysAsync(/*int timeOut = Config.TIME_OUT*/) { - string algorithmType = _tenpayV3Setting.EncryptionType == CertType.SM.ToString() ? "SM2" : "RSA"; + PublicKeyCollection keys = new(); + + if (_tenpayV3Setting.TenPayV3_WeixinPubKeyEnable) + { + keys[_tenpayV3Setting.TenPayV3_WeixinPubKeySerialNo] = SecurityHelper.GetUnwrapCertKey(_tenpayV3Setting.TenPayV3_WeixinPubKey); + return keys; + } + + var algorithmType = _tenpayV3Setting.EncryptionType == CertType.SM.ToString() ? "SM2" : "RSA"; var certificates = await CertificatesAsync(algorithmType); if (!certificates.ResultCode.Success) { @@ -144,12 +152,11 @@ public async Task GetPublicKeysAsync(/*int timeOut = Config throw new TenpayApiRequestException("Certificates 获取结果为空"); } - PublicKeyCollection keys = new(); //var tenpayV3Setting = Senparc.Weixin.Config.SenparcWeixinSetting.TenpayV3Setting;//TODO:改成从构造函数配置 foreach (var cert in certificates.data) { - if(cert.encrypt_certificate.algorithm == "AEAD_AES_256_GCM") + if (cert.encrypt_certificate.algorithm == "AEAD_AES_256_GCM") { var publicKey = SecurityHelper.AesGcmDecryptCiphertext(_tenpayV3Setting.TenPayV3_APIv3Key, cert.encrypt_certificate.nonce, cert.encrypt_certificate.associated_data, cert.encrypt_certificate.ciphertext); diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/ProfitsharingApis.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/ProfitsharingApis.cs index 63b3b7ef4b..6f0c601e74 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/ProfitsharingApis.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/ProfitsharingApis.cs @@ -111,18 +111,24 @@ public async Task CreateProfitsharingAsync(Create // name加密 var basePayApis = new BasePayApis(); - - string algorithmType = _tenpayV3Setting.EncryptionType == CertType.SM.ToString() ? "SM2" : "RSA"; - var certificateResponse = await basePayApis.CertificatesAsync(algorithmType); + var publicKeys = await basePayApis.GetPublicKeysAsync(); + var publicKeyKv = publicKeys.FirstOrDefault(); foreach (var each in data.receivers) { - SecurityHelper.FieldEncrypt(each, certificateResponse, _tenpayV3Setting.TenPayV3_APIv3Key, _tenpayV3Setting.EncryptionType); + SecurityHelper.FieldEncrypt(each, publicKeyKv.Value, _tenpayV3Setting.EncryptionType, _tenpayV3Setting.TenPayV3_WeixinPubKeyEnable); } + //string algorithmType = _tenpayV3Setting.EncryptionType == CertType.SM.ToString() ? "SM2" : "RSA"; + //var certificateResponse = await basePayApis.CertificatesAsync(algorithmType); + //foreach (var each in data.receivers) + //{ + // SecurityHelper.FieldEncrypt(each, certificateResponse, _tenpayV3Setting.TenPayV3_APIv3Key, _tenpayV3Setting.EncryptionType); + //} + var url = ReurnPayApiUrl(Senparc.Weixin.Config.TenPayV3Host + "/{0}v3/{1}profitsharing/orders", data.brand_mchid); TenPayApiRequest tenPayApiRequest = new(_tenpayV3Setting, httpClient => { - httpClient.DefaultRequestHeaders.Add("Wechatpay-Serial", certificateResponse.data?.FirstOrDefault()?.serial_no); + httpClient.DefaultRequestHeaders.Add("Wechatpay-Serial", publicKeyKv.Key); }); return await tenPayApiRequest.RequestAsync(url, data, timeOut); } @@ -316,14 +322,18 @@ public async Task AddProfitsharingReceiverAs // name加密 var basePayApis = new BasePayApis(); - string algorithmType = _tenpayV3Setting.EncryptionType == CertType.SM.ToString() ? "SM2" : "RSA"; - var certificateResponse = await basePayApis.CertificatesAsync(algorithmType); - SecurityHelper.FieldEncrypt(data, certificateResponse, _tenpayV3Setting.TenPayV3_APIv3Key, _tenpayV3Setting.EncryptionType); + var publicKeys = await basePayApis.GetPublicKeysAsync(); + var publicKeyKv = publicKeys.FirstOrDefault(); + SecurityHelper.FieldEncrypt(data, publicKeyKv.Value, _tenpayV3Setting.EncryptionType, _tenpayV3Setting.TenPayV3_WeixinPubKeyEnable); + + //string algorithmType = _tenpayV3Setting.EncryptionType == CertType.SM.ToString() ? "SM2" : "RSA"; + //var certificateResponse = await basePayApis.CertificatesAsync(algorithmType); + //SecurityHelper.FieldEncrypt(data, certificateResponse, _tenpayV3Setting.TenPayV3_APIv3Key, _tenpayV3Setting.EncryptionType); var url = ReurnPayApiUrl(Senparc.Weixin.Config.TenPayV3Host + "/{0}v3/{1}profitsharing/receivers/add", data.brand_mchid); TenPayApiRequest tenPayApiRequest = new(_tenpayV3Setting, httpClient => { - httpClient.DefaultRequestHeaders.Add("Wechatpay-Serial", certificateResponse.data?.FirstOrDefault()?.serial_no); + httpClient.DefaultRequestHeaders.Add("Wechatpay-Serial", publicKeyKv.Key); }); return await tenPayApiRequest.RequestAsync(url, data, timeOut); } diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Enums.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Enums.cs index 67186935cc..6fce1d1bd0 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Enums.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Enums.cs @@ -62,6 +62,9 @@ public enum ApiRequestMethod public enum CertType { RSA, - SM + SM, + + PUBKEY_RSA, + PUBKEY_SM } } diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/SecurityHelper.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/SecurityHelper.cs index fea264bc0f..2bb226d563 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/SecurityHelper.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/SecurityHelper.cs @@ -35,6 +35,7 @@ and limitations under the License. using Org.BouncyCastle.Crypto.Engines; using Org.BouncyCastle.Crypto.Modes; using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Security; using Senparc.CO2NET.Helpers; using Senparc.Weixin.TenPayV3.Apis; using Senparc.Weixin.TenPayV3.Apis.BasePay; @@ -47,6 +48,7 @@ and limitations under the License. using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; +using System.Xml; namespace Senparc.Weixin.TenPayV3.Helpers { @@ -76,47 +78,31 @@ public static string GetUnwrapCertKey(string originalPublicKey) } /// - /// 敏感信息加密需要从https://api.mch.weixin.qq.com/risk/getcertficates此接口下载加密证书进行下一步加密, - /// 该接口下载到的是密文,使用此AESGCM.Decrypt()方法解密得到证书明文 + /// 加密敏感信息,传入明文和从微信支付获取到的敏感信息加密公钥,事先使用OpenSSL转换cert.pem文件输出为der文件 /// - /// - /// + /// + /// /// + /// 是否是微信支付公钥 /// - public static string GetPublicKey(Encrypt_Certificate encryptCertificate, string apiV3Key, string encryptionType) + public static string Encrypt(string text, string publicKey, string encryptionType, bool isWeixinPubKey = false) { - if (encryptionType == CertType.SM.ToString()) - { - return GmHelper.Sm4DecryptGCM(apiV3Key, encryptCertificate.nonce, "certificate", encryptCertificate.ciphertext); - } - else + #region 基于微信支付公钥 + if (isWeixinPubKey) { - var buff = Convert.FromBase64String(encryptCertificate.ciphertext); - var secret = Encoding.UTF8.GetBytes(apiV3Key); - var nonce = Encoding.UTF8.GetBytes(encryptCertificate.nonce); - var associatedData = Encoding.UTF8.GetBytes("certificate"); - - // 算法 AEAD_AES_256_GCM,C# 环境使用 BouncyCastle.Crypto.dll 类库实现 - var cipher = new GcmBlockCipher(new AesEngine()); - var aead = new AeadParameters(new KeyParameter(secret), 128, nonce, associatedData); - cipher.Init(false, aead); + var publicKeyParam = (RsaKeyParameters)PublicKeyFactory.CreateKey(Convert.FromBase64String(publicKey)); + var publicKeyXml = string.Format("{0}{1}", + Convert.ToBase64String(publicKeyParam.Modulus.ToByteArrayUnsigned()), + Convert.ToBase64String(publicKeyParam.Exponent.ToByteArrayUnsigned())); - var data = new byte[cipher.GetOutputSize(buff.Length)]; - var num = cipher.ProcessBytes(buff, 0, buff.Length, data, 0); - cipher.DoFinal(data, num); - return Encoding.UTF8.GetString(data); + var rsa = new RSACryptoServiceProvider(); + RSAFromXmlString(rsa, publicKeyXml); + var buff = rsa.Encrypt(Encoding.UTF8.GetBytes(text), RSAEncryptionPadding.OaepSHA1); + return Convert.ToBase64String(buff); } - } + #endregion + - /// - /// 加密敏感信息,传入明文和从微信支付获取到的敏感信息加密公钥,事先使用OpenSSL转换cert.pem文件输出为der文件 - /// - /// - /// - /// - /// - public static string Encrypt(string text, string publicKey, string encryptionType) - { if (encryptionType == CertType.SM.ToString()) { ECPublicKeyParameters eCPublicKeyParameters = SMPemHelper.LoadPublicKeyToParameters(Encoding.UTF8.GetBytes(publicKey)); @@ -137,7 +123,8 @@ public static string Encrypt(string text, string publicKey, string encryptionTyp /// /// /// - public static void FieldEncrypt(object request, string publicKey, string encryptionType) + /// 是否是微信支付公钥 + public static void FieldEncrypt(object request, string publicKey, string encryptionType, bool isWeixinPubKey = false) { var pis = request.GetType().GetProperties(); foreach (var pi in pis) @@ -148,14 +135,14 @@ public static void FieldEncrypt(object request, string publicKey, string encrypt if (!(pi.PropertyType.IsValueType || pi.PropertyType.Name.StartsWith("String") || typeof(IEnumerable).IsAssignableFrom(pi.PropertyType))) { - FieldEncrypt(value, publicKey, encryptionType); + FieldEncrypt(value, publicKey, encryptionType, isWeixinPubKey); continue; } if ((pi.GetCustomAttributes(typeof(FieldEncryptAttribute), true)?.Count() ?? 0) <= 0) continue; - var encryptValue = Encrypt(value.ToString(), publicKey, encryptionType); + var encryptValue = Encrypt(value.ToString(), publicKey, encryptionType, isWeixinPubKey); pi.SetValue(request, encryptValue); } } @@ -168,6 +155,24 @@ public static void FieldEncrypt(object request, string publicKey, string encrypt /// /// /// + [Obsolete("放弃使用")] + public static async Task FieldEncryptAsync(object request, string apiV3Key, string encryptionType) + { + // name 敏感信息加密 + var basePayApis = new BasePayApis(); + var certificate = await basePayApis.CertificatesAsync(); + FieldEncrypt(request, certificate, apiV3Key, encryptionType); + } + + /// + /// 字段加密 + /// + /// + /// + /// + /// + /// + [Obsolete("放弃使用")] public static void FieldEncrypt(object request, CertificatesResultJson certificate, string apiV3Key, string encryptionType) { if (!(certificate?.ResultCode?.Success ?? false)) @@ -179,19 +184,101 @@ public static void FieldEncrypt(object request, CertificatesResultJson certifica } /// - /// 字段加密 + /// 敏感信息加密需要从https://api.mch.weixin.qq.com/risk/getcertficates此接口下载加密证书进行下一步加密, + /// 该接口下载到的是密文,使用此AESGCM.Decrypt()方法解密得到证书明文 /// - /// + /// /// /// /// - /// - public static async Task FieldEncryptAsync(object request, string apiV3Key, string encryptionType) + public static string GetPublicKey(Encrypt_Certificate encryptCertificate, string apiV3Key, string encryptionType) { - // name 敏感信息加密 - var basePayApis = new BasePayApis(); - var certificate = await basePayApis.CertificatesAsync(); - FieldEncrypt(request, certificate, apiV3Key, encryptionType); + if (encryptionType == CertType.SM.ToString()) + { + return GmHelper.Sm4DecryptGCM(apiV3Key, encryptCertificate.nonce, "certificate", encryptCertificate.ciphertext); + } + else + { + var buff = Convert.FromBase64String(encryptCertificate.ciphertext); + var secret = Encoding.UTF8.GetBytes(apiV3Key); + var nonce = Encoding.UTF8.GetBytes(encryptCertificate.nonce); + var associatedData = Encoding.UTF8.GetBytes("certificate"); + + // 算法 AEAD_AES_256_GCM,C# 环境使用 BouncyCastle.Crypto.dll 类库实现 + var cipher = new GcmBlockCipher(new AesEngine()); + var aead = new AeadParameters(new KeyParameter(secret), 128, nonce, associatedData); + cipher.Init(false, aead); + + var data = new byte[cipher.GetOutputSize(buff.Length)]; + var num = cipher.ProcessBytes(buff, 0, buff.Length, data, 0); + cipher.DoFinal(data, num); + return Encoding.UTF8.GetString(data); + } + } + + #region Private Method + public static void RSAFromXmlString(RSA rsa, string xmlString) + { + var parameters = new RSAParameters(); + var xmlDoc = new XmlDocument(); + xmlDoc.LoadXml(xmlString); + + if (xmlDoc.DocumentElement.Name.Equals("RSAKeyValue")) + { + foreach (XmlNode node in xmlDoc.DocumentElement.ChildNodes) + { + switch (node.Name) + { + case "Modulus": + parameters.Modulus = (string.IsNullOrEmpty(node.InnerText) + ? null + : Convert.FromBase64String(node.InnerText)); + break; + case "Exponent": + parameters.Exponent = (string.IsNullOrEmpty(node.InnerText) + ? null + : Convert.FromBase64String(node.InnerText)); + break; + case "P": + parameters.P = (string.IsNullOrEmpty(node.InnerText) + ? null + : Convert.FromBase64String(node.InnerText)); + break; + case "Q": + parameters.Q = (string.IsNullOrEmpty(node.InnerText) + ? null + : Convert.FromBase64String(node.InnerText)); + break; + case "DP": + parameters.DP = (string.IsNullOrEmpty(node.InnerText) + ? null + : Convert.FromBase64String(node.InnerText)); + break; + case "DQ": + parameters.DQ = (string.IsNullOrEmpty(node.InnerText) + ? null + : Convert.FromBase64String(node.InnerText)); + break; + case "InverseQ": + parameters.InverseQ = (string.IsNullOrEmpty(node.InnerText) + ? null + : Convert.FromBase64String(node.InnerText)); + break; + case "D": + parameters.D = (string.IsNullOrEmpty(node.InnerText) + ? null + : Convert.FromBase64String(node.InnerText)); + break; + } + } + } + else + { + throw new Exception("Invalid XML RSA key."); + } + + rsa.ImportParameters(parameters); } + #endregion } } diff --git a/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.Interfaces.cs b/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.Interfaces.cs index 023b7cf1a3..c4a6640cc8 100644 --- a/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.Interfaces.cs +++ b/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.Interfaces.cs @@ -223,6 +223,18 @@ public interface ISenparcWeixinSettingForTenpayV3 : ISenparcWeixinSettingBase /// string TenPayV3_APIv3Key { get; set; } + /// + /// 微信支付(V3)微信平台公钥(替换平台证书) + /// + string TenPayV3_WeixinPubKey { get; set; } + /// + /// 微信支付(V3)微信平台公钥ID(替换平台证书) + /// + string TenPayV3_WeixinPubKeySerialNo { get; set; } + /// + /// 微信支付(V3)微信平台公钥 启动 + /// + bool TenPayV3_WeixinPubKeyEnable { get; set; } #endregion /// diff --git a/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs b/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs index 113b248984..445c008d5c 100644 --- a/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs +++ b/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs @@ -131,6 +131,9 @@ public SenparcWeixinSettingItem(ISenparcWeixinSettingForTenpayV3 setting, bool i TenPayV3_APIv3Key = setting.TenPayV3_APIv3Key; TenPayV3_PrivateKey = setting.TenPayV3_PrivateKey; TenPayV3_SerialNumber = setting.TenPayV3_SerialNumber; + + TenPayV3_WeixinPubKey = setting.TenPayV3_WeixinPubKey; + TenPayV3_WxOpenTenpayNotify = setting.TenPayV3_WxOpenTenpayNotify; } @@ -321,7 +324,46 @@ public virtual string TenPayV3_PrivateKey /// /// APIv3 密钥。在微信支付后台设置:https://pay.weixin.qq.com/index.php/core/cert/api_cert#/ /// - public string TenPayV3_APIv3Key { get; set; } + public virtual string TenPayV3_APIv3Key { get; set; } + + + private string _tenPayV3_PubKey; + /// + /// 微信支付(V3)公钥证书(替换平台证书) + /// + public virtual string TenPayV3_WeixinPubKey + { + get + { + return TenPayHelper.TryGetPublicKeyFromFile(ref _tenPayV3_PubKey); + } + set + { + + _tenPayV3_PrivateKey = value; + } + } + + /// + /// 微信支付(V3)公钥证书序列号(替换平台证书) + /// + public virtual string TenPayV3_WeixinPubKeySerialNo { get; set; } + + /// + /// 微信支付(V3)公钥证书 是否启用 + /// + public virtual bool TenPayV3_WeixinPubKeyEnable + { + get + { + return !string.IsNullOrWhiteSpace(TenPayV3_WeixinPubKey) && !string.IsNullOrWhiteSpace(TenPayV3_WeixinPubKeySerialNo); + } + set + { + throw new Exception($"自动获取,无法生成"); + } + + } #endregion /// diff --git a/src/Senparc.Weixin/Senparc.Weixin/Helpers/TenPay/TenPayHelper.cs b/src/Senparc.Weixin/Senparc.Weixin/Helpers/TenPay/TenPayHelper.cs index 452794b0c9..6be9be0de0 100644 --- a/src/Senparc.Weixin/Senparc.Weixin/Helpers/TenPay/TenPayHelper.cs +++ b/src/Senparc.Weixin/Senparc.Weixin/Helpers/TenPay/TenPayHelper.cs @@ -84,5 +84,29 @@ public static string TryGetPrivateKeyFromFile(ref string tenPayV3_PrivateKey) } return tenPayV3_PrivateKey; } + + /// + /// 尝试从文件获取正确格式的私钥 + /// + /// + public static string TryGetPublicKeyFromFile(ref string tenPayV3_PubKey) + { + if (tenPayV3_PubKey != null && tenPayV3_PubKey.Length < 100 && tenPayV3_PubKey.StartsWith("~/")) + { + //虚拟路径 + //尝试读取文件 + var filePath = CO2NET.Utilities.ServerUtility.ContentRootMapPath(tenPayV3_PubKey); + if (!File.Exists(filePath)) + { + Senparc.Weixin.WeixinTrace.BaseExceptionLog(new WeixinException("TenPayV3_PubKey 证书文件不存在!" + filePath)); + } + + var fileContent = File.ReadAllText(filePath); + Regex regex = new Regex(@"(--([^\r\n])+--[\r\n]{0,1})|[\r\n]"); + var publicKey = regex.Replace(fileContent, ""); + tenPayV3_PubKey = publicKey; + } + return tenPayV3_PubKey; + } } } From 8a891aa13ad1a4613e2f9b935b0dca44c49f459b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=83=BD?= Date: Thu, 28 Nov 2024 13:21:17 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=80=9A=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Apis/Profitsharing/ProfitsharingApisTest.cs | 1 + .../SenparcWeixinSettingItem.cs | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/Apis/Profitsharing/ProfitsharingApisTest.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/Apis/Profitsharing/ProfitsharingApisTest.cs index db21f9914d..625da8f556 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/Apis/Profitsharing/ProfitsharingApisTest.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/Apis/Profitsharing/ProfitsharingApisTest.cs @@ -12,6 +12,7 @@ namespace Senparc.Weixin.TenPayV3.Test.net6.Apis { + [TestClass()] public class ProfitsharingApisTest : BaseTenPayTest { #region 分账接口 diff --git a/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs b/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs index 445c008d5c..5a6a9449e7 100644 --- a/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs +++ b/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs @@ -327,7 +327,7 @@ public virtual string TenPayV3_PrivateKey public virtual string TenPayV3_APIv3Key { get; set; } - private string _tenPayV3_PubKey; + private string _tenPayV3_WeixinPubKey; /// /// 微信支付(V3)公钥证书(替换平台证书) /// @@ -335,12 +335,11 @@ public virtual string TenPayV3_WeixinPubKey { get { - return TenPayHelper.TryGetPublicKeyFromFile(ref _tenPayV3_PubKey); + return TenPayHelper.TryGetPublicKeyFromFile(ref _tenPayV3_WeixinPubKey); } set { - - _tenPayV3_PrivateKey = value; + _tenPayV3_WeixinPubKey = value; } } @@ -358,10 +357,7 @@ public virtual bool TenPayV3_WeixinPubKeyEnable { return !string.IsNullOrWhiteSpace(TenPayV3_WeixinPubKey) && !string.IsNullOrWhiteSpace(TenPayV3_WeixinPubKeySerialNo); } - set - { - throw new Exception($"自动获取,无法生成"); - } + set { } } #endregion From 76bdea128c28765e4a771888e645cf7f6ecf9cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=83=BD?= Date: Thu, 28 Nov 2024 13:21:54 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Senparc.Weixin.TenPayV3.Test/appsettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json index 332d7ca1b0..4696012659 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json @@ -72,7 +72,7 @@ "TenPayV3_PrivateKey": "#{TenPayV3_PrivateKey}#", //(新)证书私钥 "TenPayV3_SerialNumber": "#{TenPayV3_SerialNumber}#", //(新)证书序列号 "TenPayV3_ApiV3Key": "#{TenPayV3_APIv3Key}#", //(新)APIv3 密钥 - "TenPayV3_WeixinPubKey": "#{TenPayV3_WeixinPubKey}#", // (新)微信支付公钥证书-验证微信支付身份,支持路径/网络路径/字符串,空则代表使用原来的平台证书,如:D:\\cert\\cert.pem + "TenPayV3_WeixinPubKey": "#{TenPayV3_WeixinPubKey}#", // (新)微信支付公钥证书-验证微信支付身份,支持本地项目路径/字符串,空则代表使用原来的平台证书,如:D:\\cert\\cert.pem "TenPayV3_WeixinPubKeySerialNo": "#{TenPayV3_WeixinPubKeySerialNo}#", // (新)微信支付公钥ID-验证微信支付身份,空则代表使用原来的平台证书,如PUB_KEY_ID_0000000000000000000000 //如果不设置TenPayV3_WxOpenTenpayNotify,默认在 TenPayV3_TenpayNotify 的值最后加上 "WxOpen" "TenPayV3_WxOpenTenpayNotify": "#{TenPayV3_WxOpenTenpayNotify}#", //http://YourDomainName/TenpayV3/PayNotifyUrlWxOpen From 90abdaffd204146917add98e04c939b6ebc808f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=83=BD?= Date: Thu, 28 Nov 2024 13:46:02 +0800 Subject: [PATCH 06/11] =?UTF-8?q?=E5=93=8D=E5=BA=94=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=AA=8C=E7=AD=BE=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Helpers/SecurityHelper.cs | 2 - .../Helpers/TenPaySignHelper.cs | 39 ++++++++++++++++--- .../HttpHandlers/TenPayApiRequest.cs | 4 +- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/SecurityHelper.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/SecurityHelper.cs index 2bb226d563..d371f09efc 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/SecurityHelper.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/SecurityHelper.cs @@ -216,7 +216,6 @@ public static string GetPublicKey(Encrypt_Certificate encryptCertificate, string } } - #region Private Method public static void RSAFromXmlString(RSA rsa, string xmlString) { var parameters = new RSAParameters(); @@ -279,6 +278,5 @@ public static void RSAFromXmlString(RSA rsa, string xmlString) rsa.ImportParameters(parameters); } - #endregion } } diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs index 76f3745305..9570950ebd 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs @@ -37,6 +37,7 @@ and limitations under the License. using Org.BouncyCastle.Crypto.Parameters; +using Org.BouncyCastle.Security; using Senparc.Weixin.Entities; using Senparc.Weixin.Helpers; using System; @@ -127,18 +128,44 @@ public static string CreatePaySign(string timeStamp, string nonceStr, string pac /// HTTP头中的应答随机串 /// HTTP头中的应答签名(Base64) /// 应答报文主体 - /// 平台公钥(必须是Unwrap的公钥) + /// 平台公钥/微信支付公钥(必须是Unwrap的公钥) + /// 是否是微信支付公钥 /// - public static bool VerifyTenpaySign(string wechatpayTimestamp, string wechatpayNonce, string wechatpaySignatureBase64, string content, string pubKey) + public static bool VerifyTenpaySign(string wechatpayTimestamp, string wechatpayNonce, string wechatpaySignatureBase64, string content, string pubKey, bool isWeixinPubKey = false) { //验签名串 - string contentForSign = $"{wechatpayTimestamp}\n{wechatpayNonce}\n{content}\n"; + var contentForSign = $"{wechatpayTimestamp}\n{wechatpayNonce}\n{content}\n"; - if(Senparc.Weixin.Config.SenparcWeixinSetting.EncryptionType == CertType.SM.ToString()) + if (isWeixinPubKey) + { + var publicKeyParam = (RsaKeyParameters)PublicKeyFactory.CreateKey(Convert.FromBase64String(pubKey)); + var publicKeyXml = string.Format("{0}{1}", + Convert.ToBase64String(publicKeyParam.Modulus.ToByteArrayUnsigned()), + Convert.ToBase64String(publicKeyParam.Exponent.ToByteArrayUnsigned())); + + var rsa = new RSACryptoServiceProvider(); + SecurityHelper.RSAFromXmlString(rsa, publicKeyXml); + + //RSAPKCS1SignatureDeformatter 对象 + RSAPKCS1SignatureDeformatter df = new RSAPKCS1SignatureDeformatter(rsa); + //指定 SHA256 + df.SetHashAlgorithm("SHA256"); + //SHA256Managed 方法已弃用,使用 SHA256.Create() 生成 SHA256 对象 + var sha256 = SHA256.Create(); + //应答签名 + byte[] signature = Convert.FromBase64String(wechatpaySignatureBase64); + //对比签名 + byte[] compareByte = sha256.ComputeHash(Encoding.UTF8.GetBytes(contentForSign)); + //验证签名 + var result = df.VerifySignature(compareByte, signature); + return result; + } + + + if (Senparc.Weixin.Config.SenparcWeixinSetting.EncryptionType == CertType.SM.ToString()) { byte[] pubKeyBytes = Convert.FromBase64String(pubKey); ECPublicKeyParameters eCPublicKeyParameters = SMPemHelper.LoadPublicKeyToParameters(pubKeyBytes); - return GmHelper.VerifySm3WithSm2(eCPublicKeyParameters, contentForSign, wechatpaySignatureBase64); } else @@ -184,7 +211,7 @@ public static async Task VerifyTenpaySign(string wechatpayTimestamp, strin var tenpayV3InfoKey = TenPayHelper.GetRegisterKey(senparcWeixinSettingForTenpayV3.TenPayV3_MchId, senparcWeixinSettingForTenpayV3.TenPayV3_SubMchId); var pubKey = await TenPayV3InfoCollection.Data[tenpayV3InfoKey].GetPublicKeyAsync(serialNumber, senparcWeixinSettingForTenpayV3); - return VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignature, content, pubKey); + return VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignature, content, pubKey, senparcWeixinSettingForTenpayV3.TenPayV3_WeixinPubKeyEnable); } /// diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs index d54d243ab2..7afb8c2954 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs @@ -231,7 +231,7 @@ public async Task RequestAsync(string url, object data, int timeOut = Conf try { var pubKey = await TenPayV3InfoCollection.GetAPIv3PublicKeyAsync(this._tenpayV3Setting, wechatpaySerial); - if(this._tenpayV3Setting.EncryptionType == CertType.SM.ToString()) + if (this._tenpayV3Setting.EncryptionType == CertType.SM.ToString()) { byte[] pubKeyBytes = Convert.FromBase64String(pubKey); ECPublicKeyParameters eCPublicKeyParameters = SMPemHelper.LoadPublicKeyToParameters(pubKeyBytes); @@ -243,7 +243,7 @@ public async Task RequestAsync(string url, object data, int timeOut = Conf } else { - result.VerifySignSuccess = TenPaySignHelper.VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignatureBase64, content, pubKey); + result.VerifySignSuccess = TenPaySignHelper.VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignatureBase64, content, pubKey, _tenpayV3Setting.TenPayV3_WeixinPubKeyEnable); } } catch (Exception ex) From 7aac180e98d021ca70e53a09b5d86e023bcb8a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9A=E7=83=BD?= Date: Fri, 29 Nov 2024 17:16:59 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=85=8D=E7=BD=AETenPa?= =?UTF-8?q?yV3=5FPubKey=E7=9A=84Key=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Senparc.Weixin.TenPayV3.Test/appsettings.json | 4 ++-- .../Apis/BasePay/BasePayApis.cs | 4 ++-- .../Apis/Profitsharing/ProfitsharingApis.cs | 4 ++-- .../Helpers/TenPaySignHelper.cs | 8 ++++---- .../HttpHandlers/TenPayApiRequest.cs | 2 +- .../SenparcWeixinSettingItem.Interfaces.cs | 6 +++--- .../SenparcWeixinSettings/SenparcWeixinSettingItem.cs | 10 +++++----- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json index 4696012659..2dc4d0f689 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3.Test/appsettings.json @@ -72,8 +72,8 @@ "TenPayV3_PrivateKey": "#{TenPayV3_PrivateKey}#", //(新)证书私钥 "TenPayV3_SerialNumber": "#{TenPayV3_SerialNumber}#", //(新)证书序列号 "TenPayV3_ApiV3Key": "#{TenPayV3_APIv3Key}#", //(新)APIv3 密钥 - "TenPayV3_WeixinPubKey": "#{TenPayV3_WeixinPubKey}#", // (新)微信支付公钥证书-验证微信支付身份,支持本地项目路径/字符串,空则代表使用原来的平台证书,如:D:\\cert\\cert.pem - "TenPayV3_WeixinPubKeySerialNo": "#{TenPayV3_WeixinPubKeySerialNo}#", // (新)微信支付公钥ID-验证微信支付身份,空则代表使用原来的平台证书,如PUB_KEY_ID_0000000000000000000000 + "TenPayV3_TenPayPubKey": "#{TenPayV3_TenPayPubKey}#", // (新)微信支付公钥证书-验证微信支付身份,支持本地项目路径/字符串,空则代表使用原来的平台证书,如:D:\\cert\\cert.pem + "TenPayV3_TenPayPubKeyID": "#{TenPayV3_TenPayPubKeyID}#", // (新)微信支付公钥ID-验证微信支付身份,空则代表使用原来的平台证书,如PUB_KEY_ID_0000000000000000000000 //如果不设置TenPayV3_WxOpenTenpayNotify,默认在 TenPayV3_TenpayNotify 的值最后加上 "WxOpen" "TenPayV3_WxOpenTenpayNotify": "#{TenPayV3_WxOpenTenpayNotify}#", //http://YourDomainName/TenpayV3/PayNotifyUrlWxOpen //开放平台 diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs index 3c93040ef7..b049924766 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/BasePay/BasePayApis.cs @@ -134,9 +134,9 @@ public async Task GetPublicKeysAsync(/*int timeOut = Config { PublicKeyCollection keys = new(); - if (_tenpayV3Setting.TenPayV3_WeixinPubKeyEnable) + if (_tenpayV3Setting.TenPayV3_TenPayPubKeyEnable) { - keys[_tenpayV3Setting.TenPayV3_WeixinPubKeySerialNo] = SecurityHelper.GetUnwrapCertKey(_tenpayV3Setting.TenPayV3_WeixinPubKey); + keys[_tenpayV3Setting.TenPayV3_TenPayPubKeyID] = SecurityHelper.GetUnwrapCertKey(_tenpayV3Setting.TenPayV3_TenPayPubKey); return keys; } diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/ProfitsharingApis.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/ProfitsharingApis.cs index 6f0c601e74..e24d7f92db 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/ProfitsharingApis.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Apis/Profitsharing/ProfitsharingApis.cs @@ -115,7 +115,7 @@ public async Task CreateProfitsharingAsync(Create var publicKeyKv = publicKeys.FirstOrDefault(); foreach (var each in data.receivers) { - SecurityHelper.FieldEncrypt(each, publicKeyKv.Value, _tenpayV3Setting.EncryptionType, _tenpayV3Setting.TenPayV3_WeixinPubKeyEnable); + SecurityHelper.FieldEncrypt(each, publicKeyKv.Value, _tenpayV3Setting.EncryptionType, _tenpayV3Setting.TenPayV3_TenPayPubKeyEnable); } //string algorithmType = _tenpayV3Setting.EncryptionType == CertType.SM.ToString() ? "SM2" : "RSA"; @@ -324,7 +324,7 @@ public async Task AddProfitsharingReceiverAs var basePayApis = new BasePayApis(); var publicKeys = await basePayApis.GetPublicKeysAsync(); var publicKeyKv = publicKeys.FirstOrDefault(); - SecurityHelper.FieldEncrypt(data, publicKeyKv.Value, _tenpayV3Setting.EncryptionType, _tenpayV3Setting.TenPayV3_WeixinPubKeyEnable); + SecurityHelper.FieldEncrypt(data, publicKeyKv.Value, _tenpayV3Setting.EncryptionType, _tenpayV3Setting.TenPayV3_TenPayPubKeyEnable); //string algorithmType = _tenpayV3Setting.EncryptionType == CertType.SM.ToString() ? "SM2" : "RSA"; //var certificateResponse = await basePayApis.CertificatesAsync(algorithmType); diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs index 9570950ebd..e39dfa07de 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Helpers/TenPaySignHelper.cs @@ -129,14 +129,14 @@ public static string CreatePaySign(string timeStamp, string nonceStr, string pac /// HTTP头中的应答签名(Base64) /// 应答报文主体 /// 平台公钥/微信支付公钥(必须是Unwrap的公钥) - /// 是否是微信支付公钥 + /// 是否是微信支付公钥 /// - public static bool VerifyTenpaySign(string wechatpayTimestamp, string wechatpayNonce, string wechatpaySignatureBase64, string content, string pubKey, bool isWeixinPubKey = false) + public static bool VerifyTenpaySign(string wechatpayTimestamp, string wechatpayNonce, string wechatpaySignatureBase64, string content, string pubKey, bool isTenPayPubKey = false) { //验签名串 var contentForSign = $"{wechatpayTimestamp}\n{wechatpayNonce}\n{content}\n"; - if (isWeixinPubKey) + if (isTenPayPubKey) { var publicKeyParam = (RsaKeyParameters)PublicKeyFactory.CreateKey(Convert.FromBase64String(pubKey)); var publicKeyXml = string.Format("{0}{1}", @@ -211,7 +211,7 @@ public static async Task VerifyTenpaySign(string wechatpayTimestamp, strin var tenpayV3InfoKey = TenPayHelper.GetRegisterKey(senparcWeixinSettingForTenpayV3.TenPayV3_MchId, senparcWeixinSettingForTenpayV3.TenPayV3_SubMchId); var pubKey = await TenPayV3InfoCollection.Data[tenpayV3InfoKey].GetPublicKeyAsync(serialNumber, senparcWeixinSettingForTenpayV3); - return VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignature, content, pubKey, senparcWeixinSettingForTenpayV3.TenPayV3_WeixinPubKeyEnable); + return VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignature, content, pubKey, senparcWeixinSettingForTenpayV3.TenPayV3_TenPayPubKeyEnable); } /// diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs index 7afb8c2954..8c2303aea2 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/HttpHandlers/TenPayApiRequest.cs @@ -243,7 +243,7 @@ public async Task RequestAsync(string url, object data, int timeOut = Conf } else { - result.VerifySignSuccess = TenPaySignHelper.VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignatureBase64, content, pubKey, _tenpayV3Setting.TenPayV3_WeixinPubKeyEnable); + result.VerifySignSuccess = TenPaySignHelper.VerifyTenpaySign(wechatpayTimestamp, wechatpayNonce, wechatpaySignatureBase64, content, pubKey, _tenpayV3Setting.TenPayV3_TenPayPubKeyEnable); } } catch (Exception ex) diff --git a/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.Interfaces.cs b/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.Interfaces.cs index c4a6640cc8..bf4346c727 100644 --- a/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.Interfaces.cs +++ b/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.Interfaces.cs @@ -226,15 +226,15 @@ public interface ISenparcWeixinSettingForTenpayV3 : ISenparcWeixinSettingBase /// /// 微信支付(V3)微信平台公钥(替换平台证书) /// - string TenPayV3_WeixinPubKey { get; set; } + string TenPayV3_TenPayPubKey { get; set; } /// /// 微信支付(V3)微信平台公钥ID(替换平台证书) /// - string TenPayV3_WeixinPubKeySerialNo { get; set; } + string TenPayV3_TenPayPubKeyID { get; set; } /// /// 微信支付(V3)微信平台公钥 启动 /// - bool TenPayV3_WeixinPubKeyEnable { get; set; } + bool TenPayV3_TenPayPubKeyEnable { get; set; } #endregion /// diff --git a/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs b/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs index 5a6a9449e7..7ab5420f6c 100644 --- a/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs +++ b/src/Senparc.Weixin/Senparc.Weixin/Entities/SenparcWeixinSettings/SenparcWeixinSettingItem.cs @@ -132,7 +132,7 @@ public SenparcWeixinSettingItem(ISenparcWeixinSettingForTenpayV3 setting, bool i TenPayV3_PrivateKey = setting.TenPayV3_PrivateKey; TenPayV3_SerialNumber = setting.TenPayV3_SerialNumber; - TenPayV3_WeixinPubKey = setting.TenPayV3_WeixinPubKey; + TenPayV3_TenPayPubKey = setting.TenPayV3_TenPayPubKey; TenPayV3_WxOpenTenpayNotify = setting.TenPayV3_WxOpenTenpayNotify; } @@ -331,7 +331,7 @@ public virtual string TenPayV3_PrivateKey /// /// 微信支付(V3)公钥证书(替换平台证书) /// - public virtual string TenPayV3_WeixinPubKey + public virtual string TenPayV3_TenPayPubKey { get { @@ -346,16 +346,16 @@ public virtual string TenPayV3_WeixinPubKey /// /// 微信支付(V3)公钥证书序列号(替换平台证书) /// - public virtual string TenPayV3_WeixinPubKeySerialNo { get; set; } + public virtual string TenPayV3_TenPayPubKeyID { get; set; } /// /// 微信支付(V3)公钥证书 是否启用 /// - public virtual bool TenPayV3_WeixinPubKeyEnable + public virtual bool TenPayV3_TenPayPubKeyEnable { get { - return !string.IsNullOrWhiteSpace(TenPayV3_WeixinPubKey) && !string.IsNullOrWhiteSpace(TenPayV3_WeixinPubKeySerialNo); + return !string.IsNullOrWhiteSpace(TenPayV3_TenPayPubKey) && !string.IsNullOrWhiteSpace(TenPayV3_TenPayPubKeyID); } set { } From b4d60bf653a368eabd99d83a8f7948f2f5999d0b Mon Sep 17 00:00:00 2001 From: JeffreySu Date: Fri, 29 Nov 2024 18:30:32 +0800 Subject: [PATCH 08/11] =?UTF-8?q?=E6=B8=85=E7=90=86=E6=97=A7=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Senparc.WebSocket/Senparc.WebSocket.net8.csproj | 5 ----- src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj | 4 ---- 2 files changed, 9 deletions(-) diff --git a/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj b/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj index 26c017ce81..25dfef9086 100644 --- a/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj +++ b/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj @@ -104,17 +104,12 @@ - - - - - diff --git a/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj b/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj index 2121bb3a11..7fda696705 100644 --- a/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj +++ b/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj @@ -398,10 +398,6 @@ - - - - From d907cd92625258c555d5952b0e1f7c3c25e3d562 Mon Sep 17 00:00:00 2001 From: JeffreySu Date: Fri, 29 Nov 2024 18:47:47 +0800 Subject: [PATCH 09/11] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...arc.Weixin.Net8Sample.CommonService.csproj | 2 +- .../Senparc.Weixin.Sample.net8.csproj | 6 +-- .../Senparc.WebSocket.net8.csproj | 2 +- .../Senparc.Weixin.AspNet.net8.csproj | 2 +- .../Senparc.Weixin.Cache.CsRedis.net8.csproj | 2 +- .../Senparc.Weixin.Cache.Dapr.net8.csproj | 2 +- ...Senparc.Weixin.Cache.Memcached.net8.csproj | 2 +- .../Senparc.Weixin.Cache.Redis.net8.csproj | 2 +- .../Senparc.Weixin.MP.Middleware.net8.csproj | 2 +- ...Senparc.Weixin.MP.MvcExtension.net8.csproj | 2 +- .../AdvancedAPIs/Media/MediaApi.cs | 2 +- .../Senparc.Weixin.MP.net8.csproj | 6 +-- .../Senparc.Weixin.Open.net8.csproj | 2 +- .../Senparc.Weixin.TenPay.net8.csproj | 2 +- .../Senparc.Weixin.TenPayV3.net8.csproj | 2 +- ...Senparc.Weixin.Work.Middleware.net8.csproj | 2 +- .../AdvancedAPIs/Media/MediaApi.cs | 52 ++----------------- .../Senparc.Weixin.Work.net8.csproj | 2 +- ...nparc.Weixin.WxOpen.Middleware.net8.csproj | 2 +- .../Senparc.Weixin.WxOpen.Tests.net8.csproj | 2 +- .../Senparc.Weixin.WxOpen.net8.csproj | 2 +- .../Senparc.Weixin/Senparc.Weixin.net8.csproj | 4 +- .../Senparc.WeixinTests.net8.csproj | 2 +- 23 files changed, 32 insertions(+), 74 deletions(-) diff --git a/Samples/All/Senparc.Weixin.Sample.CommonService/Senparc.Weixin.Net8Sample.CommonService.csproj b/Samples/All/Senparc.Weixin.Sample.CommonService/Senparc.Weixin.Net8Sample.CommonService.csproj index 92de20afdd..462a208942 100644 --- a/Samples/All/Senparc.Weixin.Sample.CommonService/Senparc.Weixin.Net8Sample.CommonService.csproj +++ b/Samples/All/Senparc.Weixin.Sample.CommonService/Senparc.Weixin.Net8Sample.CommonService.csproj @@ -18,7 +18,7 @@ - + diff --git a/Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Senparc.Weixin.Sample.net8.csproj b/Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Senparc.Weixin.Sample.net8.csproj index 6da075e9cc..9ce0316929 100644 --- a/Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Senparc.Weixin.Sample.net8.csproj +++ b/Samples/All/net8-mvc/Senparc.Weixin.Sample.Net8/Senparc.Weixin.Sample.net8.csproj @@ -20,9 +20,9 @@ - - - + + + diff --git a/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj b/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj index 25dfef9086..7c98228e6f 100644 --- a/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj +++ b/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj @@ -109,7 +109,7 @@ - + diff --git a/src/Senparc.Weixin.AspNet/Senparc.Weixin.AspNet.net8.csproj b/src/Senparc.Weixin.AspNet/Senparc.Weixin.AspNet.net8.csproj index 9ad5496fd1..8fa66c4bf9 100644 --- a/src/Senparc.Weixin.AspNet/Senparc.Weixin.AspNet.net8.csproj +++ b/src/Senparc.Weixin.AspNet/Senparc.Weixin.AspNet.net8.csproj @@ -74,7 +74,7 @@ - + diff --git a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/Senparc.Weixin.Cache.CsRedis.net8.csproj b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/Senparc.Weixin.Cache.CsRedis.net8.csproj index 7153cf9006..bae851e467 100644 --- a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/Senparc.Weixin.Cache.CsRedis.net8.csproj +++ b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/Senparc.Weixin.Cache.CsRedis.net8.csproj @@ -61,7 +61,7 @@ - + diff --git a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/Senparc.Weixin.Cache.Dapr.net8.csproj b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/Senparc.Weixin.Cache.Dapr.net8.csproj index e8ddd769bf..7736455bd9 100644 --- a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/Senparc.Weixin.Cache.Dapr.net8.csproj +++ b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/Senparc.Weixin.Cache.Dapr.net8.csproj @@ -56,7 +56,7 @@ - + diff --git a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Senparc.Weixin.Cache.Memcached.net8.csproj b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Senparc.Weixin.Cache.Memcached.net8.csproj index 209ace594d..2c20ebeb61 100644 --- a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Senparc.Weixin.Cache.Memcached.net8.csproj +++ b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Senparc.Weixin.Cache.Memcached.net8.csproj @@ -143,7 +143,7 @@ - + diff --git a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/Senparc.Weixin.Cache.Redis.net8.csproj b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/Senparc.Weixin.Cache.Redis.net8.csproj index 8d86cb1305..e924fe8841 100644 --- a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/Senparc.Weixin.Cache.Redis.net8.csproj +++ b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/Senparc.Weixin.Cache.Redis.net8.csproj @@ -133,7 +133,7 @@ - + diff --git a/src/Senparc.Weixin.MP.Middleware/Senparc.Weixin.MP.Middleware.net8.csproj b/src/Senparc.Weixin.MP.Middleware/Senparc.Weixin.MP.Middleware.net8.csproj index 193ba75df2..262088e02d 100644 --- a/src/Senparc.Weixin.MP.Middleware/Senparc.Weixin.MP.Middleware.net8.csproj +++ b/src/Senparc.Weixin.MP.Middleware/Senparc.Weixin.MP.Middleware.net8.csproj @@ -72,7 +72,7 @@ - + diff --git a/src/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension.net8.csproj b/src/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension.net8.csproj index a33c4a3784..8039a1fb7a 100644 --- a/src/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension.net8.csproj +++ b/src/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension.net8.csproj @@ -148,7 +148,7 @@ - + diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaApi.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaApi.cs index 068fc07b2a..100141d473 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaApi.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/Media/MediaApi.cs @@ -590,7 +590,7 @@ public static async Task UploadTemporaryMediaAsync(s var url = string.Format(Config.ApiMpHost + "/cgi-bin/media/upload?access_token={0}&type={1}", accessToken.AsUrlData(), type.ToString().AsUrlData()); var fileDictionary = new Dictionary(); fileDictionary["media"] = file; - return await CO2NET.HttpUtility.Post.PostFileGetJsonAsync(CommonDI.CommonSP, url, null, fileDictionary, null, null, null, false, timeOut: timeOut).ConfigureAwait(false); + return await CO2NET.HttpUtility.Post.PostFileGetJsonAsync(CommonDI.CommonSP, url, null, fileDictionary, timeOut: timeOut).ConfigureAwait(false); }, accessTokenOrAppId).ConfigureAwait(false); } diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj index 114c42980e..fbb3ff8a52 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj @@ -576,9 +576,9 @@ - - - + + + diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj index 04549d48c1..66eedd5f64 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj @@ -270,7 +270,7 @@ - + diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.net8.csproj b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.net8.csproj index 633ea6672b..e0516c3213 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.net8.csproj +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.net8.csproj @@ -97,7 +97,7 @@ - + diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Senparc.Weixin.TenPayV3.net8.csproj b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Senparc.Weixin.TenPayV3.net8.csproj index 029ecd8adc..4035d308e4 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Senparc.Weixin.TenPayV3.net8.csproj +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Senparc.Weixin.TenPayV3.net8.csproj @@ -90,7 +90,7 @@ - + diff --git a/src/Senparc.Weixin.Work.Middleware/Senparc.Weixin.Work.Middleware.net8.csproj b/src/Senparc.Weixin.Work.Middleware/Senparc.Weixin.Work.Middleware.net8.csproj index 3cf9e470f1..8d1d39efa0 100644 --- a/src/Senparc.Weixin.Work.Middleware/Senparc.Weixin.Work.Middleware.net8.csproj +++ b/src/Senparc.Weixin.Work.Middleware/Senparc.Weixin.Work.Middleware.net8.csproj @@ -69,7 +69,7 @@ - + diff --git a/src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Media/MediaApi.cs b/src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Media/MediaApi.cs index 27b025b989..0b070057bc 100644 --- a/src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Media/MediaApi.cs +++ b/src/Senparc.Weixin.Work/Senparc.Weixin.Work/AdvancedAPIs/Media/MediaApi.cs @@ -71,10 +71,8 @@ public static UploadTemporaryResultJson Upload(string accessTokenOrAppKey, Uploa var url = string.Format(Config.ApiWorkHost + "/cgi-bin/media/upload?access_token={0}&type={1}", accessToken.AsUrlData(), type.ToString()); var fileDictionary = new Dictionary(); fileDictionary["media"] = media; - return CO2NET.HttpUtility.Post.PostFileGetJson(CommonDI.CommonSP, url, null, fileDictionary, null, null, null, false, timeOut: timeOut); + return CO2NET.HttpUtility.Post.PostFileGetJson(CommonDI.CommonSP, url, null, fileDictionary, timeOut: timeOut); }, accessTokenOrAppKey); - - } /// @@ -96,9 +94,6 @@ public static void Get(string accessTokenOrAppKey, string mediaId, Stream stream return new WorkJsonResult() { errcode = ReturnCode_Work.请求成功, errmsg = "ok" }; }, accessTokenOrAppKey); - - - } /// /// 获取临时媒体文件并保存到指定目录中 @@ -171,8 +166,6 @@ public static UploadForeverResultJson AddMpNews(string accessTokenOrAppKey, int return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); }, accessTokenOrAppKey); - - } /// @@ -191,10 +184,8 @@ public static UploadForeverResultJson AddMaterial(string accessTokenOrAppKey, Up var url = string.Format(Config.ApiWorkHost + "/cgi-bin/material/add_material?agentid={1}&type={2}&access_token={0}", accessToken.AsUrlData(), agentId, type); var fileDictionary = new Dictionary(); fileDictionary["media"] = media; - return Post.PostFileGetJson(CommonDI.CommonSP, url, null, fileDictionary, null, null, null, false, null, timeOut: timeOut); + return Post.PostFileGetJson(CommonDI.CommonSP, url, null, fileDictionary, null, null, null, timeOut: timeOut); }, accessTokenOrAppKey); - - } /// @@ -215,8 +206,6 @@ public static GetForeverMpNewsResult GetForeverMpNews(string accessTokenOrAppKey return CommonJsonSend.Send(null, url, null, CommonJsonSendType.GET); }, accessTokenOrAppKey); - - } /// @@ -259,8 +248,6 @@ public static WorkJsonResult DeleteForeverMaterial(string accessTokenOrAppKey, i return CommonJsonSend.Send(null, url, null, CommonJsonSendType.GET); }, accessTokenOrAppKey); - - } /// @@ -291,8 +278,6 @@ public static UploadForeverResultJson UpdateMpNews(string accessTokenOrAppKey, s return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); }, accessTokenOrAppKey); - - } /// @@ -310,8 +295,6 @@ public static GetCountResult GetCount(string accessTokenOrAppKey, int agentId) return CommonJsonSend.Send(null, url, null, CommonJsonSendType.GET); }, accessTokenOrAppKey); - - } /// @@ -341,9 +324,8 @@ public static BatchGetMaterialResult BatchGetMaterial(string accessTokenOrAppKey return CommonJsonSend.Send(null, url, data, CommonJsonSendType.POST, timeOut); }, accessTokenOrAppKey); - - } + /// /// 上传图文消息内的图片 /// 上传的图片限制:大小不超过2MB,支持JPG,PNG格式,每天上传的图片不能超过100张 @@ -365,8 +347,6 @@ public static UploadimgMediaResult UploadimgMedia(string accessTokenOrAppKey, st return Post.PostFileGetJson(CommonDI.CommonSP, url, null, fileDictionary, null, timeOut: timeOut); }, accessTokenOrAppKey); - - } #endregion @@ -388,10 +368,8 @@ public static async Task UploadAsync(string accessTok var url = string.Format(Config.ApiWorkHost + "/cgi-bin/media/upload?access_token={0}&type={1}", accessToken.AsUrlData(), type.ToString()); var fileDictionary = new Dictionary(); fileDictionary["media"] = media; - return await Post.PostFileGetJsonAsync(CommonDI.CommonSP, url, null, fileDictionary, null, null, null, false, null, timeOut: timeOut).ConfigureAwait(false); + return await Post.PostFileGetJsonAsync(CommonDI.CommonSP, url, null, fileDictionary, timeOut: timeOut).ConfigureAwait(false); }, accessTokenOrAppKey).ConfigureAwait(false); - - } /// @@ -410,8 +388,6 @@ await ApiHandlerWapper.TryCommonApiAsync(async accessToken => await CO2NET.HttpUtility.Get.DownloadAsync(CommonDI.CommonSP, url, stream).ConfigureAwait(false);//todo 异常处理 return new WorkJsonResult() { errcode = ReturnCode_Work.请求成功, errmsg = "ok" }; }, accessTokenOrAppKey).ConfigureAwait(false); - - } /// @@ -440,8 +416,6 @@ public static async Task AddMpNewsAsync(string accessTo return await Senparc.Weixin.CommonAPIs.CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut).ConfigureAwait(false); }, accessTokenOrAppKey).ConfigureAwait(false); - - } /// @@ -460,10 +434,8 @@ public static async Task AddMaterialAsync(string access var url = string.Format(Config.ApiWorkHost + "/cgi-bin/material/add_material?agentid={1}&type={2}&access_token={0}", accessToken.AsUrlData(), agentId, type); var fileDictionary = new Dictionary(); fileDictionary["media"] = media; - return await Post.PostFileGetJsonAsync(CommonDI.CommonSP, url, null, fileDictionary, null, null, null, false, null, timeOut: timeOut).ConfigureAwait(false); + return await Post.PostFileGetJsonAsync(CommonDI.CommonSP, url, null, fileDictionary, timeOut: timeOut).ConfigureAwait(false); }, accessTokenOrAppKey).ConfigureAwait(false); - - } /// @@ -484,7 +456,6 @@ public static async Task GetForeverMpNewsAsync(string ac return await Senparc.Weixin.CommonAPIs.CommonJsonSend.SendAsync(null, url, null, CommonJsonSendType.GET).ConfigureAwait(false); }, accessTokenOrAppKey).ConfigureAwait(false); - } /// @@ -508,8 +479,6 @@ await ApiHandlerWapper.TryCommonApiAsync(async accessToken => return new WorkJsonResult() { errcode = ReturnCode_Work.请求成功, errmsg = "ok" }; }, accessTokenOrAppKey).ConfigureAwait(false); - - } /// @@ -530,8 +499,6 @@ public static async Task DeleteForeverMaterialAsync(string acces return await Senparc.Weixin.CommonAPIs.CommonJsonSend.SendAsync(null, url, null, CommonJsonSendType.GET).ConfigureAwait(false); }, accessTokenOrAppKey).ConfigureAwait(false); - - } /// @@ -562,8 +529,6 @@ public static async Task UpdateMpNewsAsync(string acces return await Senparc.Weixin.CommonAPIs.CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut).ConfigureAwait(false); }, accessTokenOrAppKey).ConfigureAwait(false); - - } /// @@ -581,8 +546,6 @@ public static async Task GetCountAsync(string accessTokenOrAppKe return await Senparc.Weixin.CommonAPIs.CommonJsonSend.SendAsync(null, url, null, CommonJsonSendType.GET).ConfigureAwait(false); }, accessTokenOrAppKey).ConfigureAwait(false); - - } /// @@ -612,8 +575,6 @@ public static async Task BatchGetMaterialAsync(string ac return await Senparc.Weixin.CommonAPIs.CommonJsonSend.SendAsync(null, url, data, CommonJsonSendType.POST, timeOut).ConfigureAwait(false); }, accessTokenOrAppKey).ConfigureAwait(false); - - } /// @@ -631,13 +592,10 @@ public static async Task UploadimgMediaAsync(string access var url = string.Format(Config.ApiWorkHost + "/cgi-bin/media/uploadimg?access_token={0}", accessToken.AsUrlData()); - var fileDictionary = new Dictionary(); fileDictionary["media"] = imgFile; return await Post.PostFileGetJsonAsync(CommonDI.CommonSP, url, null, fileDictionary, null, timeOut: timeOut).ConfigureAwait(false); }, accessTokenOrAppKey).ConfigureAwait(false); - - } #endregion } diff --git a/src/Senparc.Weixin.Work/Senparc.Weixin.Work/Senparc.Weixin.Work.net8.csproj b/src/Senparc.Weixin.Work/Senparc.Weixin.Work/Senparc.Weixin.Work.net8.csproj index 92d8e77a0d..a1119b3eb2 100644 --- a/src/Senparc.Weixin.Work/Senparc.Weixin.Work/Senparc.Weixin.Work.net8.csproj +++ b/src/Senparc.Weixin.Work/Senparc.Weixin.Work/Senparc.Weixin.Work.net8.csproj @@ -258,7 +258,7 @@ - + diff --git a/src/Senparc.Weixin.WxOpen.Middleware/Senparc.Weixin.WxOpen.Middleware.net8.csproj b/src/Senparc.Weixin.WxOpen.Middleware/Senparc.Weixin.WxOpen.Middleware.net8.csproj index d163c6eee5..6265fa16b5 100644 --- a/src/Senparc.Weixin.WxOpen.Middleware/Senparc.Weixin.WxOpen.Middleware.net8.csproj +++ b/src/Senparc.Weixin.WxOpen.Middleware/Senparc.Weixin.WxOpen.Middleware.net8.csproj @@ -69,7 +69,7 @@ - + diff --git a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/Senparc.Weixin.WxOpen.Tests.net8.csproj b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/Senparc.Weixin.WxOpen.Tests.net8.csproj index 92a0379f67..7e919c6376 100644 --- a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/Senparc.Weixin.WxOpen.Tests.net8.csproj +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen.Tests/Senparc.Weixin.WxOpen.Tests.net8.csproj @@ -35,7 +35,7 @@ - + diff --git a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj index 216b724a27..dc103675b6 100644 --- a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj @@ -225,7 +225,7 @@ - + diff --git a/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj b/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj index 7fda696705..44646fab3f 100644 --- a/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj +++ b/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj @@ -381,8 +381,8 @@ - - + + diff --git a/src/Senparc.Weixin/Senparc.WeixinTests/Senparc.WeixinTests.net8.csproj b/src/Senparc.Weixin/Senparc.WeixinTests/Senparc.WeixinTests.net8.csproj index d2f3adb172..c7ef3803fc 100644 --- a/src/Senparc.Weixin/Senparc.WeixinTests/Senparc.WeixinTests.net8.csproj +++ b/src/Senparc.Weixin/Senparc.WeixinTests/Senparc.WeixinTests.net8.csproj @@ -27,7 +27,7 @@ - + From aba6816ea2bd0c1b98124ea6556940ee1fc16f71 Mon Sep 17 00:00:00 2001 From: JeffreySu Date: Fri, 29 Nov 2024 18:47:53 +0800 Subject: [PATCH 10/11] =?UTF-8?q?Open=20v4.21.8=20Senparc.Weixin.Open.OAut?= =?UTF-8?q?hAPIs=20=E8=BF=94=E5=9B=9E=E5=80=BC=E6=B7=BB=E5=8A=A0=E5=8F=82?= =?UTF-8?q?=E6=95=B0=20is=5Fsnapshotuser=20=E5=92=8C=20unionid=20#3100=20?= =?UTF-8?q?=E6=84=9F=E8=B0=A2=20@ccccccmd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AdvancedAPIs/OAuth/OAuthJson/OAuthAccessTokenResult.cs | 2 ++ .../OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs | 3 +++ .../Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj | 7 ++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson/OAuthAccessTokenResult.cs b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson/OAuthAccessTokenResult.cs index 3454c88afe..c9d440f111 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson/OAuthAccessTokenResult.cs +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/AdvancedAPIs/OAuth/OAuthJson/OAuthAccessTokenResult.cs @@ -41,6 +41,8 @@ and limitations under the License. 修改标识:Senparc - 20220910 修改说明:v16.18.6 OAuth 的 AccessToken 获取接口添加 is_snapshotuser 返回值 + + ----------------------------------------------------------------*/ using System; diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs index 48ef5c0fa0..8ab33c9d66 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/OAuthAPIs/OAuthJson/OAuthAccessTokenResult.cs @@ -9,6 +9,9 @@ 修改标识:Senparc - 20161216 修改描述:v2.3.5 添加序列化特性 + + 修改标识:Senparc - 20241129 + 修改描述:v4.21.8 返回值添加参数 is_snapshotuser 和 unionid ----------------------------------------------------------------*/ diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj index 66eedd5f64..98cbe9a230 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 4.21.7 + 4.21.8 Senparc.Weixin.Open Senparc.Weixin.Open true @@ -227,8 +227,9 @@ [2024-08-11] v4.20.0.0 1、添加查询小程序是否已完成交易结算管理确认 2、添加第三方小程序订单页设置结果及审核结果事件通知 #3055 感谢 @mc7246 [2024-09-10] v4.20.2 icp verifytask 接口 data 不能为 null 的问题处理 #3067 感谢 @mojinxun [2024-11-03] v4.20.6 fix wxa ap is get qr code async Issue #3089, PR #3090 感谢 @JaneConan - - https://github.com/JeffreySu/WeiXinMPSDK + [2024-11-29] v4.21.8 返回值添加参数 is_snapshotuser 和 unionid #3100 感谢 @ccccccmd + + https://github.com/JeffreySu/WeiXinMPSDK ..\..\BuildOutPut From 7fca2da00c6d2dc0f272421ad61f0e4127a8fd79 Mon Sep 17 00:00:00 2001 From: JeffreySu Date: Fri, 29 Nov 2024 19:01:10 +0800 Subject: [PATCH 11/11] =?UTF-8?q?v1.7.8=20=E5=85=BC=E5=AE=B9=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E5=85=AC=E9=92=A5=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=AF=81=E4=B9=A6=20/=20PR=20#3103=20?= =?UTF-8?q?=E6=84=9F=E8=B0=A2=20@mojinxun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Senparc.WebSocket/Senparc.WebSocket.net8.csproj | 2 +- src/Senparc.Weixin.All/Senparc.Weixin.All.csproj | 2 +- src/Senparc.Weixin.AspNet/Senparc.Weixin.AspNet.net8.csproj | 2 +- .../Senparc.Weixin.Cache.CsRedis.net8.csproj | 2 +- .../Senparc.Weixin.Cache.Dapr.net8.csproj | 2 +- .../Senparc.Weixin.Cache.Memcached.net8.csproj | 2 +- .../Senparc.Weixin.Cache.Redis.net8.csproj | 2 +- .../Senparc.Weixin.MP.Middleware.net8.csproj | 2 +- .../Senparc.Weixin.MP.MvcExtension.net8.csproj | 2 +- .../Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj | 2 +- .../Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj | 6 +++--- .../Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.net8.csproj | 2 +- .../Senparc.Weixin.TenPayV3.net8.csproj | 5 +++-- .../Senparc.Weixin.Work.Middleware.net8.csproj | 2 +- .../Senparc.Weixin.Work/Senparc.Weixin.Work.net8.csproj | 2 +- .../Senparc.Weixin.WxOpen.Middleware.net8.csproj | 2 +- .../Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj | 2 +- .../Senparc.Weixin/Senparc.Weixin.net8.csproj | 2 +- 18 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj b/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj index 7c98228e6f..fa88a22324 100644 --- a/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj +++ b/src/Senparc.WebSocket/src/Senparc.WebSocket/Senparc.WebSocket/Senparc.WebSocket.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1;netcoreapp3.1;net8.0 - 1.1.5 + 1.1.6 Senparc.WebSocket Senparc.WebSocket true diff --git a/src/Senparc.Weixin.All/Senparc.Weixin.All.csproj b/src/Senparc.Weixin.All/Senparc.Weixin.All.csproj index 1abd767162..7dcc6bb983 100644 --- a/src/Senparc.Weixin.All/Senparc.Weixin.All.csproj +++ b/src/Senparc.Weixin.All/Senparc.Weixin.All.csproj @@ -3,7 +3,7 @@ net8.0 enable enable - 2024.11.19 + 2024.11.29 10.0 Senparc.Weixin.All Senparc.Weixin.All diff --git a/src/Senparc.Weixin.AspNet/Senparc.Weixin.AspNet.net8.csproj b/src/Senparc.Weixin.AspNet/Senparc.Weixin.AspNet.net8.csproj index 8fa66c4bf9..97f062a554 100644 --- a/src/Senparc.Weixin.AspNet/Senparc.Weixin.AspNet.net8.csproj +++ b/src/Senparc.Weixin.AspNet/Senparc.Weixin.AspNet.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 1.4.6 + 1.4.7 Senparc.Weixin.AspNet Senparc.Weixin.AspNet diff --git a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/Senparc.Weixin.Cache.CsRedis.net8.csproj b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/Senparc.Weixin.Cache.CsRedis.net8.csproj index bae851e467..c959fd42d5 100644 --- a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/Senparc.Weixin.Cache.CsRedis.net8.csproj +++ b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.CsRedis/Senparc.Weixin.Cache.CsRedis.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 1.1.4 + 1.1.5 Senparc.Weixin.Cache.CsRedis Senparc.Weixin.Cache.CsRedis true diff --git a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/Senparc.Weixin.Cache.Dapr.net8.csproj b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/Senparc.Weixin.Cache.Dapr.net8.csproj index 7736455bd9..3c5517bec1 100644 --- a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/Senparc.Weixin.Cache.Dapr.net8.csproj +++ b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Dapr/Senparc.Weixin.Cache.Dapr.net8.csproj @@ -1,7 +1,7 @@ net8.0 - 0.2.4-beta1 + 0.2.5-beta1 Senparc.Weixin.Cache.Dapr Senparc.Weixin.Cache.Dapr true diff --git a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Senparc.Weixin.Cache.Memcached.net8.csproj b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Senparc.Weixin.Cache.Memcached.net8.csproj index 2c20ebeb61..c2af0a2ded 100644 --- a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Senparc.Weixin.Cache.Memcached.net8.csproj +++ b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Memcached/Senparc.Weixin.Cache.Memcached.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 2.18.5 + 2.18.6 Senparc.Weixin.Cache.Memcached Senparc.Weixin.Cache.Memcached diff --git a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/Senparc.Weixin.Cache.Redis.net8.csproj b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/Senparc.Weixin.Cache.Redis.net8.csproj index e924fe8841..810efaa7d9 100644 --- a/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/Senparc.Weixin.Cache.Redis.net8.csproj +++ b/src/Senparc.Weixin.Cache/Senparc.Weixin.Cache.Redis/Senparc.Weixin.Cache.Redis.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 2.20.5 + 2.20.6 Senparc.Weixin.Cache.Redis Senparc.Weixin.Cache.Redis true diff --git a/src/Senparc.Weixin.MP.Middleware/Senparc.Weixin.MP.Middleware.net8.csproj b/src/Senparc.Weixin.MP.Middleware/Senparc.Weixin.MP.Middleware.net8.csproj index 262088e02d..c7cbf7f307 100644 --- a/src/Senparc.Weixin.MP.Middleware/Senparc.Weixin.MP.Middleware.net8.csproj +++ b/src/Senparc.Weixin.MP.Middleware/Senparc.Weixin.MP.Middleware.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1;netcoreapp3.1;net8.0 - 1.4.6 + 1.4.7 Senparc.Weixin.MP.Middleware Senparc.Weixin.MP.Middleware true diff --git a/src/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension.net8.csproj b/src/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension.net8.csproj index 8039a1fb7a..e61b42ad11 100644 --- a/src/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension.net8.csproj +++ b/src/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension/Senparc.Weixin.MP.MvcExtension.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1;netcoreapp3.1;net8.0 - 7.16.6 + 7.16.7 Senparc.Weixin.MP.MvcExtension Senparc.Weixin.MP.MvcExtension true diff --git a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj index fbb3ff8a52..2151f6020a 100644 --- a/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj +++ b/src/Senparc.Weixin.MP/Senparc.Weixin.MP/Senparc.Weixin.MP.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 16.23.5 + 16.23.6 Senparc.Weixin.MP Senparc.Weixin.MP true diff --git a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj index 98cbe9a230..7b119dd4c4 100644 --- a/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj +++ b/src/Senparc.Weixin.Open/Senparc.Weixin.Open/Senparc.Weixin.Open.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 4.21.8 + 4.21.9 Senparc.Weixin.Open Senparc.Weixin.Open true @@ -228,8 +228,8 @@ [2024-09-10] v4.20.2 icp verifytask 接口 data 不能为 null 的问题处理 #3067 感谢 @mojinxun [2024-11-03] v4.20.6 fix wxa ap is get qr code async Issue #3089, PR #3090 感谢 @JaneConan [2024-11-29] v4.21.8 返回值添加参数 is_snapshotuser 和 unionid #3100 感谢 @ccccccmd - - https://github.com/JeffreySu/WeiXinMPSDK + + https://github.com/JeffreySu/WeiXinMPSDK ..\..\BuildOutPut diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.net8.csproj b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.net8.csproj index e0516c3213..a4cd9e4231 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.net8.csproj +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay/Senparc.Weixin.TenPay.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 1.17.5 + 1.17.6 Senparc.Weixin.TenPay Senparc.Weixin.TenPay true diff --git a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Senparc.Weixin.TenPayV3.net8.csproj b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Senparc.Weixin.TenPayV3.net8.csproj index 4035d308e4..9a133150ba 100644 --- a/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Senparc.Weixin.TenPayV3.net8.csproj +++ b/src/Senparc.Weixin.TenPay/Senparc.Weixin.TenPayV3/Senparc.Weixin.TenPayV3.net8.csproj @@ -1,7 +1,7 @@ netstandard2.1 - 1.7.7 + 1.7.8 Senparc.Weixin.TenPayV3 Senparc.Weixin.TenPayV3 10.0 @@ -58,7 +58,8 @@ v1.4.2 完善 SM 相关方法 v1.6.3 更新支付接口调用过程中的 SM 和 RSA 判断方式 v1.6.5 修改 SM 证书判断逻辑,向下兼容未升级 appsettings.json 的系统 #3084 - + v1.7.8 兼容微信支付公钥以及平台证书 / PR #3103 感谢 @mojinxun + https://github.com/JeffreySu/WeiXinMPSDK diff --git a/src/Senparc.Weixin.Work.Middleware/Senparc.Weixin.Work.Middleware.net8.csproj b/src/Senparc.Weixin.Work.Middleware/Senparc.Weixin.Work.Middleware.net8.csproj index 8d1d39efa0..0f0bc509a8 100644 --- a/src/Senparc.Weixin.Work.Middleware/Senparc.Weixin.Work.Middleware.net8.csproj +++ b/src/Senparc.Weixin.Work.Middleware/Senparc.Weixin.Work.Middleware.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1;netcoreapp3.1;net8.0 - 1.4.6 + 1.4.7 Senparc.Weixin.Work.Middleware Senparc.Weixin.Work.Middleware true diff --git a/src/Senparc.Weixin.Work/Senparc.Weixin.Work/Senparc.Weixin.Work.net8.csproj b/src/Senparc.Weixin.Work/Senparc.Weixin.Work/Senparc.Weixin.Work.net8.csproj index a1119b3eb2..efbec5df1d 100644 --- a/src/Senparc.Weixin.Work/Senparc.Weixin.Work/Senparc.Weixin.Work.net8.csproj +++ b/src/Senparc.Weixin.Work/Senparc.Weixin.Work/Senparc.Weixin.Work.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 3.25.1 + 3.25.2 10.0 Senparc.Weixin.Work Senparc.Weixin.Work diff --git a/src/Senparc.Weixin.WxOpen.Middleware/Senparc.Weixin.WxOpen.Middleware.net8.csproj b/src/Senparc.Weixin.WxOpen.Middleware/Senparc.Weixin.WxOpen.Middleware.net8.csproj index 6265fa16b5..5052a0086e 100644 --- a/src/Senparc.Weixin.WxOpen.Middleware/Senparc.Weixin.WxOpen.Middleware.net8.csproj +++ b/src/Senparc.Weixin.WxOpen.Middleware/Senparc.Weixin.WxOpen.Middleware.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1;netcoreapp3.1;net8.0 - 1.4.6 + 1.4.7 Senparc.Weixin.WxOpen.Middleware Senparc.Weixin.WxOpen.Middleware true diff --git a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj index dc103675b6..c7cae05601 100644 --- a/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj +++ b/src/Senparc.Weixin.WxOpen/src/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen/Senparc.Weixin.WxOpen.net8.csproj @@ -1,7 +1,7 @@ net462;netstandard2.0;netstandard2.1 - 3.23.1 + 3.23.2 9.0 Senparc.Weixin.WxOpen Senparc.Weixin.WxOpen diff --git a/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj b/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj index 44646fab3f..70353fdb32 100644 --- a/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj +++ b/src/Senparc.Weixin/Senparc.Weixin/Senparc.Weixin.net8.csproj @@ -2,7 +2,7 @@ net462;netstandard2.0;netstandard2.1 - 6.21.2 + 6.21.3 10.0 Senparc.Weixin Senparc.Weixin