From 215e6df56de3e63ce8a6434864eab78a5afe3978 Mon Sep 17 00:00:00 2001 From: Fu Diwei Date: Fri, 27 May 2022 10:55:59 +0800 Subject: [PATCH] feat(tenpayv3): bump version to v2.9.1 --- CHANGELOG.md | 6 ++++- .../Utilities/Internal/JWTUtility.cs | 27 ------------------- ...payClientExecuteProfitSharingExtensions.cs | 2 +- ...aringReturnOrderByOutOrderNumberRequest.cs | 2 +- ...ringReturnOrderByOutOrderNumberResponse.cs | 2 +- ...KIT.FlurlHttpClient.Wechat.TenpayV3.csproj | 2 +- .../TestCase_JWTUtilityTests.cs | 26 ------------------ 7 files changed, 9 insertions(+), 58 deletions(-) delete mode 100644 src/SKIT.FlurlHttpClient.Wechat.OpenAI/Utilities/Internal/JWTUtility.cs delete mode 100644 test/SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests/TestCase_JWTUtilityTests.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index c0dfa2c6..fad23d38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,7 +50,7 @@ - **新增**:随官方更新自定义交易组件获取售后详情接口响应模型。([GitHub PR #40](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/pull/40)) - - **新增**:随官方更新生成小程序码接口请求模型。([Gitee PR #6]https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/pulls/6)) + - **新增**:随官方更新生成小程序码接口请求模型。([Gitee PR #6](https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/pulls/6)) - **修复**:修复上传素材接口不支持 Unicode 文件名问题。([GitHub Issue #40](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/issues/40)) @@ -328,6 +328,10 @@ [展开查看] +- Release 2.9.1 + + - **修复**:修复查询分账回退结果接口 URL 错误。([GitHub Issue #46](https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat/issues/46)) + - Release 2.9.0 - **新增**:随官方更新特约商户进件、电商收付通二级商户进件相关接口模型。 diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Utilities/Internal/JWTUtility.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Utilities/Internal/JWTUtility.cs deleted file mode 100644 index 801eea45..00000000 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Utilities/Internal/JWTUtility.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using JWT; -using JWT.Algorithms; -using JWT.Serializers; -using Newtonsoft.Json; - -namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Utilities -{ - internal static class JwtUtility - { - private static readonly Lazy _encoder = new Lazy(() => - { -#pragma warning disable CS0618 - IJwtAlgorithm algorithm = new HMACSHA256Algorithm(); -#pragma warning restore CS0618 - IJsonSerializer serializer = new JsonNetSerializer(new JsonSerializer() { NullValueHandling = NullValueHandling.Ignore }); - IBase64UrlEncoder urlEncoder = new JwtBase64UrlEncoder(); - IJwtEncoder encoder = new JwtEncoder(algorithm, serializer, urlEncoder); - return encoder; - }, isThreadSafe: true); - - public static string EncodeWithHS256(object payload, string secret) - { - return _encoder.Value.Encode(payload, secret); - } - } -} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteProfitSharingExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteProfitSharingExtensions.cs index 589b3188..0ba8fa7d 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteProfitSharingExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Extensions/WechatTenpayClientExecuteProfitSharingExtensions.cs @@ -77,7 +77,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 } /// - /// 异步调用 [GET] /profitsharing/return-orders 接口。 + /// 异步调用 [GET] /profitsharing/return-orders/{out_order_no} 接口。 /// REF: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter8_1_4.shtml /// REF: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter8_1_4.shtml /// diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/ProfitSharing/GetProfitSharingReturnOrderByOutOrderNumberRequest.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/ProfitSharing/GetProfitSharingReturnOrderByOutOrderNumberRequest.cs index b5fc22f7..71f9c7e5 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/ProfitSharing/GetProfitSharingReturnOrderByOutOrderNumberRequest.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/ProfitSharing/GetProfitSharingReturnOrderByOutOrderNumberRequest.cs @@ -1,7 +1,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models { /// - /// 表示 [GET] /profitsharing/return-orders 接口的请求。 + /// 表示 [GET] /profitsharing/return-orders/{out_order_no} 接口的请求。 /// public class GetProfitSharingReturnOrderByOutOrderNumberRequest : WechatTenpayRequest { diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/ProfitSharing/GetProfitSharingReturnOrderByOutOrderNumberResponse.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/ProfitSharing/GetProfitSharingReturnOrderByOutOrderNumberResponse.cs index 4ce7218f..9d7a0e3d 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/ProfitSharing/GetProfitSharingReturnOrderByOutOrderNumberResponse.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Models/ProfitSharing/GetProfitSharingReturnOrderByOutOrderNumberResponse.cs @@ -3,7 +3,7 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Models { /// - /// 表示 [GET] /profitsharing/return-orders 接口的响应。 + /// 表示 [GET] /profitsharing/return-orders/{out_order_no} 接口的响应。 /// public class GetProfitSharingReturnOrderByOutOrderNumberResponse : WechatTenpayResponse { diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/SKIT.FlurlHttpClient.Wechat.TenpayV3.csproj b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/SKIT.FlurlHttpClient.Wechat.TenpayV3.csproj index 38e921a5..7e405f36 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/SKIT.FlurlHttpClient.Wechat.TenpayV3.csproj +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/SKIT.FlurlHttpClient.Wechat.TenpayV3.csproj @@ -14,7 +14,7 @@ MIT https://github.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat Flurl.Http Wechat Weixin MicroMessage Tenpay WechatPay WeixinPay Wxpay 微信 微信支付 微信商户 - 2.9.0 + 2.9.1 基于 Flurl.Http 的微信支付 API v3 版客户端,支持直连商户、服务商模式,支持基础支付、代金券、商家券、委托营销、消费卡、支付有礼、银行定向促活、微信支付分、微信先享卡、支付即服务、点金计划、智慧商圈、电商收付通、二级商户进件、小微商户进件、消费者投诉、商户违规通知、批量转账到零钱、银行组件、海关报关、融合钱包等功能。 Fu Diwei git diff --git a/test/SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests/TestCase_JWTUtilityTests.cs b/test/SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests/TestCase_JWTUtilityTests.cs deleted file mode 100644 index 84bb29d7..00000000 --- a/test/SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests/TestCase_JWTUtilityTests.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Xunit; - -namespace SKIT.FlurlHttpClient.Wechat.OpenAI.UnitTests -{ - public class TestCase_JwtUtilityTests - { - [Fact(DisplayName = "测试用例:JWT HS256 编码")] - public void TestJwtEncodeWithHS256() - { - object payload = new - { - uid = "xjlsj33lasfaf", - data = new - { - q = "在微信智言与微信智聆两大技术的支持下,微信AI团队推出了“微信对话开放平台”和“腾讯小微”智能硬件两大核心产品。微信支付团队最新发布的“微信青蛙Pro”在现场设置了体验区,让大家感受AI认脸的本事。" - } - }; - string secret = "jWmYm7qr5nMoAUwZRjGtBxmz3KA1tkAj3ykkR6q2B2C"; - - string actualJwt = Utilities.JwtUtility.EncodeWithHS256(payload: payload, secret: secret); - string expectedJwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiJ4amxzajMzbGFzZmFmIiwiZGF0YSI6eyJxIjoi5Zyo5b6u5L-h5pm66KiA5LiO5b6u5L-h5pm66IGG5Lik5aSn5oqA5pyv55qE5pSv5oyB5LiL77yM5b6u5L-hQUnlm6LpmJ_mjqjlh7rkuobigJzlvq7kv6Hlr7nor53lvIDmlL7lubPlj7DigJ3lkozigJzohb7orq_lsI_lvq7igJ3mmbrog73noazku7bkuKTlpKfmoLjlv4Pkuqflk4HjgILlvq7kv6HmlK_ku5jlm6LpmJ_mnIDmlrDlj5HluIPnmoTigJzlvq7kv6HpnZLom5lQcm_igJ3lnKjnjrDlnLrorr7nva7kuobkvZPpqozljLrvvIzorqnlpKflrrbmhJ_lj5dBSeiupOiEuOeahOacrOS6i-OAgiJ9fQ.8FeSvxKlIrbI6MCAaWGekB4sHGA8DeUxgVXiHa8ulJk"; - - Assert.Equal(expectedJwt, actualJwt, ignoreCase: true); - } - } -}