diff --git a/README.md b/README.md index f9e0a33..fd1b8dc 100644 --- a/README.md +++ b/README.md @@ -72,8 +72,8 @@ PaySharp.Allinpay | [![NuGet](https://img.shields.io/nuget/v/PaySharp.Allinpay.s # 开发环境 * Windows 10 -* Visual Studio 2019(16.4) -* .NET Core SDK 3.1 +* Visual Studio 2019(16.8) +* .NET SDK 5.0 # 如何使用 --- diff --git a/global.json b/global.json index d7062d6..2c4c450 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "3.1.200", + "version": "5.0.100", "rollForward": "latestMinor" } } \ No newline at end of file diff --git a/package.props b/package.props index 4703697..bf32b95 100644 --- a/package.props +++ b/package.props @@ -1,7 +1,7 @@ - 1.1.1 + 1.1.2 true https://github.com/Varorbc/PaySharp Varorbc diff --git a/sample/PaySharp.Demo/PaySharp.Demo.csproj b/sample/PaySharp.Demo/PaySharp.Demo.csproj index 45b823c..173d55a 100644 --- a/sample/PaySharp.Demo/PaySharp.Demo.csproj +++ b/sample/PaySharp.Demo/PaySharp.Demo.csproj @@ -1,11 +1,11 @@  - netcoreapp3.1 + net5.0 - + diff --git a/src/PaySharp.Alipay/AlipayGateway.cs b/src/PaySharp.Alipay/AlipayGateway.cs index 954d53b..9468253 100644 --- a/src/PaySharp.Alipay/AlipayGateway.cs +++ b/src/PaySharp.Alipay/AlipayGateway.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using Microsoft.Extensions.Options; #endif using System.Threading.Tasks; @@ -34,7 +34,7 @@ namespace PaySharp.Alipay _merchant = merchant; } -#if NETCOREAPP3_1 +#if NETCOREAPP /// /// 初始化支付宝网关 diff --git a/src/PaySharp.Alipay/PaySharp.Alipay.csproj b/src/PaySharp.Alipay/PaySharp.Alipay.csproj index 445c40e..bb9e9ae 100644 --- a/src/PaySharp.Alipay/PaySharp.Alipay.csproj +++ b/src/PaySharp.Alipay/PaySharp.Alipay.csproj @@ -3,7 +3,7 @@ - net45;netcoreapp3.1 + net45;netcoreapp3.1;net5.0 PaySharp.Alipay 支付宝支付 dotnetcore;pay;alipay; diff --git a/src/PaySharp.Alipay/ServiceCollectionExtensions.cs b/src/PaySharp.Alipay/ServiceCollectionExtensions.cs index e6d916d..ebecab3 100644 --- a/src/PaySharp.Alipay/ServiceCollectionExtensions.cs +++ b/src/PaySharp.Alipay/ServiceCollectionExtensions.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using System; using Microsoft.Extensions.Configuration; using PaySharp.Alipay; diff --git a/src/PaySharp.Allinpay/AllinpayGateway.cs b/src/PaySharp.Allinpay/AllinpayGateway.cs index 569b8bd..a129db4 100644 --- a/src/PaySharp.Allinpay/AllinpayGateway.cs +++ b/src/PaySharp.Allinpay/AllinpayGateway.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using Microsoft.Extensions.Options; #endif using System.Threading.Tasks; @@ -33,7 +33,7 @@ namespace PaySharp.Allinpay _merchant = merchant; } -#if NETCOREAPP3_1 +#if NETCOREAPP /// /// 初始化通联收银宝网关 diff --git a/src/PaySharp.Allinpay/PaySharp.Allinpay.csproj b/src/PaySharp.Allinpay/PaySharp.Allinpay.csproj index 91a0582..7249067 100644 --- a/src/PaySharp.Allinpay/PaySharp.Allinpay.csproj +++ b/src/PaySharp.Allinpay/PaySharp.Allinpay.csproj @@ -3,7 +3,7 @@ - net45;netcoreapp3.1 + net45;netcoreapp3.1;net5.0 PaySharp.Allinpay 通联收银宝 dotnetcore;pay;Allinpay; diff --git a/src/PaySharp.Allinpay/ServiceCollectionExtensions.cs b/src/PaySharp.Allinpay/ServiceCollectionExtensions.cs index acf337a..bdbd3c4 100644 --- a/src/PaySharp.Allinpay/ServiceCollectionExtensions.cs +++ b/src/PaySharp.Allinpay/ServiceCollectionExtensions.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using System; using Microsoft.Extensions.Configuration; using PaySharp.Allinpay; diff --git a/src/PaySharp.Core/Gateways/GatewayData.cs b/src/PaySharp.Core/Gateways/GatewayData.cs index 5d22369..3848c04 100644 --- a/src/PaySharp.Core/Gateways/GatewayData.cs +++ b/src/PaySharp.Core/Gateways/GatewayData.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using Microsoft.AspNetCore.Http; #endif using System; @@ -401,7 +401,7 @@ namespace PaySharp.Core } } -#if NETCOREAPP3_1 +#if NETCOREAPP /// /// 将表单数据转换为网关数据 diff --git a/src/PaySharp.Core/Notify/NotifyProcess.cs b/src/PaySharp.Core/Notify/NotifyProcess.cs index d539018..1f4e278 100644 --- a/src/PaySharp.Core/Notify/NotifyProcess.cs +++ b/src/PaySharp.Core/Notify/NotifyProcess.cs @@ -96,7 +96,7 @@ namespace PaySharp.Core { try { -#if NETCOREAPP3_1 +#if NETCOREAPP gatewayData.FromForm(HttpUtil.Form); #else gatewayData.FromNameValueCollection(HttpUtil.Form); diff --git a/src/PaySharp.Core/PaySharp.Core.csproj b/src/PaySharp.Core/PaySharp.Core.csproj index e948851..d0158e5 100644 --- a/src/PaySharp.Core/PaySharp.Core.csproj +++ b/src/PaySharp.Core/PaySharp.Core.csproj @@ -3,7 +3,7 @@ - net45;netcoreapp3.1 + net45;netcoreapp3.1;net5.0 PaySharp.Core 支付核心 dotnetcore;pay; @@ -18,7 +18,7 @@ - + diff --git a/src/PaySharp.Core/ServiceCollectionExtensions.cs b/src/PaySharp.Core/ServiceCollectionExtensions.cs index 93378ea..6aaa5c4 100644 --- a/src/PaySharp.Core/ServiceCollectionExtensions.cs +++ b/src/PaySharp.Core/ServiceCollectionExtensions.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using System; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Http; @@ -42,4 +42,4 @@ namespace Microsoft.Extensions.DependencyInjection } } -#endif \ No newline at end of file +#endif diff --git a/src/PaySharp.Core/Utils/EncryptUtil.cs b/src/PaySharp.Core/Utils/EncryptUtil.cs index c74595c..caff15a 100644 --- a/src/PaySharp.Core/Utils/EncryptUtil.cs +++ b/src/PaySharp.Core/Utils/EncryptUtil.cs @@ -97,7 +97,7 @@ namespace PaySharp.Core.Utils if ("RSA2".Equals(signType)) { -#if NETCOREAPP3_1 +#if NETCOREAPP signatureBytes = rsaCsp.SignData(dataBytes, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); #else signatureBytes = ((RSACryptoServiceProvider)rsaCsp).SignData(dataBytes, "SHA256"); @@ -105,7 +105,7 @@ namespace PaySharp.Core.Utils } else { -#if NETCOREAPP3_1 +#if NETCOREAPP signatureBytes = rsaCsp.SignData(dataBytes, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); #else signatureBytes = ((RSACryptoServiceProvider)rsaCsp).SignData(dataBytes, "SHA1"); @@ -148,7 +148,7 @@ namespace PaySharp.Core.Utils if ("RSA2".Equals(signType)) { -#if NETCOREAPP3_1 +#if NETCOREAPP bVerifyResultOriginal = rsa.VerifyData(Encoding.GetEncoding(charset).GetBytes(signContent), Convert.FromBase64String(sign), HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); #else @@ -158,7 +158,7 @@ namespace PaySharp.Core.Utils } else { -#if NETCOREAPP3_1 +#if NETCOREAPP bVerifyResultOriginal = rsa.VerifyData(Encoding.GetEncoding(charset).GetBytes(signContent), Convert.FromBase64String(sign), HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1); #else diff --git a/src/PaySharp.Core/Utils/HttpUtil.cs b/src/PaySharp.Core/Utils/HttpUtil.cs index fcf83fd..4807775 100644 --- a/src/PaySharp.Core/Utils/HttpUtil.cs +++ b/src/PaySharp.Core/Utils/HttpUtil.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using Microsoft.AspNetCore.Http; #else using System.Collections.Specialized; @@ -21,7 +21,7 @@ namespace PaySharp.Core.Utils { #region 属性 -#if NETCOREAPP3_1 +#if NETCOREAPP private static IHttpContextAccessor _httpContextAccessor; @@ -242,7 +242,7 @@ namespace PaySharp.Core.Utils { Current.Response.ContentType = "text/plain;charset=utf-8"; -#if NETCOREAPP3_1 +#if NETCOREAPP Task.Run(async () => { await Current.Response.WriteAsync(text); @@ -272,7 +272,7 @@ namespace PaySharp.Core.Utils Current.Response.Headers.Add("Content-Disposition", "attachment;filename=" + WebUtility.UrlEncode(Path.GetFileName(stream.Name))); Current.Response.Headers.Add("Content-Length", size.ToString()); -#if NETCOREAPP3_1 +#if NETCOREAPP Task.Run(async () => { await Current.Response.Body.WriteAsync(buffer, 0, (int)size); diff --git a/src/PaySharp.Qpay/PaySharp.Qpay.csproj b/src/PaySharp.Qpay/PaySharp.Qpay.csproj index c17cb5d..d300801 100644 --- a/src/PaySharp.Qpay/PaySharp.Qpay.csproj +++ b/src/PaySharp.Qpay/PaySharp.Qpay.csproj @@ -3,7 +3,7 @@ - net45;netcoreapp3.1 + net45;netcoreapp3.1;net5.0 PaySharp.Qpay QQ钱包支付 dotnetcore;pay;qpay; diff --git a/src/PaySharp.Qpay/QpayGateway.cs b/src/PaySharp.Qpay/QpayGateway.cs index f179a07..691015a 100644 --- a/src/PaySharp.Qpay/QpayGateway.cs +++ b/src/PaySharp.Qpay/QpayGateway.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using Microsoft.Extensions.Options; #endif using System.Threading.Tasks; @@ -33,7 +33,7 @@ namespace PaySharp.Qpay _merchant = merchant; } -#if NETCOREAPP3_1 +#if NETCOREAPP /// /// 初始化QQ钱包网关 diff --git a/src/PaySharp.Qpay/ServiceCollectionExtensions.cs b/src/PaySharp.Qpay/ServiceCollectionExtensions.cs index 3555919..78b8826 100644 --- a/src/PaySharp.Qpay/ServiceCollectionExtensions.cs +++ b/src/PaySharp.Qpay/ServiceCollectionExtensions.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using System; using Microsoft.Extensions.Configuration; using PaySharp.Core; diff --git a/src/PaySharp.Unionpay/PaySharp.Unionpay.csproj b/src/PaySharp.Unionpay/PaySharp.Unionpay.csproj index 9e09579..8f655e2 100644 --- a/src/PaySharp.Unionpay/PaySharp.Unionpay.csproj +++ b/src/PaySharp.Unionpay/PaySharp.Unionpay.csproj @@ -3,7 +3,7 @@ - net45;netcoreapp3.1 + net45;netcoreapp3.1;net5.0 PaySharp.Unionpay 中国银联 dotnetcore;pay;unionpay; diff --git a/src/PaySharp.Unionpay/ServiceCollectionExtensions.cs b/src/PaySharp.Unionpay/ServiceCollectionExtensions.cs index 414e0d2..418bf09 100644 --- a/src/PaySharp.Unionpay/ServiceCollectionExtensions.cs +++ b/src/PaySharp.Unionpay/ServiceCollectionExtensions.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using System; using Microsoft.Extensions.Configuration; using PaySharp.Core; diff --git a/src/PaySharp.Unionpay/UnionpayGateway.cs b/src/PaySharp.Unionpay/UnionpayGateway.cs index dc3ce5e..01f8b64 100644 --- a/src/PaySharp.Unionpay/UnionpayGateway.cs +++ b/src/PaySharp.Unionpay/UnionpayGateway.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using Microsoft.Extensions.Options; #endif using System; @@ -37,7 +37,7 @@ namespace PaySharp.Unionpay _merchant.CertKey = CertUtil.GetCertKey(merchant.CertPath, merchant.CertPwd); } -#if NETCOREAPP3_1 +#if NETCOREAPP /// /// 初始化中国银联网关 diff --git a/src/PaySharp.Wechatpay/PaySharp.Wechatpay.csproj b/src/PaySharp.Wechatpay/PaySharp.Wechatpay.csproj index 6f241b1..e75fdc6 100644 --- a/src/PaySharp.Wechatpay/PaySharp.Wechatpay.csproj +++ b/src/PaySharp.Wechatpay/PaySharp.Wechatpay.csproj @@ -3,7 +3,7 @@ - net45;netcoreapp3.1 + net45;netcoreapp3.1;net5.0 PaySharp.Wechatpay 微信支付 dotnetcore;pay;wechatpay; diff --git a/src/PaySharp.Wechatpay/ServiceCollectionExtensions.cs b/src/PaySharp.Wechatpay/ServiceCollectionExtensions.cs index ea3f078..71a8697 100644 --- a/src/PaySharp.Wechatpay/ServiceCollectionExtensions.cs +++ b/src/PaySharp.Wechatpay/ServiceCollectionExtensions.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using System; using Microsoft.Extensions.Configuration; using PaySharp.Core; diff --git a/src/PaySharp.Wechatpay/WechatpayGateway.cs b/src/PaySharp.Wechatpay/WechatpayGateway.cs index 8c9c98f..3897aa3 100644 --- a/src/PaySharp.Wechatpay/WechatpayGateway.cs +++ b/src/PaySharp.Wechatpay/WechatpayGateway.cs @@ -1,4 +1,4 @@ -#if NETCOREAPP3_1 +#if NETCOREAPP using Microsoft.Extensions.Options; #endif using System.Threading.Tasks; @@ -35,7 +35,7 @@ namespace PaySharp.Wechatpay _merchant = merchant; } -#if NETCOREAPP3_1 +#if NETCOREAPP /// /// 初始化微信支付网关 diff --git a/test/PaySharp.UnitTest/PaySharp.UnitTest.csproj b/test/PaySharp.UnitTest/PaySharp.UnitTest.csproj index fec7229..2022105 100644 --- a/test/PaySharp.UnitTest/PaySharp.UnitTest.csproj +++ b/test/PaySharp.UnitTest/PaySharp.UnitTest.csproj @@ -14,10 +14,10 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive