mirror of
https://github.com/Varorbc/PaySharp.git
synced 2026-10-16 20:31:04 +08:00
+60
-66
@@ -43,44 +43,48 @@ indent_size = 2
|
|||||||
## Language conventions
|
## Language conventions
|
||||||
# Dotnet code style settings:
|
# Dotnet code style settings:
|
||||||
[*.{cs,vb}]
|
[*.{cs,vb}]
|
||||||
|
# Rule format
|
||||||
|
dotnet_diagnostic.IDE0005.severity = error
|
||||||
|
|
||||||
# "This." and "Me." qualifiers
|
# "This." and "Me." qualifiers
|
||||||
dotnet_style_qualification_for_field = false:suggestion
|
dotnet_style_qualification_for_field = false:error
|
||||||
dotnet_style_qualification_for_property = false:suggestion
|
dotnet_style_qualification_for_property = false:error
|
||||||
dotnet_style_qualification_for_method = false:suggestion
|
dotnet_style_qualification_for_method = false:error
|
||||||
dotnet_style_qualification_for_event = false:suggestion
|
dotnet_style_qualification_for_event = false:error
|
||||||
|
|
||||||
# Language keywords instead of framework type names for type references
|
# Language keywords instead of framework type names for type references
|
||||||
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
|
dotnet_style_predefined_type_for_locals_parameters_members = true:error
|
||||||
dotnet_style_predefined_type_for_member_access = true:suggestion
|
dotnet_style_predefined_type_for_member_access = true:error
|
||||||
|
|
||||||
# Modifier preferences
|
# Modifier preferences
|
||||||
dotnet_style_require_accessibility_modifiers = always:suggestion
|
dotnet_style_require_accessibility_modifiers = always:error
|
||||||
dotnet_style_readonly_field = true:warning
|
dotnet_style_readonly_field = true:error
|
||||||
|
|
||||||
# Parentheses preferences
|
# Parentheses preferences
|
||||||
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
|
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:error
|
||||||
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
|
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:error
|
||||||
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:error
|
||||||
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
|
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:error
|
||||||
|
|
||||||
# Expression-level preferences
|
# Expression-level preferences
|
||||||
dotnet_style_object_initializer = true:suggestion
|
dotnet_style_object_initializer = true:error
|
||||||
dotnet_style_collection_initializer = true:suggestion
|
dotnet_style_collection_initializer = true:error
|
||||||
dotnet_style_explicit_tuple_names = true:suggestion
|
dotnet_style_explicit_tuple_names = true:error
|
||||||
dotnet_style_prefer_inferred_tuple_names = true:suggestion
|
dotnet_style_prefer_inferred_tuple_names = true:error
|
||||||
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true:error
|
||||||
dotnet_style_prefer_auto_properties = true:silent
|
dotnet_style_prefer_auto_properties = true:error
|
||||||
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
|
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
|
||||||
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
|
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error
|
||||||
|
|
||||||
# Null-checking preferences
|
# Null-checking preferences
|
||||||
dotnet_style_coalesce_expression = true:suggestion
|
dotnet_style_coalesce_expression = true:error
|
||||||
dotnet_style_null_propagation = true:suggestion
|
dotnet_style_null_propagation = true:error
|
||||||
|
|
||||||
# CSharp code style settings:
|
# CSharp code style settings:
|
||||||
[*.cs]
|
[*.cs]
|
||||||
# Modifier preferences
|
# Modifier preferences
|
||||||
csharp_preferred_modifier_order = public,private,protected,internal,const,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
|
csharp_preferred_modifier_order = public,private,protected,internal,const,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error
|
||||||
|
|
||||||
# Implicit and explicit types
|
# Implicit and explicit types
|
||||||
csharp_style_var_for_built_in_types = true:suggestion
|
csharp_style_var_for_built_in_types = true:suggestion
|
||||||
@@ -91,29 +95,29 @@ csharp_style_var_elsewhere = true:suggestion
|
|||||||
# Explicitly disabled due to difference in coding style between source and tests
|
# Explicitly disabled due to difference in coding style between source and tests
|
||||||
#csharp_style_expression_bodied_methods = false:silent
|
#csharp_style_expression_bodied_methods = false:silent
|
||||||
#csharp_style_expression_bodied_constructors = false:silent
|
#csharp_style_expression_bodied_constructors = false:silent
|
||||||
csharp_style_expression_bodied_operators = false:silent
|
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
|
||||||
csharp_style_expression_bodied_properties = true:suggestion
|
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
|
||||||
csharp_style_expression_bodied_indexers = true:suggestion
|
csharp_style_expression_bodied_indexers = when_on_single_line:suggestion
|
||||||
csharp_style_expression_bodied_accessors = true:suggestion
|
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
|
||||||
|
|
||||||
# Pattern matching
|
# Pattern matching
|
||||||
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
|
csharp_style_pattern_matching_over_is_with_cast_check = true:error
|
||||||
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
|
csharp_style_pattern_matching_over_as_with_null_check = true:error
|
||||||
|
|
||||||
# Inlined variable declarations
|
# Inlined variable declarations
|
||||||
csharp_style_inlined_variable_declaration = true:suggestion
|
csharp_style_inlined_variable_declaration = true:error
|
||||||
|
|
||||||
# Expression-level preferences
|
# Expression-level preferences
|
||||||
csharp_prefer_simple_default_expression = true:suggestion
|
csharp_prefer_simple_default_expression = true:error
|
||||||
csharp_style_deconstructed_variable_declaration = true:suggestion
|
csharp_style_deconstructed_variable_declaration = true:error
|
||||||
csharp_style_pattern_local_over_anonymous_function = true:suggestion
|
csharp_style_pattern_local_over_anonymous_function = true:error
|
||||||
|
|
||||||
# Null-checking preference
|
# Null-checking preference
|
||||||
csharp_style_throw_expression = true:suggestion
|
csharp_style_throw_expression = true:none
|
||||||
csharp_style_conditional_delegate_call = true:suggestion
|
csharp_style_conditional_delegate_call = true:error
|
||||||
|
|
||||||
# Code block preferences
|
# Code block preferences
|
||||||
csharp_prefer_braces = true:suggestion
|
csharp_prefer_braces = true:error
|
||||||
|
|
||||||
## Formatting conventions
|
## Formatting conventions
|
||||||
# Dotnet formatting settings:
|
# Dotnet formatting settings:
|
||||||
@@ -166,7 +170,7 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
|||||||
csharp_space_between_square_brackets = false
|
csharp_space_between_square_brackets = false
|
||||||
|
|
||||||
# Wrap options
|
# Wrap options
|
||||||
csharp_preserve_single_line_statements = true
|
csharp_preserve_single_line_statements = false
|
||||||
csharp_preserve_single_line_blocks = true
|
csharp_preserve_single_line_blocks = true
|
||||||
|
|
||||||
## Naming conventions
|
## Naming conventions
|
||||||
@@ -195,15 +199,15 @@ dotnet_naming_symbols.interface_symbol.applicable_kinds = interface
|
|||||||
dotnet_naming_symbols.interface_symbol.applicable_accessibilities = *
|
dotnet_naming_symbols.interface_symbol.applicable_accessibilities = *
|
||||||
dotnet_naming_rule.interface_naming.symbols = interface_symbol
|
dotnet_naming_rule.interface_naming.symbols = interface_symbol
|
||||||
dotnet_naming_rule.interface_naming.style = interface_style
|
dotnet_naming_rule.interface_naming.style = interface_style
|
||||||
dotnet_naming_rule.interface_naming.severity = suggestion
|
dotnet_naming_rule.interface_naming.severity = error
|
||||||
|
|
||||||
# Classes, Structs, Enums, Properties, Methods, Local Functions, Events, Namespaces
|
# Classes, Structs, Enums, Properties, Methods, Local Functions, Events, Namespaces
|
||||||
dotnet_naming_symbols.class_symbol.applicable_kinds = class, struct, enum, property, method, local_function, event, namespace
|
dotnet_naming_symbols.class_symbol.applicable_kinds = class, struct, enum, property, method, local_function, event, namespace, delegate
|
||||||
dotnet_naming_symbols.class_symbol.applicable_accessibilities = *
|
dotnet_naming_symbols.class_symbol.applicable_accessibilities = *
|
||||||
|
|
||||||
dotnet_naming_rule.class_naming.symbols = class_symbol
|
dotnet_naming_rule.class_naming.symbols = class_symbol
|
||||||
dotnet_naming_rule.class_naming.style = pascal_case_style
|
dotnet_naming_rule.class_naming.style = pascal_case_style
|
||||||
dotnet_naming_rule.class_naming.severity = suggestion
|
dotnet_naming_rule.class_naming.severity = error
|
||||||
|
|
||||||
# Type Parameters
|
# Type Parameters
|
||||||
dotnet_naming_symbols.type_parameter_symbol.applicable_kinds = type_parameter
|
dotnet_naming_symbols.type_parameter_symbol.applicable_kinds = type_parameter
|
||||||
@@ -211,46 +215,36 @@ dotnet_naming_symbols.type_parameter_symbol.applicable_accessibilities = *
|
|||||||
|
|
||||||
dotnet_naming_rule.type_parameter_naming.symbols = type_parameter_symbol
|
dotnet_naming_rule.type_parameter_naming.symbols = type_parameter_symbol
|
||||||
dotnet_naming_rule.type_parameter_naming.style = type_parameter_style
|
dotnet_naming_rule.type_parameter_naming.style = type_parameter_style
|
||||||
dotnet_naming_rule.type_parameter_naming.severity = suggestion
|
dotnet_naming_rule.type_parameter_naming.severity = error
|
||||||
|
|
||||||
# Private const fields
|
# Private Fields
|
||||||
dotnet_naming_symbols.const_field_symbol.applicable_kinds = field
|
dotnet_naming_symbols.private_field_symbol.applicable_kinds = field
|
||||||
dotnet_naming_symbols.const_field_symbol.applicable_accessibilities = private
|
dotnet_naming_symbols.private_field_symbol.applicable_accessibilities = private
|
||||||
dotnet_naming_symbols.const_field_symbol.required_modifiers = const
|
|
||||||
|
|
||||||
dotnet_naming_rule.const_field_naming.symbols = const_field_symbol
|
dotnet_naming_rule.private_field_naming.symbols = private_field_symbol
|
||||||
dotnet_naming_rule.const_field_naming.style = _camelCase
|
dotnet_naming_rule.private_field_naming.style = _camelCase
|
||||||
dotnet_naming_rule.const_field_naming.severity = suggestion
|
dotnet_naming_rule.private_field_naming.severity = error
|
||||||
|
|
||||||
# Other const fields
|
# Visible Fields
|
||||||
dotnet_naming_symbols.const_field_symbol.applicable_kinds = field
|
|
||||||
dotnet_naming_symbols.const_field_symbol.applicable_accessibilities = *
|
|
||||||
dotnet_naming_symbols.const_field_symbol.required_modifiers = const
|
|
||||||
|
|
||||||
dotnet_naming_rule.const_field_naming.symbols = const_field_symbol
|
|
||||||
dotnet_naming_rule.const_field_naming.style = pascal_case_style
|
|
||||||
dotnet_naming_rule.const_field_naming.severity = suggestion
|
|
||||||
|
|
||||||
# Public fields
|
|
||||||
dotnet_naming_symbols.public_field_symbol.applicable_kinds = field
|
dotnet_naming_symbols.public_field_symbol.applicable_kinds = field
|
||||||
dotnet_naming_symbols.public_field_symbol.applicable_accessibilities = public, internal, protected, protected_internal, private_protected
|
dotnet_naming_symbols.public_field_symbol.applicable_accessibilities = public, internal, protected, protected_internal, private_protected
|
||||||
|
|
||||||
dotnet_naming_rule.public_field_naming.symbols = public_field_symbol
|
dotnet_naming_rule.public_field_naming.symbols = public_field_symbol
|
||||||
dotnet_naming_rule.public_field_naming.style = pascal_case_style
|
dotnet_naming_rule.public_field_naming.style = pascal_case_style
|
||||||
dotnet_naming_rule.public_field_naming.severity = suggestion
|
dotnet_naming_rule.public_field_naming.severity = error
|
||||||
|
|
||||||
# Other fields
|
# Parameters
|
||||||
dotnet_naming_symbols.other_field_symbol.applicable_kinds = field
|
dotnet_naming_symbols.parameter_symbol.applicable_kinds = parameter
|
||||||
dotnet_naming_symbols.other_field_symbol.applicable_accessibilities = *
|
dotnet_naming_symbols.parameter_symbol.applicable_accessibilities = *
|
||||||
|
|
||||||
dotnet_naming_rule.other_field_naming.symbols = other_field_symbol
|
dotnet_naming_rule.parameter_naming.symbols = parameter_symbol
|
||||||
dotnet_naming_rule.other_field_naming.style = _camelCase
|
dotnet_naming_rule.parameter_naming.style = camel_case_style
|
||||||
dotnet_naming_rule.other_field_naming.severity = suggestion
|
dotnet_naming_rule.parameter_naming.severity = error
|
||||||
|
|
||||||
# Everything Else
|
# Everything Local
|
||||||
dotnet_naming_symbols.everything_else.applicable_kinds = *
|
dotnet_naming_symbols.everything_else.applicable_kinds = local
|
||||||
dotnet_naming_symbols.everything_else.applicable_accessibilities = *
|
dotnet_naming_symbols.everything_else.applicable_accessibilities = *
|
||||||
|
|
||||||
dotnet_naming_rule.everything_else_naming.symbols = everything_else
|
dotnet_naming_rule.everything_else_naming.symbols = everything_else
|
||||||
dotnet_naming_rule.everything_else_naming.style = camel_case_style
|
dotnet_naming_rule.everything_else_naming.style = camel_case_style
|
||||||
dotnet_naming_rule.everything_else_naming.severity = suggestion
|
dotnet_naming_rule.everything_else_naming.severity = error
|
||||||
@@ -61,8 +61,8 @@ PaySharp.Qpay | [](htt
|
|||||||
|
|
||||||
# 开发环境
|
# 开发环境
|
||||||
* Windows 10
|
* Windows 10
|
||||||
* Visual Studio 2019(16.3)
|
* Visual Studio 2019(16.4)
|
||||||
* .NET Core SDK 3.0
|
* .NET Core SDK 3.1
|
||||||
|
|
||||||
# 如何使用
|
# 如何使用
|
||||||
---
|
---
|
||||||
@@ -109,4 +109,4 @@ https://qpay.qq.com/qpaywiki.shtml
|
|||||||
|
|
||||||
[stulzq](https://github.com/stulzq)
|
[stulzq](https://github.com/stulzq)
|
||||||
|
|
||||||
[EssenRoc](https://github.com/EssenRoc)
|
[Essensoft-Roc](https://github.com/Essensoft-Roc)
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"sdk": {
|
"sdk": {
|
||||||
"version": "3.0.100"
|
"version": "3.1.100"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-3
@@ -1,7 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>2.0.0</Version>
|
<Version>1.0.8</Version>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<PackageProjectUrl>https://github.com/Varorbc/PaySharp</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/Varorbc/PaySharp</PackageProjectUrl>
|
||||||
<Authors>Varorbc</Authors>
|
<Authors>Varorbc</Authors>
|
||||||
@@ -10,14 +10,21 @@
|
|||||||
<Copyright>Varorbc</Copyright>
|
<Copyright>Varorbc</Copyright>
|
||||||
<SignAssembly>true</SignAssembly>
|
<SignAssembly>true</SignAssembly>
|
||||||
<AssemblyOriginatorKeyFile>PaySharp.snk</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>PaySharp.snk</AssemblyOriginatorKeyFile>
|
||||||
<PackageIconUrl>https://github.com/Varorbc/PaySharp/raw/master/logo.png</PackageIconUrl>
|
<PackageIcon>logo.png</PackageIcon>
|
||||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
<IncludeSymbols>true</IncludeSymbols>
|
<IncludeSymbols>true</IncludeSymbols>
|
||||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19367-01" PrivateAssets="All"/>
|
<None Include="..\..\logo.png">
|
||||||
|
<Pack>True</Pack>
|
||||||
|
<PackagePath></PackagePath>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
#endif
|
#endif
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -34,7 +34,7 @@ namespace PaySharp.Alipay
|
|||||||
_merchant = merchant;
|
_merchant = merchant;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化支付宝网关
|
/// 初始化支付宝网关
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<Import Project="../../package.props" />
|
<Import Project="../../package.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net45;netcoreapp3.0</TargetFrameworks>
|
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
|
||||||
<Title>PaySharp.Alipay</Title>
|
<Title>PaySharp.Alipay</Title>
|
||||||
<Description>支付宝支付</Description>
|
<Description>支付宝支付</Description>
|
||||||
<PackageTags>dotnetcore;pay;alipay;</PackageTags>
|
<PackageTags>dotnetcore;pay;alipay;</PackageTags>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using PaySharp.Alipay;
|
using PaySharp.Alipay;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
#endif
|
#endif
|
||||||
using System;
|
using System;
|
||||||
@@ -406,7 +406,7 @@ namespace PaySharp.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 将表单数据转换为网关数据
|
/// 将表单数据转换为网关数据
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace PaySharp.Core
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
gatewayData.FromForm(HttpUtil.Form);
|
gatewayData.FromForm(HttpUtil.Form);
|
||||||
#else
|
#else
|
||||||
gatewayData.FromNameValueCollection(HttpUtil.Form);
|
gatewayData.FromNameValueCollection(HttpUtil.Form);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<Import Project="../../package.props" />
|
<Import Project="../../package.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net45;netcoreapp3.0</TargetFrameworks>
|
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
|
||||||
<Title>PaySharp.Core</Title>
|
<Title>PaySharp.Core</Title>
|
||||||
<Description>支付核心</Description>
|
<Description>支付核心</Description>
|
||||||
<PackageTags>dotnetcore;pay;</PackageTags>
|
<PackageTags>dotnetcore;pay;</PackageTags>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<Reference Include="System.Configuration" />
|
<Reference Include="System.Configuration" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
|
||||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ namespace PaySharp.Core.Utils
|
|||||||
|
|
||||||
if ("RSA2".Equals(signType))
|
if ("RSA2".Equals(signType))
|
||||||
{
|
{
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
signatureBytes = rsaCsp.SignData(dataBytes, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
|
signatureBytes = rsaCsp.SignData(dataBytes, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
|
||||||
#else
|
#else
|
||||||
signatureBytes = ((RSACryptoServiceProvider)rsaCsp).SignData(dataBytes, "SHA256");
|
signatureBytes = ((RSACryptoServiceProvider)rsaCsp).SignData(dataBytes, "SHA256");
|
||||||
@@ -105,7 +105,7 @@ namespace PaySharp.Core.Utils
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
signatureBytes = rsaCsp.SignData(dataBytes, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1);
|
signatureBytes = rsaCsp.SignData(dataBytes, HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1);
|
||||||
#else
|
#else
|
||||||
signatureBytes = ((RSACryptoServiceProvider)rsaCsp).SignData(dataBytes, "SHA1");
|
signatureBytes = ((RSACryptoServiceProvider)rsaCsp).SignData(dataBytes, "SHA1");
|
||||||
@@ -148,7 +148,7 @@ namespace PaySharp.Core.Utils
|
|||||||
|
|
||||||
if ("RSA2".Equals(signType))
|
if ("RSA2".Equals(signType))
|
||||||
{
|
{
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
bVerifyResultOriginal = rsa.VerifyData(Encoding.GetEncoding(charset).GetBytes(signContent),
|
bVerifyResultOriginal = rsa.VerifyData(Encoding.GetEncoding(charset).GetBytes(signContent),
|
||||||
Convert.FromBase64String(sign), HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
|
Convert.FromBase64String(sign), HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
|
||||||
#else
|
#else
|
||||||
@@ -158,7 +158,7 @@ namespace PaySharp.Core.Utils
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
bVerifyResultOriginal = rsa.VerifyData(Encoding.GetEncoding(charset).GetBytes(signContent),
|
bVerifyResultOriginal = rsa.VerifyData(Encoding.GetEncoding(charset).GetBytes(signContent),
|
||||||
Convert.FromBase64String(sign), HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1);
|
Convert.FromBase64String(sign), HashAlgorithmName.SHA1, RSASignaturePadding.Pkcs1);
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
#else
|
#else
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
@@ -21,7 +21,7 @@ namespace PaySharp.Core.Utils
|
|||||||
{
|
{
|
||||||
#region 属性
|
#region 属性
|
||||||
|
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
|
|
||||||
private static IHttpContextAccessor _httpContextAccessor;
|
private static IHttpContextAccessor _httpContextAccessor;
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ namespace PaySharp.Core.Utils
|
|||||||
{
|
{
|
||||||
Current.Response.ContentType = "text/plain;charset=utf-8";
|
Current.Response.ContentType = "text/plain;charset=utf-8";
|
||||||
|
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
await Current.Response.WriteAsync(text);
|
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-Disposition", "attachment;filename=" + WebUtility.UrlEncode(Path.GetFileName(stream.Name)));
|
||||||
Current.Response.Headers.Add("Content-Length", size.ToString());
|
Current.Response.Headers.Add("Content-Length", size.ToString());
|
||||||
|
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
await Current.Response.Body.WriteAsync(buffer, 0, (int)size);
|
await Current.Response.Body.WriteAsync(buffer, 0, (int)size);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<Import Project="../../package.props" />
|
<Import Project="../../package.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net45;netcoreapp3.0</TargetFrameworks>
|
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
|
||||||
<Title>PaySharp.Qpay</Title>
|
<Title>PaySharp.Qpay</Title>
|
||||||
<Description>QQ钱包支付</Description>
|
<Description>QQ钱包支付</Description>
|
||||||
<PackageTags>dotnetcore;pay;qpay;</PackageTags>
|
<PackageTags>dotnetcore;pay;qpay;</PackageTags>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
#endif
|
#endif
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -33,7 +33,7 @@ namespace PaySharp.Qpay
|
|||||||
_merchant = merchant;
|
_merchant = merchant;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化QQ钱包网关
|
/// 初始化QQ钱包网关
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using PaySharp.Core;
|
using PaySharp.Core;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<Import Project="../../package.props" />
|
<Import Project="../../package.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net45;netcoreapp3.0</TargetFrameworks>
|
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
|
||||||
<Title>PaySharp.Unionpay</Title>
|
<Title>PaySharp.Unionpay</Title>
|
||||||
<Description>银联支付</Description>
|
<Description>银联支付</Description>
|
||||||
<PackageTags>dotnetcore;pay;unionpay;</PackageTags>
|
<PackageTags>dotnetcore;pay;unionpay;</PackageTags>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using PaySharp.Core;
|
using PaySharp.Core;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
#endif
|
#endif
|
||||||
using System;
|
using System;
|
||||||
@@ -37,7 +37,7 @@ namespace PaySharp.Unionpay
|
|||||||
_merchant.CertKey = Util.GetCertKey(merchant.CertPath, merchant.CertPwd);
|
_merchant.CertKey = Util.GetCertKey(merchant.CertPath, merchant.CertPwd);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化银联支付网关
|
/// 初始化银联支付网关
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<Import Project="../../package.props" />
|
<Import Project="../../package.props" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>net45;netcoreapp3.0</TargetFrameworks>
|
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
|
||||||
<Title>PaySharp.Wechatpay</Title>
|
<Title>PaySharp.Wechatpay</Title>
|
||||||
<Description>微信支付</Description>
|
<Description>微信支付</Description>
|
||||||
<PackageTags>dotnetcore;pay;wechatpay;</PackageTags>
|
<PackageTags>dotnetcore;pay;wechatpay;</PackageTags>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
using System;
|
using System;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using PaySharp.Core;
|
using PaySharp.Core;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
#endif
|
#endif
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -35,7 +35,7 @@ namespace PaySharp.Wechatpay
|
|||||||
_merchant = merchant;
|
_merchant = merchant;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if NETCOREAPP3_0
|
#if NETCOREAPP3_1
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化微信支付网关
|
/// 初始化微信支付网关
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
@@ -14,8 +14,8 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Options" Version="3.0.0" />
|
<PackageReference Include="Microsoft.Extensions.Options" Version="3.1.0" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
|
||||||
<PackageReference Include="xunit" Version="2.4.1" />
|
<PackageReference Include="xunit" Version="2.4.1" />
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|||||||
Reference in New Issue
Block a user