From 74c659df7d42f2efeee15442d1bc8fbf326b1564 Mon Sep 17 00:00:00 2001 From: Roc Date: Wed, 9 Jan 2019 15:46:54 +0800 Subject: [PATCH] 2.3.1 --- common.props | 6 ++--- .../WebApplicationSample.csproj | 2 +- .../Utility/HttpClientExtensions.cs | 4 ++- .../Utility/JDPayUtility.cs | 26 +++++++++---------- .../Utility/HttpClientExtensions.cs | 3 ++- .../Utility/HttpClientExtensions.cs | 5 ++-- .../Utility/HttpClientExtensions.cs | 5 ++-- 7 files changed, 27 insertions(+), 24 deletions(-) diff --git a/common.props b/common.props index 63756efb7..c943ecd01 100644 --- a/common.props +++ b/common.props @@ -1,14 +1,14 @@ - 2.3.0 + 2.3.1 $(NoWarn);CS1570;CS1591 Essensoft.AspNetCore.Payment - © Essensoft 2018 + © Essensoft 2019 https://raw.githubusercontent.com/Essensoft/Payment/master/images/Payment.png https://github.com/Essensoft/Payment git https://github.com/Essensoft/Payment - https://raw.githubusercontent.com/Essensoft/Payment/master/LICENSE + https://raw.githubusercontent.com/Essensoft/Payment/master/LICENSE diff --git a/samples/WebApplicationSample/WebApplicationSample.csproj b/samples/WebApplicationSample/WebApplicationSample.csproj index 425c700c5..ca88162ea 100644 --- a/samples/WebApplicationSample/WebApplicationSample.csproj +++ b/samples/WebApplicationSample/WebApplicationSample.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Essensoft.AspNetCore.Payment.JDPay/Utility/HttpClientExtensions.cs b/src/Essensoft.AspNetCore.Payment.JDPay/Utility/HttpClientExtensions.cs index 604a2b0ea..55bf129da 100644 --- a/src/Essensoft.AspNetCore.Payment.JDPay/Utility/HttpClientExtensions.cs +++ b/src/Essensoft.AspNetCore.Payment.JDPay/Utility/HttpClientExtensions.cs @@ -12,9 +12,11 @@ public static class HttpClientExtensions /// /// 执行HTTP POST请求。 /// + /// HttpClient /// 请求地址 /// 请求内容 - /// HTTP响应 + /// 媒体类型 + /// HTTP响应内容 public static async Task DoPostAsync(this HttpClient client, string url, string content, string mediaType = "application/xml") { using (var requestContent = new StringContent(content, Encoding.UTF8, mediaType)) diff --git a/src/Essensoft.AspNetCore.Payment.JDPay/Utility/JDPayUtility.cs b/src/Essensoft.AspNetCore.Payment.JDPay/Utility/JDPayUtility.cs index 80cbf5310..0a696ebd2 100644 --- a/src/Essensoft.AspNetCore.Payment.JDPay/Utility/JDPayUtility.cs +++ b/src/Essensoft.AspNetCore.Payment.JDPay/Utility/JDPayUtility.cs @@ -44,23 +44,21 @@ internal static bool HasTextXmlContentType(this HttpRequest request) /// /// 尝试将对象实例转换成目标类型 /// - /// 对象实例类型 - /// 目标类型 - /// 对象实例 - /// 默认值 + /// 对象实例 + /// 目的类型 /// 转换后类型 - internal static object TryTo(this object Object, Type destinationType) + internal static object TryTo(this object obj, Type destinationType) { try { - if (Object == null || Convert.IsDBNull(Object)) + if (obj == null || Convert.IsDBNull(obj)) { return GetDefault(destinationType); } - if (Object as string != null) + if (obj as string != null) { - var ObjectValue = Object as string; + var ObjectValue = obj as string; if (destinationType.IsEnum) { return Enum.Parse(destinationType, ObjectValue, true); @@ -71,22 +69,22 @@ internal static object TryTo(this object Object, Type destinationType) return GetDefault(destinationType); } } - if (Object as IConvertible != null) + if (obj as IConvertible != null) { var destination = destinationType.IsGenericType && destinationType.GetGenericTypeDefinition() == typeof(Nullable<>) ? Nullable.GetUnderlyingType(destinationType) : destinationType; - return Convert.ChangeType(Object, destination); + return Convert.ChangeType(obj, destination); } - if (destinationType.IsAssignableFrom(Object.GetType())) + if (destinationType.IsAssignableFrom(obj.GetType())) { - return Object; + return obj; } - var Converter = TypeDescriptor.GetConverter(Object.GetType()); + var Converter = TypeDescriptor.GetConverter(obj.GetType()); if (Converter.CanConvertTo(destinationType)) { - return Converter.ConvertTo(Object, destinationType); + return Converter.ConvertTo(obj, destinationType); } } catch { } diff --git a/src/Essensoft.AspNetCore.Payment.LianLianPay/Utility/HttpClientExtensions.cs b/src/Essensoft.AspNetCore.Payment.LianLianPay/Utility/HttpClientExtensions.cs index b7aa86a28..4e800b490 100644 --- a/src/Essensoft.AspNetCore.Payment.LianLianPay/Utility/HttpClientExtensions.cs +++ b/src/Essensoft.AspNetCore.Payment.LianLianPay/Utility/HttpClientExtensions.cs @@ -12,9 +12,10 @@ public static class HttpClientExtensions /// /// 执行HTTP POST请求。 /// + /// HttpClient /// 请求地址 /// 请求内容 - /// HTTP响应 + /// HTTP响应内容 public static async Task DoPostAsync(this HttpClient client, string url, string content) { using (var requestContent = new StringContent(content, Encoding.UTF8, "application/json")) diff --git a/src/Essensoft.AspNetCore.Payment.QPay/Utility/HttpClientExtensions.cs b/src/Essensoft.AspNetCore.Payment.QPay/Utility/HttpClientExtensions.cs index ad20d1537..53f8a81df 100644 --- a/src/Essensoft.AspNetCore.Payment.QPay/Utility/HttpClientExtensions.cs +++ b/src/Essensoft.AspNetCore.Payment.QPay/Utility/HttpClientExtensions.cs @@ -12,9 +12,10 @@ public static class HttpClientExtensions /// /// 执行HTTP POST请求。 /// + /// HttpClient /// 请求地址 - /// 请求参数 - /// HTTP响应 + /// 请求内容 + /// HTTP响应内容 public static async Task DoPostAsync(this HttpClient client, string url, string content) { using (var requestContent = new StringContent(content, Encoding.UTF8, "application/xml")) diff --git a/src/Essensoft.AspNetCore.Payment.WeChatPay/Utility/HttpClientExtensions.cs b/src/Essensoft.AspNetCore.Payment.WeChatPay/Utility/HttpClientExtensions.cs index d4fc1c527..4acad53d3 100644 --- a/src/Essensoft.AspNetCore.Payment.WeChatPay/Utility/HttpClientExtensions.cs +++ b/src/Essensoft.AspNetCore.Payment.WeChatPay/Utility/HttpClientExtensions.cs @@ -12,9 +12,10 @@ public static class HttpClientExtensions /// /// 执行HTTP POST请求。 /// + /// HttpClient /// 请求地址 - /// 请求参数 - /// HTTP响应 + /// 请求内容 + /// HTTP响应内容 public static async Task DoPostAsync(this HttpClient client, string url, string content) { using (var requestContent = new StringContent(content, Encoding.UTF8, "application/xml"))