mirror of
https://github.com/Varorbc/PaySharp.git
synced 2026-10-16 20:31:04 +08:00
添加net5.0
This commit is contained in:
@@ -72,8 +72,8 @@ PaySharp.Allinpay | [
|
||||
* .NET Core SDK 3.1
|
||||
* Visual Studio 2019(16.8)
|
||||
* .NET SDK 5.0
|
||||
|
||||
# 如何使用
|
||||
---
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "3.1.200",
|
||||
"version": "5.0.100",
|
||||
"rollForward": "latestMinor"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>1.1.1</Version>
|
||||
<Version>1.1.2</Version>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<PackageProjectUrl>https://github.com/Varorbc/PaySharp</PackageProjectUrl>
|
||||
<Authors>Varorbc</Authors>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -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
|
||||
|
||||
/// <summary>
|
||||
/// 初始化支付宝网关
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="../../package.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
|
||||
<TargetFrameworks>net45;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<Title>PaySharp.Alipay</Title>
|
||||
<Description>支付宝支付</Description>
|
||||
<PackageTags>dotnetcore;pay;alipay;</PackageTags>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if NETCOREAPP3_1
|
||||
#if NETCOREAPP
|
||||
using System;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using PaySharp.Alipay;
|
||||
|
||||
@@ -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
|
||||
|
||||
/// <summary>
|
||||
/// 初始化通联收银宝网关
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="../../package.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
|
||||
<TargetFrameworks>net45;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<Title>PaySharp.Allinpay</Title>
|
||||
<Description>通联收银宝</Description>
|
||||
<PackageTags>dotnetcore;pay;Allinpay;</PackageTags>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if NETCOREAPP3_1
|
||||
#if NETCOREAPP
|
||||
using System;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using PaySharp.Allinpay;
|
||||
|
||||
@@ -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
|
||||
|
||||
/// <summary>
|
||||
/// 将表单数据转换为网关数据
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace PaySharp.Core
|
||||
{
|
||||
try
|
||||
{
|
||||
#if NETCOREAPP3_1
|
||||
#if NETCOREAPP
|
||||
gatewayData.FromForm(HttpUtil.Form);
|
||||
#else
|
||||
gatewayData.FromNameValueCollection(HttpUtil.Form);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="../../package.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
|
||||
<TargetFrameworks>net45;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<Title>PaySharp.Core</Title>
|
||||
<Description>支付核心</Description>
|
||||
<PackageTags>dotnetcore;pay;</PackageTags>
|
||||
@@ -18,7 +18,7 @@
|
||||
<Reference Include="System.Configuration" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0'">
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -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
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="../../package.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
|
||||
<TargetFrameworks>net45;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<Title>PaySharp.Qpay</Title>
|
||||
<Description>QQ钱包支付</Description>
|
||||
<PackageTags>dotnetcore;pay;qpay;</PackageTags>
|
||||
|
||||
@@ -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
|
||||
|
||||
/// <summary>
|
||||
/// 初始化QQ钱包网关
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if NETCOREAPP3_1
|
||||
#if NETCOREAPP
|
||||
using System;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using PaySharp.Core;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="../../package.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
|
||||
<TargetFrameworks>net45;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<Title>PaySharp.Unionpay</Title>
|
||||
<Description>中国银联</Description>
|
||||
<PackageTags>dotnetcore;pay;unionpay;</PackageTags>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if NETCOREAPP3_1
|
||||
#if NETCOREAPP
|
||||
using System;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using PaySharp.Core;
|
||||
|
||||
@@ -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
|
||||
|
||||
/// <summary>
|
||||
/// 初始化中国银联网关
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="../../package.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
|
||||
<TargetFrameworks>net45;netcoreapp3.1;net5.0</TargetFrameworks>
|
||||
<Title>PaySharp.Wechatpay</Title>
|
||||
<Description>微信支付</Description>
|
||||
<PackageTags>dotnetcore;pay;wechatpay;</PackageTags>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if NETCOREAPP3_1
|
||||
#if NETCOREAPP
|
||||
using System;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using PaySharp.Core;
|
||||
|
||||
@@ -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
|
||||
|
||||
/// <summary>
|
||||
/// 初始化微信支付网关
|
||||
|
||||
@@ -14,10 +14,10 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
Reference in New Issue
Block a user