From 6decd2839b9a591043dea37c0e600490035ce8f9 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Fri, 3 Jan 2025 20:34:55 +0800 Subject: [PATCH 01/56] =?UTF-8?q?:memo:=20=E6=9B=B4=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ab645b7c4..f55394ef6 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ ### 重要信息 1. [`WxJava` 荣获 `GitCode` 2024年度十大开源社区奖项](https://mp.weixin.qq.com/s/wM_UlMsDm3IZ1CPPDvcvQw)。 2. 项目合作洽谈请联系微信`binary0000`(在微信里自行搜索并添加好友,请注明来意,如有关于SDK问题需讨论请参考下文入群讨论,不要加此微信)。 -3. **2023-12-28 发布 [【4.6.0正式版】](https://mp.weixin.qq.com/s/9Hhc_8w-v7ogS_TEAsqfAg)**! +3. **2024-12-30 发布 [【4.7.0正式版】](https://mp.weixin.qq.com/s/_7k-XLYBqeJJhvHWCsdT0A)**! 4. 贡献源码可以参考视频:[【贡献源码全过程(上集)】](https://mp.weixin.qq.com/s/3xUZSATWwHR_gZZm207h7Q)、[【贡献源码全过程(下集)】](https://mp.weixin.qq.com/s/nyzJwVVoYSJ4hSbwyvTx9A) ,友情提供:[程序员小山与Bug](https://space.bilibili.com/473631007) 5. 新手重要提示:本项目仅是一个SDK开发工具包,未提供Web实现,建议使用 `maven` 或 `gradle` 引用本项目即可使用本SDK提供的各种功能,详情可参考 **[【Demo项目】](demo.md)** 或本项目中的部分单元测试代码; 6. 微信开发新手请务必阅读【开发文档】([Gitee Wiki](https://gitee.com/binary/weixin-java-tools/wikis/Home) 或者 [Github Wiki](https://github.com/binarywang/WxJava/wiki))的常见问题部分,可以少走很多弯路,节省不少时间。 @@ -90,7 +90,7 @@ com.github.binarywang (不同模块参考下文) - 4.6.0 + 4.7.0 ``` From 9730e9a38712d0dd06a6a7f97a5ca26c5bdcf28e Mon Sep 17 00:00:00 2001 From: lzq52066 <50949059+lzq52066@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:22:21 +0800 Subject: [PATCH 02/56] =?UTF-8?q?:art:=20#3054=20=E3=80=90=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E3=80=91=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E9=AB=98=E7=89=88=E6=9C=ACjdk?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=B8=8B=E5=87=BA=E7=8E=B0=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8C=96=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java index 8af0626b9..344418e31 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java @@ -499,7 +499,10 @@ public WxMaConfig getWxMaConfig() { @Override public void setWxMaConfig(WxMaConfig maConfig) { final String appid = maConfig.getAppid(); - this.setMultiConfigs(ImmutableMap.of(appid, maConfig), appid); + Map map = new HashMap<>(); + map.put(appid, maConfig); + Map configMap = Collections.unmodifiableMap(map); + this.setMultiConfigs(configMap, appid); } @Override From 6d9fadf86d33bd1e81eda33b0cfc9312aceeeed6 Mon Sep 17 00:00:00 2001 From: huangj <15150599658@163.com> Date: Thu, 9 Jan 2025 16:37:40 +0800 Subject: [PATCH 03/56] =?UTF-8?q?:art:=E3=80=90=E4=BC=81=E4=B8=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E3=80=91=E4=BC=9A=E8=AF=9D=E5=86=85=E5=AE=B9=E5=AD=98?= =?UTF-8?q?=E6=A1=A3=20-=20=E8=A7=A3=E5=AF=86=E5=90=8E=E7=9A=84=E4=BC=9A?= =?UTF-8?q?=E8=AF=9D=E5=86=85=E5=AE=B9=E5=AE=9E=E4=BD=93=E7=B1=BB=E9=87=8C?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99=E7=9A=84=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java index d843cad6c..8a9d2130d 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java @@ -25,9 +25,6 @@ public class WxCpChatModel implements Serializable { @SerializedName("action") private String action; - @SerializedName("send") - private String send; - @SerializedName("from") private String from; From 83bd92d2605cbadabc7202d3571126721ccfa6c8 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Mon, 13 Jan 2025 08:51:16 +0800 Subject: [PATCH 04/56] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.1.B?= =?UTF-8?q?=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- solon-plugins/pom.xml | 2 +- solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +- spring-boot-starters/pom.xml | 2 +- .../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +- .../wx-java-channel-spring-boot-starter/pom.xml | 2 +- .../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +- .../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +- .../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +- .../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +- weixin-graal/pom.xml | 2 +- weixin-java-channel/pom.xml | 2 +- weixin-java-common/pom.xml | 2 +- weixin-java-cp/pom.xml | 2 +- weixin-java-miniapp/pom.xml | 2 +- weixin-java-mp/pom.xml | 2 +- weixin-java-open/pom.xml | 2 +- weixin-java-pay/pom.xml | 2 +- weixin-java-qidian/pom.xml | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/pom.xml b/pom.xml index 730f6b580..9f0362816 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.github.binarywang wx-java - 4.7.0 + 4.7.1.B pom WxJava - Weixin/Wechat Java SDK 微信开发Java SDK diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml index bf956526c..9e52bec0c 100644 --- a/solon-plugins/pom.xml +++ b/solon-plugins/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.0 + 4.7.1.B pom wx-java-solon-plugins diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml index aa9911e11..687ac3e99 100644 --- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml index dda371c78..bc8c46627 100644 --- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml @@ -3,7 +3,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml index d2218490b..5787c42ee 100644 --- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml index 05598d6b9..7c39166d1 100644 --- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml index deca9a2ff..7740ce99c 100644 --- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml index 507514032..8654c698e 100644 --- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml index 67f9e2da3..1bb196015 100644 --- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml index 5dcea9ac9..f2925cd1a 100644 --- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml index bd8c9e3e4..87d5c08c4 100644 --- a/solon-plugins/wx-java-open-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml index 47153d8f1..bfc53597d 100644 --- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml index b5488655e..e95b83510 100644 --- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml @@ -3,7 +3,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml index 75f2d9486..3f5839696 100644 --- a/spring-boot-starters/pom.xml +++ b/spring-boot-starters/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.0 + 4.7.1.B pom wx-java-spring-boot-starters diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml index b67cc1733..e8dde0974 100644 --- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml index 4a4567198..6a63849e6 100644 --- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml @@ -3,7 +3,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml index 0128c7bf5..65419e065 100644 --- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml index 59c2f63f8..73e70ce07 100644 --- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml index c90f2b741..74e5082e3 100644 --- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml index 2eaa6f1c7..b2495d9d7 100644 --- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml index 3ec7cf516..48bf3c483 100644 --- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml index 4bc7037c2..4d0b88794 100644 --- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml index cd6f25e89..6505cafac 100644 --- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml index 960556dad..96c6e8b7a 100644 --- a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml index 5fe49991e..e735cb82d 100644 --- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml @@ -3,7 +3,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml index 44c7c952f..7f2eb89e4 100644 --- a/weixin-graal/pom.xml +++ b/weixin-graal/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.0 + 4.7.1.B weixin-graal diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml index 0cb27642a..c1fe4637d 100644 --- a/weixin-java-channel/pom.xml +++ b/weixin-java-channel/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.0 + 4.7.1.B weixin-java-channel diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml index b775fab23..7cfce1c1a 100644 --- a/weixin-java-common/pom.xml +++ b/weixin-java-common/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.0 + 4.7.1.B weixin-java-common diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml index 85a37ba2f..e3a64d000 100644 --- a/weixin-java-cp/pom.xml +++ b/weixin-java-cp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.0 + 4.7.1.B weixin-java-cp diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml index a9bb5f37d..5b85813dc 100644 --- a/weixin-java-miniapp/pom.xml +++ b/weixin-java-miniapp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.0 + 4.7.1.B weixin-java-miniapp diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml index c8c3f298c..ffb3eae28 100644 --- a/weixin-java-mp/pom.xml +++ b/weixin-java-mp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.0 + 4.7.1.B weixin-java-mp diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml index 0146f516a..58ecb292d 100644 --- a/weixin-java-open/pom.xml +++ b/weixin-java-open/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.0 + 4.7.1.B weixin-java-open diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml index cba2ede00..1c64b458f 100644 --- a/weixin-java-pay/pom.xml +++ b/weixin-java-pay/pom.xml @@ -5,7 +5,7 @@ com.github.binarywang wx-java - 4.7.0 + 4.7.1.B 4.0.0 diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml index 31a0c21dc..25718264f 100644 --- a/weixin-java-qidian/pom.xml +++ b/weixin-java-qidian/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.0 + 4.7.1.B weixin-java-qidian From be0dd8b692873af324292a4a85baae391a141cc8 Mon Sep 17 00:00:00 2001 From: allovine Date: Thu, 16 Jan 2025 13:46:02 +0800 Subject: [PATCH 05/56] =?UTF-8?q?:new:=20#3474=20=E3=80=90=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E5=A2=9E=E5=8A=A02025.1.15?= =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E4=B8=8A=E7=BA=BF=E7=9A=84=E5=95=86=E6=88=B7?= =?UTF-8?q?=E8=BD=AC=E8=B4=A6=E6=96=B0=E7=89=88=E6=9C=AC=E7=9A=84=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transfer/TransferBillsNotifyResult.java | 79 +++++++++++++ .../bean/transfer/TransferBillsRequest.java | 108 ++++++++++++++++++ .../bean/transfer/TransferBillsResult.java | 55 +++++++++ .../wxpay/service/TransferService.java | 27 +++++ .../wxpay/service/WxPayService.java | 12 ++ .../service/impl/BaseWxPayServiceImpl.java | 6 + .../service/impl/TransferServiceImpl.java | 16 +++ .../service/impl/TransferServiceImplTest.java | 14 +++ 8 files changed, 317 insertions(+) create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsNotifyResult.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsRequest.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsNotifyResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsNotifyResult.java new file mode 100644 index 000000000..80709a102 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsNotifyResult.java @@ -0,0 +1,79 @@ +package com.github.binarywang.wxpay.bean.transfer; + +import com.github.binarywang.wxpay.bean.notify.OriginNotifyResponse; +import com.github.binarywang.wxpay.bean.notify.WxPayBaseNotifyV3Result; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + *
+ *    商家转账到零钱接口将转账结果通知用户
+ *    文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4012716434
+ *  
+ */ +@Data +public class TransferBillsNotifyResult implements Serializable, WxPayBaseNotifyV3Result { + /** + * 源数据 + */ + private OriginNotifyResponse rawData; + /** + * 解密后的数据 + */ + private TransferBillsNotifyResult.DecryptNotifyResult result; + + @Data + @NoArgsConstructor + public static class DecryptNotifyResult implements Serializable { + /** + * 商户号 + */ + @SerializedName(value = "mch_id") + private String mchId; + /** + * 商家批次单号 + */ + @SerializedName(value = "out_bill_no") + private String outBillNo; + /** + * 微信批次单号 + */ + @SerializedName(value = "transfer_bill_no") + private String transferBillNo; + /** + * 批次状态 + */ + @SerializedName(value = "state") + private String state; + /** + * 转账金额 + */ + @SerializedName(value = "transfer_amount") + private Integer transferAmount; + + /** + * 批次状态 + */ + @SerializedName(value = "openid") + private String openid; + + /** + * 单据创建时间 + */ + @SerializedName(value = "create_time") + private String createTime; + /** + * 最后一次状态变更时间 + */ + @SerializedName(value = "update_time") + private String updateTime; + /** + * 错误原因 + */ + @SerializedName(value = "fail_reason") + private String failReason; + } +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsRequest.java new file mode 100644 index 000000000..230e564e4 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsRequest.java @@ -0,0 +1,108 @@ +package com.github.binarywang.wxpay.bean.transfer; + +import com.github.binarywang.wxpay.v3.SpecEncrypt; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * 发起商家转账API参数 + * + * @author allovine + * created on 2025/1/15 + **/ +@Data +@Builder(builderMethodName = "newBuilder") +@NoArgsConstructor +@AllArgsConstructor +public class TransferBillsRequest implements Serializable { + private static final long serialVersionUID = -2175582517588397437L; + + /** + * 直连商户的appid + */ + @SerializedName("appid") + private String appid; + + /** + * 商户系统内部的商家单号 + */ + @SerializedName("out_bill_no") + private String outBillNo; + + /** + * 转账场景ID + * 商户平台-产品中心-商家转账 申请 + * 佣金报酬 ID:1005 + */ + @SerializedName("transfer_scene_id") + private String transferSceneId; + + /** + * 用户在直连商户应用下的用户标示 + */ + @SerializedName("openid") + private String openid; + + /** + * 收款用户姓名 + */ + @SpecEncrypt + @SerializedName("user_name") + private String userName; + + /** + * 转账金额 + */ + @SerializedName("transfer_amount") + private Integer transferAmount; + + /** + * 转账备注 + */ + @SerializedName("transfer_remark") + private String transferRemark; + + /** + * 异步接收微信支付结果通知的回调地址,通知url必须为公网可访问的url,必须为https,不能携带参数 + */ + @SerializedName("notify_url") + private String notifyUrl; + + /** + * 用户收款感知 + */ + @SerializedName("user_recv_perception") + private String userRecvPerception; + + + /** + * 转账场景报备信息 + */ + @SerializedName("transfer_scene_report_infos") + private List transferSceneReportInfos; + + + @Data + @Builder(builderMethodName = "newBuilder") + @AllArgsConstructor + @NoArgsConstructor + public static class TransferSceneReportInfo { + /** + * 信息类型 + */ + @SerializedName("info_type") + private String infoType; + + /** + * 信息内容 + */ + @SerializedName("info_content") + private String infoContent; + } +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java new file mode 100644 index 000000000..9f7aac7fb --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java @@ -0,0 +1,55 @@ +package com.github.binarywang.wxpay.bean.transfer; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 商家转账结果 + * + * @author allovine + * created on 2025/1/15 + **/ +@Data +@NoArgsConstructor +public class TransferBillsResult implements Serializable { + private static final long serialVersionUID = -2175582517588397437L; + + /** + * 商户单号 + */ + @SerializedName("out_bill_no") + private String outBillNo; + + /** + * 微信转账单号 + */ + @SerializedName("transfer_bill_no") + private String transferBillNo; + + /** + * 单据创建时间 + */ + @SerializedName("create_time") + private String createTime; + + /** + * 单据状态 + */ + @SerializedName("status") + private String status; + + /** + * 失败原因 + */ + @SerializedName("fail_reason") + private String failReason; + + /** + * 跳转领取页面的package信息 + */ + @SerializedName("package_info") + private String packageInfo; +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java index ebf746214..c02430a96 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java @@ -111,4 +111,31 @@ public interface TransferService { */ TransferBatchDetailResult transferBatchesOutBatchNoDetail(String outBatchNo, String outDetailNo) throws WxPayException; + /** + *
+   *
+   * 2025.1.15 开始新接口 发起商家转账API
+   *
+   * 请求方式:POST(HTTPS)
+   * 请求地址:请求地址
+   *
+   * 文档地址:发起商家转账API
+   * 
+ * + * @param request 转账请求参数 + * @return TransferBillsResult 转账结果 + * @throws WxPayException . + */ + TransferBillsResult transferBills(TransferBillsRequest request) throws WxPayException; + + /** + * 2025.1.15 开始新接口 解析商家转账结果 + * 详见 + * + * @param notifyData 通知数据 + * @param header 通知头部数据,不传则表示不校验头 + * @return the wx transfer notify result + * @throws WxPayException the wx pay exception + */ + TransferBillsNotifyResult parseTransferBillsNotifyResult(String notifyData, SignatureHeader header) throws WxPayException; } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java index 57c2937c6..19b4ed0a0 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java @@ -6,6 +6,7 @@ import com.github.binarywang.wxpay.bean.request.*; import com.github.binarywang.wxpay.bean.result.*; import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum; +import com.github.binarywang.wxpay.bean.transfer.TransferBillsNotifyResult; import com.github.binarywang.wxpay.config.WxPayConfig; import com.github.binarywang.wxpay.constant.WxPayConstants; import com.github.binarywang.wxpay.exception.WxPayException; @@ -991,6 +992,17 @@ WxPayRefundQueryResult refundQuery(String transactionId, String outTradeNo, Stri */ WxPayTransferBatchesNotifyV3Result parseTransferBatchesNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException; + /** + * 解析商家转账批次回调通知 + * https://pay.weixin.qq.com/doc/v3/merchant/4012712115 + * + * @param notifyData + * @param header + * @return + * @throws WxPayException + */ + TransferBillsNotifyResult parseTransferBillsNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException; + /** * 解析服务商模式退款结果通知 * 详见https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_1_11.shtml diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java index c9fc1e7bd..7c2055cec 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java @@ -11,6 +11,7 @@ import com.github.binarywang.wxpay.bean.request.*; import com.github.binarywang.wxpay.bean.result.*; import com.github.binarywang.wxpay.bean.result.enums.TradeTypeEnum; +import com.github.binarywang.wxpay.bean.transfer.TransferBillsNotifyResult; import com.github.binarywang.wxpay.config.WxPayConfig; import com.github.binarywang.wxpay.config.WxPayConfigHolder; import com.github.binarywang.wxpay.constant.WxPayConstants; @@ -442,6 +443,11 @@ public WxPayTransferBatchesNotifyV3Result parseTransferBatchesNotifyV3Result(Str return this.baseParseOrderNotifyV3Result(notifyData, header, WxPayTransferBatchesNotifyV3Result.class, WxPayTransferBatchesNotifyV3Result.DecryptNotifyResult.class); } + @Override + public TransferBillsNotifyResult parseTransferBillsNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException { + return this.baseParseOrderNotifyV3Result(notifyData, header, TransferBillsNotifyResult.class, TransferBillsNotifyResult.DecryptNotifyResult.class); + } + @Override public WxPayPartnerRefundNotifyV3Result parsePartnerRefundNotifyV3Result(String notifyData, SignatureHeader header) throws WxPayException { return this.baseParseOrderNotifyV3Result(notifyData, header, WxPayPartnerRefundNotifyV3Result.class, WxPayPartnerRefundNotifyV3Result.DecryptNotifyResult.class); diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java index e62dc9c05..23bf7b13e 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java @@ -85,4 +85,20 @@ public TransferBatchDetailResult transferBatchesOutBatchNoDetail(String outBatch String result = this.payService.getV3(url); return GSON.fromJson(result, TransferBatchDetailResult.class); } + + @Override + public TransferBillsResult transferBills(TransferBillsRequest request) throws WxPayException { + String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills", this.payService.getPayBaseUrl()); + if (request.getUserName() != null && request.getUserName().length() > 0) { + X509Certificate validCertificate = this.payService.getConfig().getVerifier().getValidCertificate(); + RsaCryptoUtil.encryptFields(request, validCertificate); + } + String result = this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request)); + return GSON.fromJson(result, TransferBillsResult.class); + } + + @Override + public TransferBillsNotifyResult parseTransferBillsNotifyResult(String notifyData, SignatureHeader header) throws WxPayException { + return this.payService.baseParseOrderNotifyV3Result(notifyData, header, TransferBillsNotifyResult.class, TransferBillsNotifyResult.DecryptNotifyResult.class); + } } diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java index 7f89bd472..cd607dff0 100644 --- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java +++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java @@ -2,6 +2,7 @@ import com.github.binarywang.wxpay.bean.transfer.QueryTransferBatchesRequest; import com.github.binarywang.wxpay.bean.transfer.TransferBatchesRequest; +import com.github.binarywang.wxpay.bean.transfer.TransferBillsRequest; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.service.WxPayService; import com.github.binarywang.wxpay.testbase.ApiTestModule; @@ -73,4 +74,17 @@ public void testTransferBatchesOutBatchNo() throws WxPayException { public void testTransferBatchesOutBatchNoDetail() throws WxPayException { log.info("商家明细单号查询明细单:{}", this.payService.getTransferService().transferBatchesOutBatchNoDetail("1655447999520", "1655447989156")); } + + @Test + public void testTransferBills() throws WxPayException { + TransferBillsRequest transferBillsRequest = TransferBillsRequest.newBuilder() + .appid("wxf636efh5xxxxx") + .outBillNo("1655447989156") + .transferSceneId("1005") + .transferAmount(100) + .transferRemark("测试转账") + .openid("oX_7Jzr9gSZz4X_Xc9-_7HGf8XzI") + .userName("测试用户").build(); + log.info("发起商家转账:{}", this.payService.getTransferService().transferBills(transferBillsRequest)); + } } From b4b73ad40acdda3853ddc2c06f3098d10ba7be34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=98=E5=AE=89?= Date: Thu, 16 Jan 2025 13:47:55 +0800 Subject: [PATCH 06/56] =?UTF-8?q?:art:=20#3467=20=E3=80=90=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E5=95=86=E6=88=B7=E8=BF=9B?= =?UTF-8?q?=E4=BB=B6=E5=BC=80=E6=88=B7=E6=84=8F=E6=84=BF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApplySubjectConfirmCreateRequest.java | 37 +++++-------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyconfirm/ApplySubjectConfirmCreateRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyconfirm/ApplySubjectConfirmCreateRequest.java index b95061461..d77522ecc 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyconfirm/ApplySubjectConfirmCreateRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyconfirm/ApplySubjectConfirmCreateRequest.java @@ -119,8 +119,8 @@ public static class ApplySubConfirmIdentificationInfo implements Serializable { * IDENTIFICATION_TYPE_TAIWAN_RESIDENT:台湾居民证 * 示例值:IDENTIFICATION_TYPE_IDCARD */ - @SerializedName("id_doc_type") - private IdTypeEnum idDocType; + @SerializedName("identification_type") + private IdTypeEnum identificationType; /** * 法定代表人说明函 @@ -414,13 +414,13 @@ public static class ApplySubConfirmSubjectInfo implements Serializable { * 若未传入将默认填写:false。 * 示例值:true */ - @SerializedName("finance_institution") + @SerializedName("is_finance_institution") private Boolean financeInstitution; /** * 营业执照 */ - @SerializedName("business_license_info") + @SerializedName("business_licence_info") private ApplySubConfirmBusinessLicenseInfo businessLicenseInfo; /** * 登记证书 @@ -736,8 +736,8 @@ public static class ApplySubConfirmSpecialOperationList implements Serializable * 参看微信支付提供的特殊行业id对照表 * 示例值:100 */ - @SerializedName("finance_type") - private Integer financeType; + @SerializedName("category_id") + private Integer categoryId; /** * 行业经营许可证资质照片 @@ -791,29 +791,10 @@ public static class ApplySubConfirmAdditionInfo implements Serializable { private static final long serialVersionUID = 1L; /** - * 法人开户承诺函 - */ - @SerializedName("legal_person_commitment") - private String legalPersonCommitment; - - /** - * 法人开户意愿视频 + * 待确认商户号列表 */ - @SerializedName("legal_person_video") - private String legalPersonVideo; - - /** - * 补充材料 - */ - @SerializedName("business_addition_pics") - private List businessAdditionPics; - - /** - * 补充说明 - */ - @SerializedName("business_addition_msg") - private String businessAdditionMsg; - + @SerializedName("confirm_mchid_list") + private List confirmMchidList; } } From ab1c150febebdb206e32c48a402207f74731cf06 Mon Sep 17 00:00:00 2001 From: mrsiu Date: Thu, 16 Jan 2025 13:50:24 +0800 Subject: [PATCH 07/56] =?UTF-8?q?:art:=20#3478=20=E3=80=90=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91OA=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E5=AF=B9=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E6=96=87=E5=AD=97=E6=8E=A7=E4=BB=B6=EF=BC=88control=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=B8=BATips=EF=BC=89=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/oa/WxCpOaApprovalTemplateResult.java | 4 ++++ .../bean/oa/templatedata/TemplateConfig.java | 2 ++ .../cp/bean/oa/templatedata/TemplateTips.java | 18 ++++++++++++++++++ .../oa/templatedata/TemplateTipsContent.java | 15 +++++++++++++++ .../oa/templatedata/TemplateTipsSubText.java | 14 ++++++++++++++ .../TemplateTipsSubTextContent.java | 16 ++++++++++++++++ .../TemplateTipsSubTextContentLink.java | 14 ++++++++++++++ .../TemplateTipsSubTextContentPlainText.java | 13 +++++++++++++ .../bean/oa/templatedata/TemplateTipsText.java | 17 +++++++++++++++++ 9 files changed, 113 insertions(+) create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTips.java create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsContent.java create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubText.java create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContent.java create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentLink.java create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentPlainText.java create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsText.java diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApprovalTemplateResult.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApprovalTemplateResult.java index 2a497d15f..d10594a54 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApprovalTemplateResult.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/WxCpOaApprovalTemplateResult.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import lombok.experimental.Accessors; +import me.chanjar.weixin.cp.bean.oa.templatedata.TemplateTips; import me.chanjar.weixin.cp.bean.oa.templatedata.TemplateTitle; import me.chanjar.weixin.cp.bean.oa.templatedata.control.*; import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; @@ -94,6 +95,9 @@ public static class TemplateConfig implements Serializable { @SerializedName("vacation_list") private TemplateVacation vacationList; + @SerializedName("tips") + private TemplateTips tips; + } @Data diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateConfig.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateConfig.java index 1a00baad0..91ee8b7cd 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateConfig.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateConfig.java @@ -37,4 +37,6 @@ public class TemplateConfig implements Serializable { @SerializedName("vacation_list") private TemplateVacation vacationList; + private TemplateTips tips; + } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTips.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTips.java new file mode 100644 index 000000000..58daeb007 --- /dev/null +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTips.java @@ -0,0 +1,18 @@ +package me.chanjar.weixin.cp.bean.oa.templatedata; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.util.List; + +/** + * @author mrsiu@msn.com + * @version 1.0 + * @date 2025/1/16 09:40 + */ +@Data +public class TemplateTips { + + @SerializedName("tips_content") + private List tipsContent; +} diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsContent.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsContent.java new file mode 100644 index 000000000..939e6819a --- /dev/null +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsContent.java @@ -0,0 +1,15 @@ +package me.chanjar.weixin.cp.bean.oa.templatedata; + +import lombok.Data; + +/** + * @author mrsiu@msn.com + * @version 1.0 + * @date 2025/1/16 09:42 + */ +@Data +public class TemplateTipsContent { + + private TemplateTipsText text; + private String lang; +} diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubText.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubText.java new file mode 100644 index 000000000..ac4681038 --- /dev/null +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubText.java @@ -0,0 +1,14 @@ +package me.chanjar.weixin.cp.bean.oa.templatedata; + +import lombok.Data; + +/** + * @author mrsiu@msn.com + * @version 1.0 + * @date 2025/1/16 09:45 + */ +@Data +public class TemplateTipsSubText { + private Integer type; + private TemplateTipsSubTextContent content; +} diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContent.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContent.java new file mode 100644 index 000000000..9c99b2688 --- /dev/null +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContent.java @@ -0,0 +1,16 @@ +package me.chanjar.weixin.cp.bean.oa.templatedata; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +/** + * @author mrsiu@msn.com + * @version 1.0 + * @date 2025/1/16 09:46 + */ +@Data +public class TemplateTipsSubTextContent { + @SerializedName("plain_text") + private TemplateTipsSubTextContentPlainText plainText; + private TemplateTipsSubTextContentLink link; +} diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentLink.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentLink.java new file mode 100644 index 000000000..4cd198409 --- /dev/null +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentLink.java @@ -0,0 +1,14 @@ +package me.chanjar.weixin.cp.bean.oa.templatedata; + +import lombok.Data; + +/** + * @author mrsiu@msn.com + * @version 1.0 + * @date 2025/1/16 09:49 + */ +@Data +public class TemplateTipsSubTextContentLink { + private String title; + private String url; +} diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentPlainText.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentPlainText.java new file mode 100644 index 000000000..12969cdcd --- /dev/null +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsSubTextContentPlainText.java @@ -0,0 +1,13 @@ +package me.chanjar.weixin.cp.bean.oa.templatedata; + +import lombok.Data; + +/** + * @author mrsiu@msn.com + * @date 2025/1/16 09:47 + * @version 1.0 + */ +@Data +public class TemplateTipsSubTextContentPlainText { + private String content; +} diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsText.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsText.java new file mode 100644 index 000000000..100c5bb13 --- /dev/null +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/oa/templatedata/TemplateTipsText.java @@ -0,0 +1,17 @@ +package me.chanjar.weixin.cp.bean.oa.templatedata; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.util.List; + +/** + * @author mrsiu@msn.com + * @date 2025/1/16 09:43 + * @version 1.0 + */ +@Data +public class TemplateTipsText { + @SerializedName("sub_text") + private List subText; +} From b0daf8428e3590898011391366ca6c816a3713dd Mon Sep 17 00:00:00 2001 From: Molzx <31435895+Molzx@users.noreply.github.com> Date: Fri, 17 Jan 2025 12:02:48 +0800 Subject: [PATCH 08/56] =?UTF-8?q?:new:=20#3479=20=E3=80=90=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E3=80=91=E6=96=B0=E5=A2=9E=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9A=84=E9=85=8D=E7=BD=AE=E5=92=8C=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E8=AE=A2=E5=8D=95=E9=85=8D=E7=BD=AE=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/WxMaOrderManagementService.java | 40 +++++++++++ .../wx/miniapp/api/WxMaService.java | 6 ++ .../miniapp/api/impl/BaseWxMaServiceImpl.java | 13 ++++ .../impl/WxMaOrderManagementServiceImpl.java | 72 +++++++++++++++++++ ...WxMaOrderManagementGetOrderDetailPath.java | 24 +++++++ .../bean/order/WxMaOrderManagementResult.java | 27 +++++++ .../miniapp/constant/WxMaApiUrlConstants.java | 33 ++++++++- 7 files changed, 213 insertions(+), 2 deletions(-) create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderManagementService.java create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderManagementServiceImpl.java create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementGetOrderDetailPath.java create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementResult.java diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderManagementService.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderManagementService.java new file mode 100644 index 000000000..d82cfd19c --- /dev/null +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderManagementService.java @@ -0,0 +1,40 @@ +package cn.binarywang.wx.miniapp.api; + +import cn.binarywang.wx.miniapp.bean.order.WxMaOrderManagementGetOrderDetailPath; +import cn.binarywang.wx.miniapp.bean.order.WxMaOrderManagementResult; +import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoBaseResponse; +import me.chanjar.weixin.common.error.WxErrorException; + +/** + * @author xzh + * @Description + * @createTime 2025/01/16 15:20 + */ +public interface WxMaOrderManagementService { + + /** + * 查询订单详情路径 + * 注意事项 + * 如果没有配置过订单详情路径,会返回成功,其中path为''。 + * + * @return WxMaOrderManagementGetOrderDetailPath + * @throws WxErrorException e + */ + WxMaOrderManagementGetOrderDetailPath getOrderDetailPath() + throws WxErrorException; + + + /** + * 配置订单详情路径 + * 注意事项 + * 调用接口前需要先完成订单中心授权协议签署。 + * 请确保配置的path可正常跳转到小程序,并且path必须包含字符串“${商品订单号}”。 + * + * @param path 订单详情路径 + * @return WxMaOrderManagementResult + * @throws WxErrorException e + */ + WxMaOrderManagementResult updateOrderDetailPath(String path) + throws WxErrorException; + +} diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java index 9d55df379..a5446361a 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java @@ -550,6 +550,12 @@ WxMaApiResponse execute( * @return getWxMaOrderShippingService */ WxMaOrderShippingService getWxMaOrderShippingService(); + /** + * 小程序订单管理服务 + * + * @return WxMaOrderManagementService + */ + WxMaOrderManagementService getWxMaOrderManagementService(); /** * 小程序openApi管理 diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java index 344418e31..aa7b061fb 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java @@ -153,6 +153,9 @@ public abstract class BaseWxMaServiceImpl implements WxMaService, RequestH private final WxMaOrderShippingService wxMaOrderShippingService = new WxMaOrderShippingServiceImpl(this); + private final WxMaOrderManagementService wxMaOrderManagementService = + new WxMaOrderManagementServiceImpl(this); + private final WxMaOpenApiService wxMaOpenApiService = new WxMaOpenApiServiceImpl(this); private final WxMaVodService wxMaVodService = new WxMaVodServiceImpl(this); private final WxMaXPayService wxMaXPayService = new WxMaXPayServiceImpl(this); @@ -817,6 +820,16 @@ public WxMaOrderShippingService getWxMaOrderShippingService() { return this.wxMaOrderShippingService; } + /** + * 小程序订单管理服务 + * + * @return WxMaOrderManagementService + */ + @Override + public WxMaOrderManagementService getWxMaOrderManagementService() { + return this.wxMaOrderManagementService; + } + @Override public WxMaOpenApiService getWxMaOpenApiService() { return this.wxMaOpenApiService; diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderManagementServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderManagementServiceImpl.java new file mode 100644 index 000000000..7fcf73f5a --- /dev/null +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderManagementServiceImpl.java @@ -0,0 +1,72 @@ +package cn.binarywang.wx.miniapp.api.impl; + +import cn.binarywang.wx.miniapp.api.WxMaOrderManagementService; +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.bean.order.WxMaOrderManagementGetOrderDetailPath; +import cn.binarywang.wx.miniapp.bean.order.WxMaOrderManagementResult; +import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoBaseResponse; +import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder; +import com.google.gson.JsonObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import me.chanjar.weixin.common.api.WxConsts; +import me.chanjar.weixin.common.enums.WxType; +import me.chanjar.weixin.common.error.WxError; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.common.util.json.GsonHelper; +import me.chanjar.weixin.common.util.json.GsonParser; + +import static cn.binarywang.wx.miniapp.constant.WxMaApiUrlConstants.OrderManagement.*; + + +/** + * @author xzh + * @Description + * @createTime 2025/01/16 15:31 + */ +@Slf4j +@RequiredArgsConstructor +public class WxMaOrderManagementServiceImpl implements WxMaOrderManagementService { + + private final WxMaService wxMaService; + + /** + * 查询订单详情路径 + * 注意事项 + * 如果没有配置过订单详情路径,会返回成功,其中path为''。 + * + * @return WxMaOrderManagementGetOrderDetailPath + * @throws WxErrorException e + */ + @Override + public WxMaOrderManagementGetOrderDetailPath getOrderDetailPath() throws WxErrorException { + return request(GET_ORDER_DETAIL_PATH, new Object(), WxMaOrderManagementGetOrderDetailPath.class); + + } + + /** + * 配置订单详情路径 + * 注意事项 + * 调用接口前需要先完成订单中心授权协议签署。 + * 请确保配置的path可正常跳转到小程序,并且path必须包含字符串“${商品订单号}”。 + * + * @param path 订单详情路径 + * @return WxMaOrderManagementResult + * @throws WxErrorException e + */ + @Override + public WxMaOrderManagementResult updateOrderDetailPath(String path) throws WxErrorException { + JsonObject jsonObject = GsonHelper.buildJsonObject("path", path); + return request(UPDATE_ORDER_DETAIL_PATH, jsonObject, WxMaOrderManagementResult.class); + + } + + private T request(String url, Object request, Class resultT) throws WxErrorException { + String responseContent = this.wxMaService.post(url, request); + JsonObject jsonObject = GsonParser.parse(responseContent); + if (jsonObject.get(WxConsts.ERR_CODE).getAsInt() != 0) { + throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp)); + } + return WxMaGsonBuilder.create().fromJson(responseContent, resultT); + } +} diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementGetOrderDetailPath.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementGetOrderDetailPath.java new file mode 100644 index 000000000..02c53a53f --- /dev/null +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementGetOrderDetailPath.java @@ -0,0 +1,24 @@ +package cn.binarywang.wx.miniapp.bean.order; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * @author xzh + * @Description + * @createTime 2025/01/16 15:27 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class WxMaOrderManagementGetOrderDetailPath extends WxMaOrderManagementResult { + private static final long serialVersionUID = -5288666524298706169L; + + /** + * 订单详情路径 + */ + @SerializedName("path") + private String path; +} diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementResult.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementResult.java new file mode 100644 index 000000000..5a903b898 --- /dev/null +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/order/WxMaOrderManagementResult.java @@ -0,0 +1,27 @@ +package cn.binarywang.wx.miniapp.bean.order; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author xzh + * @Description + * @createTime 2025/01/16 15:27 + */ +@Data +public class WxMaOrderManagementResult implements Serializable { + private static final long serialVersionUID = 1468925151935770503L; + /** + * 错误码 + */ + @SerializedName("errcode") + private Integer errCode; + + /** + * 错误原因 + */ + @SerializedName("errmsg") + private String errMsg; +} diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java index 590838579..d61ade73c 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java @@ -751,7 +751,7 @@ public interface OrderShipping { * */ String UPLOAD_COMBINED_SHIPPING_INFO = - "https://api.weixin.qq.com/wxa/sec/order/upload_combined_shipping_info"; + "https://api.weixin.qq.com/wxa/sec/order/upload_combined_shipping_info"; /** * 查询订单发货状态. @@ -779,7 +779,7 @@ public interface OrderShipping { * */ String NOTIFY_CONFIRM_RECEIVE = - "https://api.weixin.qq.com/wxa/sec/order/notify_confirm_receive"; + "https://api.weixin.qq.com/wxa/sec/order/notify_confirm_receive"; /** * 消息跳转路径设置接口. @@ -809,6 +809,35 @@ public interface OrderShipping { } + /** + * 小程序订单管理 + * + *
+   * 文档地址: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order_center/order_center.html
+   * 
+ */ + public interface OrderManagement { + + /** + * 配置订单详情路径. + * + *
+     * 文档地址:https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order_center/order_center.html
+     * 
+ */ + String UPDATE_ORDER_DETAIL_PATH = "https://api.weixin.qq.com/wxa/sec/order/update_order_detail_path"; + + /** + * 查询订单详情路径. + * + *
+     * 文档地址:https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order_center/order_center.html
+     * 
+ */ + String GET_ORDER_DETAIL_PATH = "https://api.weixin.qq.com/wxa/sec/order/get_order_detail_path"; + + } + public interface Vod { String LIST_MEDIA_URL = "https://api.weixin.qq.com/wxa/sec/vod/listmedia"; String GET_MEDIA_URL = "https://api.weixin.qq.com/wxa/sec/vod/getmedia"; From 704fba4d853d5f65ae7372b38b4fd3ba9e2caba1 Mon Sep 17 00:00:00 2001 From: julb Date: Sat, 18 Jan 2025 07:53:19 +0000 Subject: [PATCH 09/56] =?UTF-8?q?:art:=20=E3=80=90=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E5=85=BC=E5=AE=B9=E5=85=AC=E9=92=A5?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E8=AF=B7=E6=B1=82=E5=A4=B4=E5=BA=8F?= =?UTF-8?q?=E5=88=97=E5=8F=B7=20!148?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/WxPayServiceApacheHttpImpl.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java index e2b6d43fa..7fd793979 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java @@ -1,6 +1,7 @@ package com.github.binarywang.wxpay.service.impl; import com.github.binarywang.wxpay.bean.WxPayApiData; +import com.github.binarywang.wxpay.config.WxPayConfig; import com.github.binarywang.wxpay.exception.WxPayException; import com.github.binarywang.wxpay.v3.WxPayV3DownloadHttpGet; import com.google.gson.JsonElement; @@ -171,7 +172,7 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx HttpPost httpPost = this.createHttpPost(url, requestStr); httpPost.addHeader(ACCEPT, APPLICATION_JSON); httpPost.addHeader(CONTENT_TYPE, APPLICATION_JSON); - String serialNumber = getConfig().getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase(); + String serialNumber = getWechatpaySerial(getConfig()); httpPost.addHeader("Wechatpay-Serial", serialNumber); try (CloseableHttpResponse response = httpClient.execute(httpPost)) { //v3已经改为通过状态码判断200 204 成功 @@ -251,7 +252,7 @@ public String getV3WithWechatPaySerial(String url) throws WxPayException { HttpGet httpGet = new HttpGet(url); httpGet.addHeader(ACCEPT, APPLICATION_JSON); httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON); - String serialNumber = getConfig().getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase(); + String serialNumber = getWechatpaySerial(getConfig()); httpGet.addHeader("Wechatpay-Serial", serialNumber); return this.requestV3(url, httpGet); } @@ -380,4 +381,16 @@ private WxPayException convertException(JsonObject jsonObject) { return wxPayException; } + /** + * 兼容微信支付公钥模式 + * @param wxPayConfig + * @return + */ + private String getWechatpaySerial(WxPayConfig wxPayConfig) { + String serialNumber = wxPayConfig.getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase(); + if (StringUtils.isNotBlank(wxPayConfig.getPublicKeyId())) { + serialNumber = wxPayConfig.getPublicKeyId(); + } + return serialNumber; + } } From 8e5ee97378d07467a57c6307fdcb86971dd1267e Mon Sep 17 00:00:00 2001 From: giveup Date: Tue, 21 Jan 2025 18:41:11 +0800 Subject: [PATCH 10/56] =?UTF-8?q?:art:=20#3458=20=E3=80=90=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E5=AE=B6=E6=A0=A1=E6=B2=9F?= =?UTF-8?q?=E9=80=9A=E8=8E=B7=E5=8F=96=E9=83=A8=E9=97=A8=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BC=98=E5=8C=96=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E9=83=A8=E9=97=A8id=E4=B8=BA=E7=A9=BA=E5=88=99=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=85=A8=E9=87=8F=E7=BB=84=E7=BB=87=E6=9E=B6=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/cp/api/WxCpSchoolUserService.java | 2 +- .../api/impl/WxCpSchoolUserServiceImpl.java | 3 +- .../weixin/cp/constant/WxCpApiPathConsts.java | 2 +- .../impl/WxCpSchoolUserServiceImplTest.java | 139 ++++++++++++++++++ 4 files changed, 143 insertions(+), 3 deletions(-) create mode 100644 weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImplTest.java diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolUserService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolUserService.java index 26cfe3a01..a92bfcc10 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolUserService.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpSchoolUserService.java @@ -334,7 +334,7 @@ WxCpBaseResp updateStudent(@NonNull String studentUserId, String newStudentUserI * 请求方式:GET(HTTPS) * 请求地址:https://qyapi.weixin.qq.com/cgi-bin/school/department/list?access_token=ACCESS_TOKEN&id=ID * - * @param id the id + * @param id 部门id。获取指定部门及其下的子部门。 如果不填,默认获取全量组织架构 * @return wx cp department list * @throws WxErrorException the wx error exception */ diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImpl.java index fac1689e0..58bf20873 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImpl.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImpl.java @@ -16,6 +16,7 @@ import org.apache.commons.lang3.StringUtils; import java.util.List; +import java.util.Objects; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.ExternalContact.*; import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.School.*; @@ -246,7 +247,7 @@ public String convertToOpenId(@NonNull String externalUserId) throws WxErrorExce @Override public WxCpDepartmentList listDepartment(Integer id) throws WxErrorException { - String apiUrl = this.cpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST) + id; + String apiUrl = Objects.isNull(id) ? this.cpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST) : String.format("%s?id=%s", this.cpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST), id); String responseContent = this.cpService.get(apiUrl, null); return WxCpDepartmentList.fromJson(responseContent); } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java index b53f7549d..dfb38a524 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java @@ -691,7 +691,7 @@ interface School { /** * The constant DEPARTMENT_LIST. */ - String DEPARTMENT_LIST = "/cgi-bin/school/department/list?id="; + String DEPARTMENT_LIST = "/cgi-bin/school/department/list"; /** * The constant GET_PAYMENT_RESULT. diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImplTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImplTest.java new file mode 100644 index 000000000..da1cc2554 --- /dev/null +++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpSchoolUserServiceImplTest.java @@ -0,0 +1,139 @@ +package me.chanjar.weixin.cp.api.impl; + +import com.google.gson.Gson; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.school.user.WxCpDepartmentList; +import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl; +import org.mockito.Mockito; +import org.testng.annotations.Test; + +import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.School.DEPARTMENT_LIST; +import static org.testng.Assert.assertEquals; + +public class WxCpSchoolUserServiceImplTest { + + + String allDeptListJson = "{\n" + + "\t\"errcode\": 0,\n" + + "\t\"errmsg\": \"ok\",\n" + + "\t\"departments\": [\n" + + "\t\t{\n" + + "\t\t\t\"name\": \"一年级\",\n" + + "\t\t\t\"parentid\": 1,\n" + + "\t\t\t\"id\": 2,\n" + + "\t\t\t\"type\":2,\n" + + "\t\t\t\"register_year\":2018,\n" + + "\t\t\t\"standard_grade\":1,\n" + + "\t\t\t\"order\":1,\n" + + "\t\t\t\"department_admins\": [\n" + + "\t\t\t\t{\n" + + "\t\t\t\t\t\"userid\": \"zhangsan\",\n" + + "\t\t\t\t\t\"type\": 1\n" + + "\t\t\t\t},\n" + + "\t\t\t\t{\n" + + "\t\t\t\t\t\"userid\": \"lisi\",\n" + + "\t\t\t\t\t\"type\": 2\n" + + "\t\t\t\t}\n" + + "\t\t\t],\n" + + " \"is_graduated\": 0\n" + + "\t\t},\n" + + "\t\t{\n" + + "\t\t\t\"name\": \"一年级一班\",\n" + + "\t\t\t\"parentid\": 1,\n" + + "\t\t\t\"id\": 3,\n" + + "\t\t\t\"type\": 1,\n" + + "\t\t\t\"department_admins\": [\n" + + "\t\t\t\t{\n" + + "\t\t\t\t\t\"userid\": \"zhangsan\",\n" + + "\t\t\t\t\t\"type\": 3,\n" + + "\t\t\t\t\t\"subject\":\"语文\"\n" + + "\t\t\t\t},\n" + + "\t\t\t\t{\n" + + "\t\t\t\t\t\"userid\": \"lisi\",\n" + + "\t\t\t\t\t\"type\": 4,\n" + + "\t\t\t\t\t\"subject\":\"数学\"\n" + + "\t\t\t\t}\n" + + "\t\t\t],\n" + + "\t\t\t\"open_group_chat\": 1,\n" + + " \"group_chat_id\": \"group_chat_id\"\n" + + "\t\t}\n" + + "\t]\n" + + "}\n"; + + String deptId3Json = "{\n" + + " \"errcode\": 0,\n" + + " \"errmsg\": \"ok\",\n" + + " \"departments\": [\n" + + " {\n" + + " \"name\": \"一年级一班\",\n" + + " \"parentid\": 1,\n" + + " \"id\": 3,\n" + + " \"type\": 1,\n" + + " \"department_admins\": [\n" + + " {\n" + + " \"userid\": \"zhangsan\",\n" + + " \"type\": 3,\n" + + " \"subject\":\"语文\"\n" + + " },\n" + + " {\n" + + " \"userid\": \"lisi\",\n" + + " \"type\": 4,\n" + + " \"subject\":\"数学\"\n" + + " }\n" + + " ],\n" + + " \"open_group_chat\": 1,\n" + + " \"group_chat_id\": \"group_chat_id\"\n" + + " }\n" + + " ]\n" + + "}"; + + String deptId2Json = "{\n" + + " \"errcode\": 0,\n" + + " \"errmsg\": \"ok\",\n" + + " \"departments\": []\n" + + "}\n"; + + + @Test + public void testListDepartmentWhenIdIsNull() throws WxErrorException { + + WxCpService mockCpService = Mockito.mock(WxCpService.class); + WxCpSchoolUserServiceImpl wxCpSchoolUserService = new WxCpSchoolUserServiceImpl(mockCpService); + Mockito.when(mockCpService.getWxCpConfigStorage()).thenReturn(new WxCpDefaultConfigImpl()); + Mockito.when(mockCpService.get(mockCpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST), null)).thenReturn(allDeptListJson); + WxCpDepartmentList wxCpDepartmentList = wxCpSchoolUserService.listDepartment(null); + //WxCpDepartmentList没有重写Equals和Hashcode,不能直接比较 + Gson gson = new Gson(); + assertEquals(gson.toJson(wxCpDepartmentList), gson.toJson(gson.fromJson(allDeptListJson, WxCpDepartmentList.class)), "should be equal"); + + } + + @Test + public void testListDepartmentWhenIdIs2() throws WxErrorException { + + WxCpService mockCpService = Mockito.mock(WxCpService.class); + WxCpSchoolUserServiceImpl wxCpSchoolUserService = new WxCpSchoolUserServiceImpl(mockCpService); + Mockito.when(mockCpService.getWxCpConfigStorage()).thenReturn(new WxCpDefaultConfigImpl()); + Gson gson = new Gson(); + int deptId = 2; + Mockito.when(mockCpService.get(String.format("%s?id=%s", mockCpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST), deptId), null)).thenReturn(deptId2Json); + //WxCpDepartmentList没有重写Equals和Hashcode,不能直接比较 + assertEquals(gson.toJson(wxCpSchoolUserService.listDepartment(deptId)), gson.toJson(gson.fromJson(deptId2Json, WxCpDepartmentList.class)), "should be equal"); + + } + + @Test + public void testListDepartmentWhenIdIs3() throws WxErrorException { + + WxCpService mockCpService = Mockito.mock(WxCpService.class); + WxCpSchoolUserServiceImpl wxCpSchoolUserService = new WxCpSchoolUserServiceImpl(mockCpService); + Mockito.when(mockCpService.getWxCpConfigStorage()).thenReturn(new WxCpDefaultConfigImpl()); + Gson gson = new Gson(); + int deptId = 3; + Mockito.when(mockCpService.get(String.format("%s?id=%s", mockCpService.getWxCpConfigStorage().getApiUrl(DEPARTMENT_LIST), deptId), null)).thenReturn(deptId3Json); + //WxCpDepartmentList没有重写Equals和Hashcode,不能直接比较 + assertEquals(gson.toJson(wxCpSchoolUserService.listDepartment(deptId)), gson.toJson(gson.fromJson(deptId3Json, WxCpDepartmentList.class)), "should be equal"); + + } +} From 1e003ee571848bbc5c27d18eb96440921546a7c6 Mon Sep 17 00:00:00 2001 From: GadflyFang Date: Tue, 21 Jan 2025 18:44:33 +0800 Subject: [PATCH 11/56] =?UTF-8?q?:art:=20=E4=BF=AE=E5=A4=8D=2094aaff4=20?= =?UTF-8?q?=E5=BC=95=E5=85=A5=E7=9A=84=E9=94=99=E8=AF=AF=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E8=AF=81=E4=B9=A6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/github/binarywang/wxpay/config/WxPayConfig.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java index 293c52eac..8cbf954ee 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java @@ -14,6 +14,7 @@ import java.security.PublicKey; import java.security.cert.Certificate; import java.security.cert.X509Certificate; +import java.util.Base64; import java.util.Optional; import javax.net.ssl.SSLContext; import lombok.Data; @@ -371,7 +372,7 @@ private InputStream loadConfigInputStream(String configString, String configPath if (configContent != null) { inputStream = new ByteArrayInputStream(configContent); } else if (StringUtils.isNotEmpty(configString)) { - configContent = configString.getBytes(StandardCharsets.UTF_8); + configContent = Base64.getDecoder().decode(configString); inputStream = new ByteArrayInputStream(configContent); } else { if (StringUtils.isBlank(configPath)) { From 24ebc91dca899bc9248b2e4b8067987e45515f5c Mon Sep 17 00:00:00 2001 From: Neror <7885514+NerorRepository@user.noreply.gitee.com> Date: Mon, 20 Jan 2025 16:12:00 +0000 Subject: [PATCH 12/56] =?UTF-8?q?:art:=20=E3=80=90=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E5=A2=9E=E5=8A=A0=E5=A4=9A=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=88=87=E6=8D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wxpay/service/WxPayService.java | 25 ++++--- .../service/impl/BaseWxPayServiceImpl.java | 75 ++++++++++--------- 2 files changed, 55 insertions(+), 45 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java index 19b4ed0a0..8ceac2b6b 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java @@ -39,16 +39,18 @@ public interface WxPayService { * Map里 加入新的 {@link WxPayConfig},适用于动态添加新的微信商户配置. * * @param mchId 商户id + * @param appId 微信应用id * @param wxPayConfig 新的微信配置 */ - void addConfig(String mchId, WxPayConfig wxPayConfig); + void addConfig(String mchId, String appId, WxPayConfig wxPayConfig); /** - * 从 Map中 移除 {@link String mchId} 所对应的 {@link WxPayConfig},适用于动态移除微信商户配置. + * 从 Map中 移除 {@link String mchId} 和 {@link String appId} 所对应的 {@link WxPayConfig},适用于动态移除微信商户配置. * * @param mchId 对应商户的标识 + * @param appId 微信应用id */ - void removeConfig(String mchId); + void removeConfig(String mchId, String appId); /** * 注入多个 {@link WxPayConfig} 的实现. 并为每个 {@link WxPayConfig} 赋予不同的 {@link String mchId} 值 @@ -70,17 +72,19 @@ public interface WxPayService { * 进行相应的商户切换. * * @param mchId 商户标识 + * @param appId 微信应用id * @return 切换是否成功 boolean */ - boolean switchover(String mchId); + boolean switchover(String mchId, String appId); /** * 进行相应的商户切换. * * @param mchId 商户标识 + * @param appId 微信应用id * @return 切换成功 ,则返回当前对象,方便链式调用,否则抛出异常 */ - WxPayService switchoverTo(String mchId); + WxPayService switchoverTo(String mchId, String appId); /** * 发送post请求,得到响应字节数组. @@ -617,10 +621,10 @@ public interface WxPayService { /** * 调用统一下单接口,并组装生成支付所需参数对象. * - * @param 请使用{@link com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result}里的内部类或字段 + * @param 请使用{@link WxPayUnifiedOrderV3Result}里的内部类或字段 * @param tradeType the trade type * @param request 统一下单请求参数 - * @return 返回 {@link com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result}里的内部类或字段 + * @return 返回 {@link WxPayUnifiedOrderV3Result}里的内部类或字段 * @throws WxPayException the wx pay exception */ T createOrderV3(TradeTypeEnum tradeType, WxPayUnifiedOrderV3Request request) throws WxPayException; @@ -628,10 +632,10 @@ public interface WxPayService { /** * 服务商模式调用统一下单接口,并组装生成支付所需参数对象. * - * @param 请使用{@link com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result}里的内部类或字段 + * @param 请使用{@link WxPayUnifiedOrderV3Result}里的内部类或字段 * @param tradeType the trade type * @param request 统一下单请求参数 - * @return 返回 {@link com.github.binarywang.wxpay.bean.result.WxPayUnifiedOrderV3Result}里的内部类或字段 + * @return 返回 {@link WxPayUnifiedOrderV3Result}里的内部类或字段 * @throws WxPayException the wx pay exception */ T createPartnerOrderV3(TradeTypeEnum tradeType, WxPayPartnerUnifiedOrderV3Request request) throws WxPayException; @@ -1615,7 +1619,8 @@ WxPayRefundQueryResult refundQuery(String transactionId, String outTradeNo, Stri /** * 获取服务商直股份签约计划服务类 - * @return the partner pay score sign plan service + * + * @return the partner pay score sign plan service */ PartnerPayScoreSignPlanService getPartnerPayScoreSignPlanService(); } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java index 7c2055cec..1fa2f8dc8 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java @@ -14,7 +14,6 @@ import com.github.binarywang.wxpay.bean.transfer.TransferBillsNotifyResult; import com.github.binarywang.wxpay.config.WxPayConfig; import com.github.binarywang.wxpay.config.WxPayConfigHolder; -import com.github.binarywang.wxpay.constant.WxPayConstants; import com.github.binarywang.wxpay.constant.WxPayConstants.SignType; import com.github.binarywang.wxpay.constant.WxPayConstants.TradeType; import com.github.binarywang.wxpay.exception.WxPayException; @@ -46,6 +45,7 @@ import java.nio.file.Paths; import java.security.GeneralSecurityException; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; import java.util.zip.ZipException; import static com.github.binarywang.wxpay.constant.WxPayConstants.QUERY_COMMENT_DATE_FORMAT; @@ -122,7 +122,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService { private final PartnerPayScoreService partnerPayScoreService = new PartnerPayScoreServiceImpl(this); @Getter - private final PartnerPayScoreSignPlanService partnerPayScoreSignPlanService=new PartnerPayScoreSignPlanServiceImpl(this); + private final PartnerPayScoreSignPlanService partnerPayScoreSignPlanService = new PartnerPayScoreSignPlanServiceImpl(this); @Getter private final MerchantTransferService merchantTransferService = new MerchantTransferServiceImpl(this); @@ -130,7 +130,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService { @Getter private final BrandMerchantTransferService brandMerchantTransferService = new BrandMerchantTransferServiceImpl(this); - protected Map configMap = new HashMap<>(); + protected Map configMap = new ConcurrentHashMap<>(); @Override public WxPayConfig getConfig() { @@ -143,38 +143,37 @@ public WxPayConfig getConfig() { @Override public void setConfig(WxPayConfig config) { - final String defaultMchId = config.getMchId(); - this.setMultiConfig(ImmutableMap.of(defaultMchId, config), defaultMchId); + final String defaultKey = this.getConfigKey(config.getMchId(), config.getAppId()); + this.setMultiConfig(ImmutableMap.of(defaultKey, config), defaultKey); } @Override - public void addConfig(String mchId, WxPayConfig wxPayConfig) { + public void addConfig(String mchId, String appId, WxPayConfig wxPayConfig) { synchronized (this) { if (this.configMap == null) { this.setConfig(wxPayConfig); } else { - WxPayConfigHolder.set(mchId); - this.configMap.put(mchId, wxPayConfig); + String configKey = this.getConfigKey(mchId, appId); + WxPayConfigHolder.set(configKey); + this.configMap.put(configKey, wxPayConfig); } } } @Override - public void removeConfig(String mchId) { + public void removeConfig(String mchId, String appId) { synchronized (this) { - if (this.configMap.size() == 1) { - this.configMap.remove(mchId); - log.warn("已删除最后一个商户号配置:{},须立即使用setConfig或setMultiConfig添加配置", mchId); + String configKey = this.getConfigKey(mchId, appId); + this.configMap.remove(configKey); + if (this.configMap.isEmpty()) { + log.warn("已删除最后一个商户号配置:mchId[{}],appid[{}],须立即使用setConfig或setMultiConfig添加配置", mchId, appId); return; } - if (WxPayConfigHolder.get().equals(mchId)) { - this.configMap.remove(mchId); - final String defaultMpId = this.configMap.keySet().iterator().next(); - WxPayConfigHolder.set(defaultMpId); - log.warn("已删除默认商户号配置,商户号【{}】被设为默认配置", defaultMpId); - return; + if (WxPayConfigHolder.get().equals(configKey)) { + final String nextConfigKey = this.configMap.keySet().iterator().next(); + WxPayConfigHolder.set(nextConfigKey); + log.warn("已删除默认商户号配置,商户号【{}】被设为默认配置", nextConfigKey); } - this.configMap.remove(mchId); } } @@ -184,28 +183,34 @@ public void setMultiConfig(Map wxPayConfigs) { } @Override - public void setMultiConfig(Map wxPayConfigs, String defaultMchId) { + public void setMultiConfig(Map wxPayConfigs, String defaultConfigKey) { this.configMap = Maps.newHashMap(wxPayConfigs); - WxPayConfigHolder.set(defaultMchId); + WxPayConfigHolder.set(defaultConfigKey); } @Override - public boolean switchover(String mchId) { - if (this.configMap.containsKey(mchId)) { - WxPayConfigHolder.set(mchId); + public boolean switchover(String mchId, String appId) { + String configKey = this.getConfigKey(mchId, appId); + if (this.configMap.containsKey(configKey)) { + WxPayConfigHolder.set(configKey); return true; } - log.error("无法找到对应【{}】的商户号配置信息,请核实!", mchId); + log.error("无法找到对应mchId=【{}】,appId=【{}】的商户号配置信息,请核实!", mchId, appId); return false; } @Override - public WxPayService switchoverTo(String mchId) { - if (this.configMap.containsKey(mchId)) { - WxPayConfigHolder.set(mchId); + public WxPayService switchoverTo(String mchId, String appId) { + String configKey = this.getConfigKey(mchId, appId); + if (this.configMap.containsKey(configKey)) { + WxPayConfigHolder.set(configKey); return this; } - throw new WxRuntimeException(String.format("无法找到对应【%s】的商户号配置信息,请核实!", mchId)); + throw new WxRuntimeException(String.format("无法找到对应mchId=【%s】,appId=【%s】的商户号配置信息,请核实!", mchId, appId)); + } + + private String getConfigKey(String mchId, String appId) { + return mchId + "_" + appId; } @Override @@ -302,7 +307,7 @@ public WxPayRefundQueryV3Result refundQueryV3(WxPayRefundQueryV3Request request) @Override public WxPayRefundQueryV3Result refundPartnerQueryV3(WxPayRefundQueryV3Request request) throws WxPayException { - String url = String.format("%s/v3/refund/domestic/refunds/%s?sub_mchid=%s", this.getPayBaseUrl(), request.getOutRefundNo(),request.getSubMchid()); + String url = String.format("%s/v3/refund/domestic/refunds/%s?sub_mchid=%s", this.getPayBaseUrl(), request.getOutRefundNo(), request.getSubMchid()); String response = this.getV3(url); return GSON.fromJson(response, WxPayRefundQueryV3Result.class); } @@ -324,7 +329,7 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String sign } else if (configMap.get(result.getMchId()).getSignType() != null) { // 如果配置中signType有值,则使用它进行验签 signType = configMap.get(result.getMchId()).getSignType(); - this.switchover(result.getMchId()); + this.switchover(result.getMchId(), result.getAppid()); } } @@ -347,7 +352,7 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String sign */ private boolean verifyNotifySign(SignatureHeader header, String data) throws WxSignTestException { String wxPaySign = header.getSignature(); - if(wxPaySign.startsWith("WECHATPAY/SIGNTEST/")){ + if (wxPaySign.startsWith("WECHATPAY/SIGNTEST/")) { throw new WxSignTestException("微信支付签名探测流量"); } String beforeSign = String.format("%s\n%s\n%s\n", @@ -421,7 +426,7 @@ public WxPayRefundNotifyResult parseRefundNotifyResult(String xmlData) throws Wx WxPayRefundNotifyResult result; if (XmlConfig.fastMode) { result = BaseWxPayResult.fromXML(xmlData, WxPayRefundNotifyResult.class); - this.switchover(result.getMchId()); + this.switchover(result.getMchId(), result.getAppid()); result.decryptReqInfo(this.getConfig().getMchKey()); } else { result = WxPayRefundNotifyResult.fromXML(xmlData, this.getConfig().getMchKey()); @@ -458,7 +463,7 @@ public WxScanPayNotifyResult parseScanPayNotifyResult(String xmlData, @Deprecate try { log.debug("扫码支付回调通知请求参数:{}", xmlData); WxScanPayNotifyResult result = BaseWxPayResult.fromXML(xmlData, WxScanPayNotifyResult.class); - this.switchover(result.getMchId()); + this.switchover(result.getMchId(), result.getAppid()); log.debug("扫码支付回调通知解析后的对象:{}", result); result.checkResult(this, this.getConfig().getSignType(), false); return result; @@ -1306,7 +1311,7 @@ public String queryComment(WxPayQueryCommentRequest request) throws WxPayExcepti @Override public WxPayFaceAuthInfoResult getWxPayFaceAuthInfo(WxPayFaceAuthInfoRequest request) throws WxPayException { if (StringUtils.isEmpty(request.getSignType())) { - request.setSignType(WxPayConstants.SignType.MD5); + request.setSignType(SignType.MD5); } request.checkAndSign(this.getConfig()); From c3b16228c00c885b9456b8cceec484110994b55a Mon Sep 17 00:00:00 2001 From: Neror <7885514+NerorRepository@user.noreply.gitee.com> Date: Tue, 21 Jan 2025 11:49:38 +0000 Subject: [PATCH 13/56] =?UTF-8?q?:art:=20=E3=80=90=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E5=AE=8C=E5=96=84=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=95=86=E5=AE=B6=E8=BD=AC=E8=B4=A6=E5=8A=9F=E8=83=BDAPI=20!15?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../transfer/TransferBillsCancelResult.java | 48 ++++++++ .../bean/transfer/TransferBillsGetResult.java | 103 ++++++++++++++++++ .../bean/transfer/TransferBillsResult.java | 7 +- .../wxpay/constant/WxPayConstants.java | 83 ++++++++++++++ .../wxpay/service/TransferService.java | 51 +++++++++ .../service/impl/TransferServiceImpl.java | 31 +++++- .../service/impl/TransferServiceImplTest.java | 15 +++ 7 files changed, 332 insertions(+), 6 deletions(-) create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsCancelResult.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsGetResult.java diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsCancelResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsCancelResult.java new file mode 100644 index 000000000..9e59fecf7 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsCancelResult.java @@ -0,0 +1,48 @@ +package com.github.binarywang.wxpay.bean.transfer; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + *
+ * 商家转账到零钱撤销转账接口
+ * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4012716458
+ * 
+ * + * @author Nor + * @date 2025/1/17 + */ +@Data +@NoArgsConstructor +public class TransferBillsCancelResult implements Serializable { + private static final long serialVersionUID = -4935840810530008418L; + + /** + * 【商户单号】 商户系统内部的商家单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 + */ + @SerializedName("out_bill_no") + private String outBillNo; + + /** + * 【微信转账单号】 微信转账单号,微信商家转账系统返回的唯一标识 + */ + @SerializedName("transfer_bill_no") + private String transferBillNo; + + /** + * 【单据状态】 商家转账订单状态 + * 可选取值 + * CANCELING: 商户撤销请求受理成功,该笔转账正在撤销中 + * CANCELLED: 转账撤销完成 + */ + private String state; + + /** + * 【最后一次单据状态变更时间】 按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE + */ + @SerializedName("update_time") + private String updateTime; +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsGetResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsGetResult.java new file mode 100644 index 000000000..2e24a4a3c --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsGetResult.java @@ -0,0 +1,103 @@ +package com.github.binarywang.wxpay.bean.transfer; + +import com.github.binarywang.wxpay.constant.WxPayConstants; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + *
+ * 商家转账到零钱查询转账单接口
+ * 文档地址:https://pay.weixin.qq.com/doc/v3/merchant/4012716457 https://pay.weixin.qq.com/doc/v3/merchant/4012716437
+ * 
+ * + * @author Nor + * @date 2025/1/17 + */ +@Data +@NoArgsConstructor +public class TransferBillsGetResult implements Serializable { + private static final long serialVersionUID = -6376955113492371763L; + + /** + * 【商户号】 微信支付分配的商户号 + */ + @SerializedName("mch_id") + private String mchId; + + /** + * 【商户单号】 商户系统内部的商家单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 + */ + @SerializedName("out_bill_no") + private String outBillNo; + + /** + * 【商家转账订单号】 商家转账订单的主键,唯一定义此资源的标识 + */ + @SerializedName("transfer_bill_no") + private String transferBillNo; + + /** + * 【商户AppID】 申请商户号的AppID或商户号绑定的AppID(企业号corpid即为此AppID) + */ + private String appid; + + /** + * 【单据状态】 + * 可选取值 + * ACCEPTED: 转账已受理 + * PROCESSING: 转账处理中,转账结果尚未明确,如一直处于此状态,建议检查账户余额是否足够 + * WAIT_USER_CONFIRM: 待收款用户确认,可拉起微信收款确认页面进行收款确认 + * TRANSFERING: 转账结果尚未明确,可拉起微信收款确认页面再次重试确认收款 + * SUCCESS: 转账成功 + * FAIL: 转账失败 + * CANCELING: 商户撤销请求受理成功,该笔转账正在撤销中 + * CANCELLED: 转账撤销完成 + * + * @see WxPayConstants.TransformBillState + */ + private String state; + + /** + * 【转账金额】 转账金额单位为“分”。 + */ + @SerializedName("transfer_amount") + private String transferAmount; + + /** + * 【转账备注】 单条转账备注(微信用户会收到该备注),UTF8编码,最多允许32个字符 + */ + @SerializedName("transfer_remark") + private String transferRemark; + + /** + * 【失败原因】 订单已失败或者已退资金时,返回失败原因 + */ + @SerializedName("fail_reason") + private String failReason; + + /** + * 【收款用户OpenID】 商户AppID下,某用户的OpenID + */ + private String openid; + + /** + * 【收款用户姓名】 收款方真实姓名。支持标准RSA算法和国密算法,公钥由微信侧提供转账金额 >= 2,000元时,该笔明细必须填写若商户传入收款用户姓名,微信支付会校验用户OpenID与姓名是否一致,并提供电子回单 + */ + @SerializedName("user_name") + private String userName; + + /** + * 【单据创建时间】 单据受理成功时返回,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE + */ + @SerializedName("create_time") + private String createTime; + + /** + * 【最后一次状态变更时间】 单据最后更新时间,按照使用rfc3339所定义的格式,格式为yyyy-MM-DDThh:mm:ss+TIMEZONE + */ + @SerializedName("update_time") + private String updateTime; +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java index 9f7aac7fb..78e0aec6a 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/transfer/TransferBillsResult.java @@ -1,5 +1,6 @@ package com.github.binarywang.wxpay.bean.transfer; +import com.github.binarywang.wxpay.constant.WxPayConstants; import com.google.gson.annotations.SerializedName; import lombok.Data; import lombok.NoArgsConstructor; @@ -37,9 +38,11 @@ public class TransferBillsResult implements Serializable { /** * 单据状态 + * + * @see WxPayConstants.TransformBillState */ - @SerializedName("status") - private String status; + @SerializedName("state") + private String state; /** * 失败原因 diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/constant/WxPayConstants.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/constant/WxPayConstants.java index 819cdfe73..e8a6b6acb 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/constant/WxPayConstants.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/constant/WxPayConstants.java @@ -6,6 +6,7 @@ import com.github.binarywang.wxpay.bean.order.WxPayNativeOrderResult; import com.github.binarywang.wxpay.bean.result.WxPayMicropayResult; import com.google.common.collect.Lists; +import lombok.experimental.UtilityClass; import org.apache.commons.lang3.time.FastDateFormat; import java.text.Format; @@ -353,4 +354,86 @@ public static class ReceiverType { public static final String PERSONAL_SUB_OPENID = "PERSONAL_SUB_OPENID"; } + /** + * 微信商户转账订单状态 + */ + @UtilityClass + public static class TransformBillState { + /** + * 转账已受理 + */ + public static final String ACCEPTED = "ACCEPTED"; + + /** + * 转账处理中,转账结果尚未明确,如一直处于此状态,建议检查账户余额是否足够 + */ + public static final String PROCESSING = "PROCESSING"; + + /** + * 待收款用户确认,可拉起微信收款确认页面进行收款确认 + */ + public static final String WAIT_USER_CONFIRM = "WAIT_USER_CONFIRM"; + + /** + * 转账结果尚未明确,可拉起微信收款确认页面再次重试确认收款 + */ + public static final String TRANSFERING = "TRANSFERING"; + + /** + * 转账成功 + */ + public static final String SUCCESS = "SUCCESS"; + + /** + * 转账失败 + */ + public static final String FAIL = "FAIL"; + + /** + * 商户撤销请求受理成功,该笔转账正在撤销中 + */ + public static final String CANCELING = "CANCELING"; + + /** + * 转账撤销完成 + */ + public static final String CANCELLED = "CANCELLED"; + + } + + /** + * 【转账场景ID】 该笔转账使用的转账场景,可前往“商户平台-产品中心-商家转账”中申请。 + */ + @UtilityClass + public static class TransformSceneId { + /** + * 现金营销 + */ + public static final String CASH_MARKETING = "1001"; + } + + /** + * 用户收款感知 + * + * @see 官方文档 + */ + @UtilityClass + public static class UserRecvPerception { + /** + * 转账场景 现金营销 + * 场景介绍 向参与营销活动的用户发放现金奖励 + */ + public static class CASH_MARKETING { + /** + * 默认展示 + */ + public static final String ACTIVITY = "活动奖励"; + + /** + * 需在发起转账时,“用户收款感知”字段主动传入“现金奖励”才可展示 + */ + public static final String CASH = "现金奖励"; + } + + } } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java index c02430a96..01113c950 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/TransferService.java @@ -128,6 +128,57 @@ public interface TransferService { */ TransferBillsResult transferBills(TransferBillsRequest request) throws WxPayException; + /** + *
+   *
+   * 2025.1.15 开始新接口 撤销转账API
+   *
+   * 请求方式:POST(HTTPS)
+   * 请求地址:请求地址
+   *
+   * 文档地址:商户撤销转账API
+   * 
+ * + * @param outBillNo 【商户单号】 商户系统内部的商家单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 + * @return TransformBillsGetResult 转账单 + * @throws WxPayException . + */ + TransferBillsCancelResult transformBillsCancel(String outBillNo) throws WxPayException; + + /** + *
+   *
+   * 2025.1.15 开始新接口 发起商家转账API
+   *
+   * 请求方式:GET(HTTPS)
+   * 请求地址:请求地址
+   *
+   * 文档地址:商户单号查询转账单API
+   * 
+ * + * @param outBillNo 【商户单号】 商户系统内部的商家单号,要求此参数只能由数字、大小写字母组成,在商户系统内部唯一 + * @return TransformBillsGetResult 转账单 + * @throws WxPayException . + */ + TransferBillsGetResult getBillsByOutBillNo(String outBillNo) throws WxPayException; + + /** + *
+   *
+   * 2025.1.15 开始新接口 微信单号查询转账单API
+   *
+   * 请求方式:GET(HTTPS)
+   * 请求地址:请求地址
+   *
+   * 文档地址:商户单号查询转账单API
+   * 
+ * + * @param transferBillNo 【微信转账单号】 微信转账单号,微信商家转账系统返回的唯一标识 + * @return TransformBillsGetResult 转账单 + * @throws WxPayException . + */ + TransferBillsGetResult getBillsByTransferBillNo(String transferBillNo) throws WxPayException; + /** * 2025.1.15 开始新接口 解析商家转账结果 * 详见 diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java index 23bf7b13e..f43c887c1 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/TransferServiceImpl.java @@ -48,8 +48,7 @@ public QueryTransferBatchesResult transferBatchesBatchId(QueryTransferBatchesReq if (request.getNeedQueryDetail()) { url = String.format("%s/v3/transfer/batches/batch-id/%s?need_query_detail=true&offset=%s&limit=%s&detail_status=%s", this.payService.getPayBaseUrl(), request.getBatchId(), request.getOffset(), request.getLimit(), request.getDetailStatus()); - } - else { + } else { url = String.format("%s/v3/transfer/batches/batch-id/%s?need_query_detail=false", this.payService.getPayBaseUrl(), request.getBatchId()); } @@ -70,8 +69,7 @@ public QueryTransferBatchesResult transferBatchesOutBatchNo(QueryTransferBatches if (request.getNeedQueryDetail()) { url = String.format("%s/v3/transfer/batches/out-batch-no/%s?need_query_detail=true&offset=%s&limit=%s&detail_status=%s", this.payService.getPayBaseUrl(), request.getOutBatchNo(), request.getOffset(), request.getLimit(), request.getDetailStatus()); - } - else { + } else { url = String.format("%s/v3/transfer/batches/out-batch-no/%s?need_query_detail=false", this.payService.getPayBaseUrl(), request.getOutBatchNo()); } @@ -97,6 +95,31 @@ public TransferBillsResult transferBills(TransferBillsRequest request) throws Wx return GSON.fromJson(result, TransferBillsResult.class); } + @Override + public TransferBillsCancelResult transformBillsCancel(String outBillNo) throws WxPayException { + String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills/out-bill-no/%s/cancel", + this.payService.getPayBaseUrl(), outBillNo); + String result = this.payService.postV3(url, ""); + + return GSON.fromJson(result, TransferBillsCancelResult.class); + } + + @Override + public TransferBillsGetResult getBillsByOutBillNo(String outBillNo) throws WxPayException { + String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills/out-bill-no/%s", + this.payService.getPayBaseUrl(), outBillNo); + String result = this.payService.getV3(url); + return GSON.fromJson(result, TransferBillsGetResult.class); + } + + @Override + public TransferBillsGetResult getBillsByTransferBillNo(String transferBillNo) throws WxPayException { + String url = String.format("%s/v3/fund-app/mch-transfer/transfer-bills/transfer-bill-no/%s", + this.payService.getPayBaseUrl(), transferBillNo); + String result = this.payService.getV3(url); + return GSON.fromJson(result, TransferBillsGetResult.class); + } + @Override public TransferBillsNotifyResult parseTransferBillsNotifyResult(String notifyData, SignatureHeader header) throws WxPayException { return this.payService.baseParseOrderNotifyV3Result(notifyData, header, TransferBillsNotifyResult.class, TransferBillsNotifyResult.DecryptNotifyResult.class); diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java index cd607dff0..10c2a5da6 100644 --- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java +++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/TransferServiceImplTest.java @@ -87,4 +87,19 @@ public void testTransferBills() throws WxPayException { .userName("测试用户").build(); log.info("发起商家转账:{}", this.payService.getTransferService().transferBills(transferBillsRequest)); } + + @Test + public void testTransformBillsCancel() throws WxPayException { + log.info("撤销商家转账:{}", this.payService.getTransferService().transformBillsCancel("123456")); + } + + @Test + public void testGetBillsByOutBillNo() throws WxPayException { + log.info("商户单号查询转账单:{}", this.payService.getTransferService().getBillsByOutBillNo("123456")); + } + + @Test + public void testGetBillsByTransferBillNo() throws WxPayException { + log.info("微信单号查询转账单:{}", this.payService.getTransferService().getBillsByTransferBillNo("123456")); + } } From d65e2f27a97bb0be7866e3f5ca0cff6f11317a62 Mon Sep 17 00:00:00 2001 From: giveup Date: Fri, 24 Jan 2025 21:26:02 +0800 Subject: [PATCH 14/56] =?UTF-8?q?:art:=20WxMpSubscribeMessage=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E5=BA=8F=E5=88=97=E5=8C=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/mp/bean/subscribe/WxMpSubscribeMessage.java | 2 +- .../mp/bean/subscribe/WxMpSubscribeMessageTest.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java index d2695959e..6820d103b 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessage.java @@ -17,7 +17,7 @@ @NoArgsConstructor @Builder @AllArgsConstructor -public class WxMpSubscribeMessage { +public class WxMpSubscribeMessage implements Serializable { /** * 接收者openid. diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java index 078ad5157..684211659 100644 --- a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java +++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/subscribe/WxMpSubscribeMessageTest.java @@ -2,6 +2,9 @@ import org.testng.annotations.*; +import java.io.Serializable; +import java.util.Arrays; + import static org.testng.AssertJUnit.*; /** @@ -43,4 +46,9 @@ public void testToJson() { assertEquals(message.toJson(), actual); } + + @Test + void testWxMpSubscribeMessageIsSerializable() { + assertTrue(Arrays.stream(WxMpSubscribeMessage.class.getInterfaces()).anyMatch(anInterface -> anInterface.isInstance(Serializable.class))); + } } From f3c1422354ecba119c66020511bffd8de681286a Mon Sep 17 00:00:00 2001 From: superffan <33724896+superffan@users.noreply.github.com> Date: Fri, 24 Jan 2025 21:27:34 +0800 Subject: [PATCH 15/56] =?UTF-8?q?:art:=E3=80=90=E5=BE=AE=E4=BF=A1=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E3=80=91spring-boot-starter=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=AC=E9=92=A5ID=E5=92=8C=E8=AF=81?= =?UTF-8?q?=E4=B9=A6=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E7=AD=89=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wxjava/pay/config/WxPayAutoConfiguration.java | 2 ++ .../wxjava/pay/properties/WxPayProperties.java | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/config/WxPayAutoConfiguration.java b/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/config/WxPayAutoConfiguration.java index 9a9672de1..e401a8cfb 100644 --- a/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/config/WxPayAutoConfiguration.java +++ b/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/config/WxPayAutoConfiguration.java @@ -57,6 +57,8 @@ public WxPayService wxPayService() { payConfig.setPrivateCertPath(StringUtils.trimToNull(this.properties.getPrivateCertPath())); payConfig.setCertSerialNo(StringUtils.trimToNull(this.properties.getCertSerialNo())); payConfig.setApiV3Key(StringUtils.trimToNull(this.properties.getApiv3Key())); + payConfig.setPublicKeyId(StringUtils.trimToNull(this.properties.getPublicKeyId())); + payConfig.setPublicKeyPath(StringUtils.trimToNull(this.properties.getPublicKeyPath())); wxPayService.setConfig(payConfig); return wxPayService; diff --git a/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/properties/WxPayProperties.java b/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/properties/WxPayProperties.java index 232bd33c4..a1a8cc229 100644 --- a/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/properties/WxPayProperties.java +++ b/spring-boot-starters/wx-java-pay-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/pay/properties/WxPayProperties.java @@ -73,7 +73,17 @@ public class WxPayProperties { * apiv3 商户apiclient_cert.pem */ private String privateCertPath; - + + /** + * 公钥ID + */ + private String publicKeyId; + + /** + * pub_key.pem证书文件的绝对路径或者以classpath:开头的类路径. + */ + private String publicKeyPath; + /** * 微信支付是否使用仿真测试环境. * 默认不使用 From 3e48dc7f8378f919f734bc08ff1abd78720d9861 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Fri, 24 Jan 2025 22:18:57 +0800 Subject: [PATCH 16/56] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.2.B?= =?UTF-8?q?=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- solon-plugins/pom.xml | 2 +- solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +- spring-boot-starters/pom.xml | 2 +- .../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +- .../wx-java-channel-spring-boot-starter/pom.xml | 2 +- .../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +- .../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +- .../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +- .../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +- weixin-graal/pom.xml | 2 +- weixin-java-channel/pom.xml | 2 +- weixin-java-common/pom.xml | 2 +- weixin-java-cp/pom.xml | 2 +- weixin-java-miniapp/pom.xml | 2 +- weixin-java-mp/pom.xml | 2 +- weixin-java-open/pom.xml | 2 +- weixin-java-pay/pom.xml | 2 +- weixin-java-qidian/pom.xml | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/pom.xml b/pom.xml index 9f0362816..c7c40521b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B pom WxJava - Weixin/Wechat Java SDK 微信开发Java SDK diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml index 9e52bec0c..9585e9617 100644 --- a/solon-plugins/pom.xml +++ b/solon-plugins/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B pom wx-java-solon-plugins diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml index 687ac3e99..a9b794a96 100644 --- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml index bc8c46627..4e0dc723a 100644 --- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml @@ -3,7 +3,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml index 5787c42ee..9cf2b3172 100644 --- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml index 7c39166d1..46266b8e8 100644 --- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml index 7740ce99c..1e5dab26b 100644 --- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml index 8654c698e..805018b81 100644 --- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml index 1bb196015..4ccc4fa7d 100644 --- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml index f2925cd1a..3aa2b9be4 100644 --- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml index 87d5c08c4..355ef6f93 100644 --- a/solon-plugins/wx-java-open-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml index bfc53597d..6357cc908 100644 --- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml index e95b83510..4ff6dba00 100644 --- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml @@ -3,7 +3,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml index 3f5839696..c5cb2954d 100644 --- a/spring-boot-starters/pom.xml +++ b/spring-boot-starters/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B pom wx-java-spring-boot-starters diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml index e8dde0974..dca311c01 100644 --- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml index 6a63849e6..8f427c6d0 100644 --- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml @@ -3,7 +3,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml index 65419e065..6ea0eb005 100644 --- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml index 73e70ce07..fdbe3d1e5 100644 --- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml index 74e5082e3..cedde8174 100644 --- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml index b2495d9d7..fba6da9e0 100644 --- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml index 48bf3c483..867f57055 100644 --- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml index 4d0b88794..cddf39300 100644 --- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml index 6505cafac..189ff9467 100644 --- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml index 96c6e8b7a..d4de4e77f 100644 --- a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml index e735cb82d..e118aba65 100644 --- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml @@ -3,7 +3,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml index 7f2eb89e4..338a22a56 100644 --- a/weixin-graal/pom.xml +++ b/weixin-graal/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B weixin-graal diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml index c1fe4637d..8d34754cb 100644 --- a/weixin-java-channel/pom.xml +++ b/weixin-java-channel/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B weixin-java-channel diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml index 7cfce1c1a..e89234d17 100644 --- a/weixin-java-common/pom.xml +++ b/weixin-java-common/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B weixin-java-common diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml index e3a64d000..467ba9885 100644 --- a/weixin-java-cp/pom.xml +++ b/weixin-java-cp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B weixin-java-cp diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml index 5b85813dc..cfe52b968 100644 --- a/weixin-java-miniapp/pom.xml +++ b/weixin-java-miniapp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B weixin-java-miniapp diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml index ffb3eae28..0aecd36da 100644 --- a/weixin-java-mp/pom.xml +++ b/weixin-java-mp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B weixin-java-mp diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml index 58ecb292d..f7fac62e6 100644 --- a/weixin-java-open/pom.xml +++ b/weixin-java-open/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B weixin-java-open diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml index 1c64b458f..6eeb06624 100644 --- a/weixin-java-pay/pom.xml +++ b/weixin-java-pay/pom.xml @@ -5,7 +5,7 @@ com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B 4.0.0 diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml index 25718264f..737af413d 100644 --- a/weixin-java-qidian/pom.xml +++ b/weixin-java-qidian/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.1.B + 4.7.2.B weixin-java-qidian From 783c89523dc800b863f91e578ecbc06597de2304 Mon Sep 17 00:00:00 2001 From: imyzt Date: Fri, 7 Feb 2025 19:58:53 +0800 Subject: [PATCH 17/56] =?UTF-8?q?:new:=20#3488=E3=80=90=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E3=80=91=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=B7=B2=E9=85=8D=E7=BD=AE=E7=9A=84=E3=80=8C?= =?UTF-8?q?=E8=81=94=E7=B3=BB=E6=88=91=E3=80=8D=E5=88=97=E8=A1=A8=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cp/api/WxCpExternalContactService.java | 19 ++++++ .../impl/WxCpExternalContactServiceImpl.java | 11 ++++ .../cp/bean/external/WxCpContactWayList.java | 63 +++++++++++++++++++ .../weixin/cp/constant/WxCpApiPathConsts.java | 4 ++ .../WxCpExternalContactServiceImplTest.java | 17 +++++ 5 files changed, 114 insertions(+) create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayList.java diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java index f55d2f7b9..c886fcab6 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java @@ -59,6 +59,25 @@ public interface WxCpExternalContactService { */ WxCpContactWayInfo getContactWay(String configId) throws WxErrorException; + /** + * 获取企业已配置的「联系我」列表 + * + *
+   * 获取企业配置的「联系我」二维码和「联系我」小程序插件列表。不包含临时会话。
+   * 注意,该接口仅可获取2021年7月10日以后创建的「联系我」
+   * 
+ * + * 文档地址: 获取企业已配置的「联系我」列表 + * + * @param startTime 「联系我」创建起始时间戳, 默认为90天前 + * @param endTime 「联系我」创建结束时间戳, 默认为当前时间 + * @param cursor 分页查询使用的游标,为上次请求返回的 next_cursor + * @param limit 每次查询的分页大小,默认为100条,最多支持1000条 + * @return contact way configId + * @throws WxErrorException the wx error exception + */ + WxCpContactWayList listContactWay(Long startTime, Long endTime, String cursor, Long limit) throws WxErrorException; + /** * 更新企业已配置的「联系我」方式 * diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java index c2fbdfe6e..8e3a8d7b9 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImpl.java @@ -65,6 +65,17 @@ public WxCpContactWayInfo getContactWay(String configId) throws WxErrorException return WxCpContactWayInfo.fromJson(this.mainService.post(url, json.toString())); } + @Override + public WxCpContactWayList listContactWay(Long startTime, Long endTime, String cursor, Long limit) throws WxErrorException { + JsonObject json = new JsonObject(); + json.addProperty("start_time", startTime); + json.addProperty("end_time", endTime); + json.addProperty("cursor", cursor); + json.addProperty("limit", limit); + final String url = this.mainService.getWxCpConfigStorage().getApiUrl(LIST_CONTACT_WAY); + return WxCpContactWayList.fromJson(this.mainService.post(url, json.toString())); + } + @Override public WxCpBaseResp updateContactWay(WxCpContactWayInfo info) throws WxErrorException { if (StringUtils.isBlank(info.getContactWay().getConfigId())) { diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayList.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayList.java new file mode 100644 index 000000000..04918f64e --- /dev/null +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayList.java @@ -0,0 +1,63 @@ +package me.chanjar.weixin.cp.bean.external; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import me.chanjar.weixin.cp.bean.WxCpBaseResp; +import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder; + +import java.io.Serializable; +import java.util.List; + +/** + * 「联系我」方式 列表返回对象 + * + * @author imyzt + */ +@EqualsAndHashCode(callSuper = true) +@Data +@NoArgsConstructor +public class WxCpContactWayList extends WxCpBaseResp implements Serializable { + private static final long serialVersionUID = -8697184659526210472L; + + @SerializedName("contact_way") + private List contactWay; + + /** + * The type Contact way. + */ + @Getter + @Setter + public static class ContactWay implements Serializable { + private static final long serialVersionUID = -8697184659526210472L; + + /** + * 联系方式的配置id + */ + @SerializedName("config_id") + private String configId; + } + + /** + * From json wx cp contact way list. + * + * @param json the json + * @return the wx cp contact way list + */ + public static WxCpContactWayList fromJson(String json) { + return WxCpGsonBuilder.create().fromJson(json, WxCpContactWayList.class); + } + + /** + * To json string. + * + * @return the string + */ + public String toJson() { + return WxCpGsonBuilder.create().toJson(this); + } + +} diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java index dfb38a524..3aecf7212 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java @@ -1085,6 +1085,10 @@ interface ExternalContact { * The constant GET_CONTACT_WAY. */ String GET_CONTACT_WAY = "/cgi-bin/externalcontact/get_contact_way"; + /** + * The constant LIST_CONTACT_WAY. + */ + String LIST_CONTACT_WAY = "/cgi-bin/externalcontact/list_contact_way"; /** * The constant UPDATE_CONTACT_WAY. */ diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java index c629165ca..4bd80928b 100644 --- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java +++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpExternalContactServiceImplTest.java @@ -4,6 +4,9 @@ import com.google.common.collect.Lists; import com.google.inject.Inject; + +import java.time.LocalDateTime; +import java.time.ZoneOffset; import java.util.ArrayList; import java.util.Collections; import java.util.Date; @@ -90,6 +93,20 @@ public void testGetContactWay() throws WxErrorException { assertNotNull(contactWayInfo); } + /** + * Test list contact way. + * + * @throws WxErrorException the wx error exception + */ + @Test + public void testListContactWay() throws WxErrorException { + long startTime = LocalDateTime.now().minusDays(1).toEpochSecond(ZoneOffset.of("+8")); + long endTime = LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")); + WxCpContactWayList wxCpContactWayList = this.wxCpService.getExternalContactService().listContactWay(startTime, endTime, null, 100L); + System.out.println(wxCpContactWayList.toJson()); + assertNotNull(wxCpContactWayList); + } + /** * Test update contact way. * From 410cc9dfd772145f9e5fdea8f5e1562eab3580f1 Mon Sep 17 00:00:00 2001 From: je45 <23151789+je45@users.noreply.github.com> Date: Fri, 7 Feb 2025 21:22:39 +0800 Subject: [PATCH 18/56] =?UTF-8?q?:art:=20#3490=E3=80=90=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E6=B6=88=E8=B4=B9=E8=80=85=E6=8A=95?= =?UTF-8?q?=E8=AF=89=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E5=A2=9E=E5=8A=A0=E7=9A=84=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/complaint/ComplaintDetailResult.java | 137 ++++++++++++++++++ .../complaint/NegotiationHistoryResult.java | 59 ++++++-- .../wxpay/bean/complaint/ResponseRequest.java | 53 +++++++ .../UpdateRefundProgressRequest.java | 8 +- .../bean/notify/ComplaintNotifyResult.java | 12 +- .../wxpay/service/ComplaintService.java | 4 +- 6 files changed, 253 insertions(+), 20 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java index 157e095bb..f8562dce3 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java @@ -327,4 +327,141 @@ public static class ServiceOrder implements Serializable { */ @SerializedName("user_tag_list") private String[] userTagList; + + /** + *
+   * 字段名:补充信息
+   * 是否必填:否
+   * 描述: 用在特定行业或场景下返回的补充信息
+   * 
+ */ + @SerializedName("additional_info") + private AdditionalInfo additionalInfo; + + @Data + public static class AdditionalInfo implements Serializable { + private static final long serialVersionUID = 7917816070738944147L; + + /** + *
+     * 字段名:补充信息类型
+     * 是否必填:否
+     * 描述: 补充信息类型
+     * 示例值:SHARE_POWER_TYPE: 充电宝投诉相关行业
+     * 
+ */ + @SerializedName("type") + private String type; + + /** + *
+     * 字段名:充电宝投诉相关信息
+     * 是否必填:否
+     * 描述:当type为充电宝投诉相关时有值
+     * 
+ */ + @SerializedName("share_power_info") + private SharePowerInfo sharePowerInfo; + + /** + * 充电宝投诉相关信息 + */ + @Data + public static class SharePowerInfo implements Serializable { + private static final long serialVersionUID = -2878382307459369354L; + + /** + *
+       * 字段名:归还时间
+       * 是否必填:否
+       * 描述:遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,
+       *      yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,
+       *      HH:mm:ss表示时分秒,
+       *      TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
+       * 示例值:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒
+       * 
+ */ + @SerializedName("return_time") + private String returnTime; + + /** + *
+       * 字段名:归还地点信息
+       * 是否必填:否
+       * 描述:  归还地点信息
+       * 
+ */ + @SerializedName("return_address_info") + private ReturnAddressInfo returnAddressInfo; + + @Data + public static class ReturnAddressInfo implements Serializable { + private static final long serialVersionUID = -7649986542568217256L; + + /** + *
+         * 字段名:归还地点
+         * 是否必填:否 string(256)
+         * 描述:归还地点
+         * 
+ */ + @SerializedName("return_address") + private String returnAddress; + + /** + *
+         * 字段名:归还地点经度
+         * 是否必填:否 string(32)
+         * 描述:经度,字符串,范围为-180~180,负数表示西经。使用GCJ-02坐标系
+         * 
+ */ + @SerializedName("longitude") + private String longitude; + + /** + *
+         * 字段名:归还地点纬度
+         * 是否必填:否 string(32)
+         * 描述:纬度,字符串,范围为-90~90,负数表示南纬。使用GCJ-02坐标系
+         * 
+ */ + @SerializedName("latitude") + private String latitude; + } + + /** + *
+       * 字段名:是否归还同一柜机
+       * 是否必填:否
+       * 描述:用户声明是否将充电宝归还至与借取时同一柜机
+       * 
+ */ + @SerializedName("is_returned_to_same_machine") + private Boolean isReturnedToSameMachine; + } + } + + /** + *
+   * 字段名:是否在平台协助中
+   * 是否必填:否
+   * 描述:标识当前投诉单是否正处在平台协助流程中。
+   * 注:在协助期间由微信支付客服为用户服务,期间商户向用户发送的留言用户不可见
+   * 
+ */ + @SerializedName("in_platform_service") + private Boolean inPlatformService; + + /** + *
+   * 字段名:是否需即时服务用户
+   * 是否必填:否
+   * 描述:因用户诉求紧急度、用户界面差异等因素,部分投诉单建议商户更即时地响应用户诉求。
+   *      如此处标识为“是”,建议商户提升服务时效,给用户带来更好的体验
+   * 
+ */ + @SerializedName("need_immediate_service") + private Boolean needImmediateService; + + } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java index 2da216446..7c8738fe2 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java @@ -142,20 +142,30 @@ public static class ComplaintMedia implements Serializable { * 是否必填:是 * 描述: * 当前投诉协商记录的操作类型,对应枚举: - * USER_CREATE_COMPLAINT:用户提交投诉 - * USER_CONTINUE_COMPLAINT:用户继续投诉 - * USER_RESPONSE:用户留言 - * PLATFORM_RESPONSE:平台留言 - * MERCHANT_RESPONSE:商户留言 - * MERCHANT_CONFIRM_COMPLETE:商户申请结单 - * COMPLAINT_FULL_REFUNDED:投诉单全额退款 - * USER_CREATE_COMPLAINT_SYSTEM_MESSAGE:用户提交投诉系统通知 - * COMPLAINT_FULL_REFUNDED_SYSTEM_MESSAGE:投诉单全额退款系统通知 - * USER_CONTINUE_COMPLAINT_SYSTEM_MESSAGE:用户继续投诉系统通知 - * MERCHANT_CONFIRM_COMPLETE_SYSTEM_MESSAGE:商户申请结单系统通知 - * USER_REVOKE_COMPLAINT:用户主动撤诉(只存在于历史投诉单的协商历史中) - * PLATFORM_HELP_APPLICATION:平台问询 - * USER_APPLY_PLATFORM_HELP:申请协助 + * USER_CREATE_COMPLAINT: 用户提交投诉 + * USER_CONTINUE_COMPLAINT: 用户继续投诉 + * USER_RESPONSE: 用户留言 + * PLATFORM_RESPONSE: 平台留言 + * MERCHANT_RESPONSE: 商户留言 + * MERCHANT_CONFIRM_COMPLETE: 商户申请结单 + * USER_CREATE_COMPLAINT_SYSTEM_MESSAGE: 用户提交投诉系统通知 + * COMPLAINT_FULL_REFUNDED_SYSTEM_MESSAGE: 投诉单发起全额退款系统通知 + * USER_CONTINUE_COMPLAINT_SYSTEM_MESSAGE: 用户继续投诉系统通知 + * USER_REVOKE_COMPLAINT: 用户主动撤诉(只存在于历史投诉单的协商历史中) + * USER_COMFIRM_COMPLAINT: 用户确认投诉解决(只存在于历史投诉单的协商历史中) + * PLATFORM_HELP_APPLICATION: 平台催办 + * USER_APPLY_PLATFORM_HELP: 用户申请平台协助 + * MERCHANT_APPROVE_REFUND: 商户同意退款申请 + * MERCHANT_REFUSE_RERUND: 商户拒绝退款申请, 此时操作内容里展示拒绝原因 + * USER_SUBMIT_SATISFACTION: 用户提交满意度调查结果,此时操作内容里会展示满意度分数 + * SERVICE_ORDER_CANCEL: 服务订单已取消 + * SERVICE_ORDER_COMPLETE: 服务订单已完成 + * COMPLAINT_PARTIAL_REFUNDED_SYSTEM_MESSAGE: 投诉单发起部分退款系统通知 + * COMPLAINT_REFUND_RECEIVED_SYSTEM_MESSAGE: 投诉单退款到账系统通知 + * COMPLAINT_ENTRUSTED_REFUND_SYSTEM_MESSAGE: 投诉单受托退款系统通知 + * USER_APPLY_PLATFORM_SERVICE: 用户申请平台协助 + * USER_CANCEL_PLATFORM_SERVICE: 用户取消平台协助 + * PLATFORM_SERVICE_FINISHED: 客服结束平台协助 * */ @SerializedName("operate_type") @@ -179,11 +189,32 @@ public static class ComplaintMedia implements Serializable { * 描述: * 当前投诉协商记录提交的图片凭证(url格式),最多返回4张图片,url有效时间为1小时。如未查询到协商历史图片凭证,则返回空数组。 * 注:本字段包含商户、微信支付客服在协商解决投诉时上传的图片凭证,若希望查看用户图片,请使用complaint_media_list字段并联系微信支付客服 + * 注:此字段不包含用户提交的图片凭证,建议统一使用complaint_media_list字段接收和请求资料凭证,未来该字段将废弃 * */ @SerializedName("image_list") private List imageList; + /** + *
+     * 字段名:用户申请平台协助原因
+     * 是否必填:否
+     * 描述:用户此次申请平台协助时选择的申请协助原因
+     * 
+ */ + @SerializedName("user_appy_platform_service_reason") + private String userApplyPlatformServiceReason; + + /** + *
+     * 字段名:用户申请平台协助原因描述
+     * 是否必填:否
+     * 描述:用户此次申请平台协助时填写的具体申请协助原因描述
+     * 
+ */ + @SerializedName("user_appy_platform_service_reason_description") + private String userApplyPlatformServiceReasonDescription; + } } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java index 6f582b930..470f2bed1 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java @@ -94,4 +94,57 @@ public class ResponseRequest implements Serializable { @SerializedName("jump_url_text") private String jumpUrlText; + /** + *
+   * 字段名:跳转小程序信息
+   * 是否必填:否
+   * 描述:商户可在回复中附加小程序信息,引导用户跳转至商户客诉处理小程序。
+   * 注:配置小程序属于灰度功能,若有需要请联系对接的行业运营进行咨询。
+   * 
+ */ + @SerializedName("mini_program_jump_info") + private MiniProgramJumpInfo miniProgramJumpInfo; + + + /** + * 跳转小程序信息 + */ + @Data + public static class MiniProgramJumpInfo implements Serializable { + private static final long serialVersionUID = 1169503275787468380L; + + /** + *
+     * 字段名:跳转小程序APPID
+     * 是否必填:是
+     * 描述:商户可在回复中附加小程序页面路径,引导用户跳转至商户服务工具页面。
+     *      该字段为小程序APPID。
+     * 
+ */ + @SerializedName("appid") + private String appId; + + /** + *
+     * 字段名:跳转小程序页面PATH
+     * 是否必填:是
+     * 描述:商户可在回复中附加小程序页面路径,引导用户跳转至商户服务工具页面。
+     *      该字段为小程序路径。
+     * 
+ */ + @SerializedName("path") + private String path; + + /** + *
+     * 字段名:跳转小程序页面名称
+     * 是否必填:是
+     * 描述:商户可在回复中附加小程序页面路径,引导用户跳转至商户服务工具页面。
+     *      该字段为商户可自定义的页面名称。
+     * 
+ */ + @SerializedName("text") + private String text; + } + } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java index f7715c522..79668bd0c 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java @@ -61,7 +61,7 @@ public class UpdateRefundProgressRequest implements Serializable { /** *
    * 字段名:拒绝退款原因
-   * 是否必填:否
+   * 是否必填:否 string(200)
    * 描述:在拒绝退款时返回拒绝退款的原因
    * 
*/ @@ -72,7 +72,9 @@ public class UpdateRefundProgressRequest implements Serializable { *
    * 字段名:拒绝退款的举证图片列表
    * 是否必填:否
-   * 描述:在拒绝退款时,如果有拒绝的图片举证,可以提供 最多上传4张图片, 传入调用“商户上传反馈图片”接口返回的media_id,最多上传4张图片凭证
+   * 描述:在拒绝退款时,如果有拒绝的图片举证,可以提供 最多上传4张图片,
+   *      传入调用“商户上传反馈图片”接口返回的media_id,最多上传4张图片凭证
+   *
    * 
*/ @SerializedName("reject_media_list") @@ -81,7 +83,7 @@ public class UpdateRefundProgressRequest implements Serializable { /** *
    * 字段名:备注
-   * 是否必填:否
+   * 是否必填:否 string(200)
    * 描述:任何需要向微信支付客服反馈的信息
    * 
*/ diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java index a5d18df6d..9464144c1 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java @@ -47,13 +47,23 @@ public static class DecryptNotifyResult implements Serializable { * 是否必填:是 * 描述: * 触发本次投诉通知回调的具体动作类型,枚举如下: + * 常规通知: * CREATE_COMPLAINT:用户提交投诉 * CONTINUE_COMPLAINT:用户继续投诉 * USER_RESPONSE:用户新留言 * RESPONSE_BY_PLATFORM:平台新留言 - * SELLER_REFUND:收款方全额退款 + * SELLER_REFUND:商户发起全额退款 * MERCHANT_RESPONSE:商户新回复 * MERCHANT_CONFIRM_COMPLETE:商户反馈处理完成 + * USER_APPLY_PLATFORM_SERVICE:用户申请平台协助 + * USER_CANCEL_PLATFORM_SERVICE:用户取消平台协助 + * PLATFORM_SERVICE_FINISHED:客服结束平台协助 + * + * 申请退款单的附加通知: + * 以下通知会更新投诉单状态,建议收到后查询投诉单详情。 + * MERCHANT_APPROVE_REFUND:商户同意退款 + * MERCHANT_REJECT_REFUND:商户驳回退款 + * REFUND_SUCCESS:退款到账 * */ @SerializedName(value = "action_type") diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java index 66de1458a..6fc1367cf 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java @@ -152,7 +152,7 @@ public interface ComplaintService { /** *
    * 商户上传反馈图片API
-   * 文档详见: ...
+   * 文档详见: ...
    * 接口链接:https://api.mch.weixin.qq.com/v3/merchant-service/images/upload
    * 
* @@ -165,7 +165,7 @@ public interface ComplaintService { /** *
    * 商户上传反馈图片API
-   * 文档详见: ...
+   * 文档详见: ...
    * 接口链接:https://api.mch.weixin.qq.com/v3/merchant-service/images/upload
    * 
* From 22ec3f0eca967b8df0ce3f8370cb69635985e1b7 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Mon, 17 Feb 2025 11:10:49 +0800 Subject: [PATCH 19/56] =?UTF-8?q?:art:=20=E5=A2=9E=E5=8A=A0=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E9=98=B2=E6=AD=A2=E8=AF=AF=E8=A7=A3=EF=BC=8C=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E4=BC=98=E5=8C=96=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../binarywang/wxpay/config/WxPayConfig.java | 66 +++++++++++-------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java index 8cbf954ee..35558d563 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java @@ -6,6 +6,17 @@ import com.github.binarywang.wxpay.v3.WxPayV3HttpClientBuilder; import com.github.binarywang.wxpay.v3.auth.*; import com.github.binarywang.wxpay.v3.util.PemUtils; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.SneakyThrows; +import lombok.ToString; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.RegExUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.ssl.SSLContexts; + +import javax.net.ssl.SSLContext; import java.io.*; import java.net.URL; import java.nio.charset.StandardCharsets; @@ -16,16 +27,6 @@ import java.security.cert.X509Certificate; import java.util.Base64; import java.util.Optional; -import javax.net.ssl.SSLContext; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.SneakyThrows; -import lombok.ToString; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.RegExUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.ssl.SSLContexts; /** * 微信支付配置 @@ -310,8 +311,8 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException { PublicKey publicKey = null; if (this.getPublicKeyString() != null || this.getPublicKeyPath() != null || this.publicKeyContent != null) { try (InputStream pubInputStream = - this.loadConfigInputStream(this.getPublicKeyString(), this.getPublicKeyPath(), - this.publicKeyContent, "publicKeyPath")) { + this.loadConfigInputStream(this.getPublicKeyString(), this.getPublicKeyPath(), + this.publicKeyContent, "publicKeyPath")) { publicKey = PemUtils.loadPublicKey(pubInputStream); } } @@ -322,10 +323,10 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException { Verifier certificatesVerifier; if (publicKey == null) { certificatesVerifier = - new AutoUpdateCertificatesVerifier( - new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)), - this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(), - this.getPayBaseUrl(), wxPayHttpProxy); + new AutoUpdateCertificatesVerifier( + new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)), + this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(), + this.getPayBaseUrl(), wxPayHttpProxy); } else { certificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId); } @@ -366,21 +367,32 @@ private WxPayHttpProxy getWxPayHttpProxy() { return null; } + /** + * 从指定参数加载输入流 + * + * @param configString 证书内容进行Base64加密后的字符串 + * @param configPath 证书路径 + * @param configContent 证书内容的字节数组 + * @param certName 证书的标识 + * @return 输入流 + * @throws WxPayException 异常 + */ private InputStream loadConfigInputStream(String configString, String configPath, byte[] configContent, - String fileName) throws WxPayException { - InputStream inputStream; + String certName) throws WxPayException { if (configContent != null) { - inputStream = new ByteArrayInputStream(configContent); - } else if (StringUtils.isNotEmpty(configString)) { + return new ByteArrayInputStream(configContent); + } + + if (StringUtils.isNotEmpty(configString)) { configContent = Base64.getDecoder().decode(configString); - inputStream = new ByteArrayInputStream(configContent); - } else { - if (StringUtils.isBlank(configPath)) { - throw new WxPayException("请确保证书文件地址【" + fileName + "】或者内容已配置"); - } - inputStream = this.loadConfigInputStream(configPath); + return new ByteArrayInputStream(configContent); } - return inputStream; + + if (StringUtils.isBlank(configPath)) { + throw new WxPayException(String.format("请确保【%s】的文件地址【%s】存在", certName, configPath)); + } + + return this.loadConfigInputStream(configPath); } From 5da939647cea3c88e8ee9071f81a1efdca4c8ff4 Mon Sep 17 00:00:00 2001 From: zhangruhong Date: Wed, 19 Feb 2025 19:50:49 +0800 Subject: [PATCH 20/56] =?UTF-8?q?:art:=20=20#3500=E3=80=90=E5=85=AC?= =?UTF-8?q?=E4=BC=97=E5=8F=B7=E3=80=91=E6=B6=88=E6=81=AF=E6=8E=A5=E5=8F=97?= =?UTF-8?q?=E7=B1=BB=E6=B7=BB=E5=8A=A0=E5=90=8D=E7=A7=B0=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E4=BA=8B=E4=BB=B6=E6=8E=A8=E9=80=81=E6=89=80?= =?UTF-8?q?=E9=9C=80=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java index 27b7eaecc..4cd2d0e3b 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java @@ -186,6 +186,14 @@ public class WxMpXmlMessage implements Serializable { @JacksonXmlCData private String unionId; + @XStreamAlias("ret") + @JacksonXmlProperty(localName = "ret") + private Integer ret; + + @XStreamAlias("nickname") + @JacksonXmlProperty(localName = "nickname") + private String nickname; + /////////////////////////////////////// // 群发消息返回的结果 /////////////////////////////////////// From 933840e3b229ec75206aa13d6744211932ba2a58 Mon Sep 17 00:00:00 2001 From: zhangruhong Date: Mon, 3 Mar 2025 15:11:44 +0800 Subject: [PATCH 21/56] =?UTF-8?q?:art:=20=E6=B6=88=E6=81=AF=E7=B1=BB?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0first/second=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java index 4cd2d0e3b..3d5f4ac3a 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/message/WxMpXmlMessage.java @@ -194,6 +194,14 @@ public class WxMpXmlMessage implements Serializable { @JacksonXmlProperty(localName = "nickname") private String nickname; + @XStreamAlias("first") + @JacksonXmlProperty(localName = "first") + private String first; + + @XStreamAlias("second") + @JacksonXmlProperty(localName = "second") + private String second; + /////////////////////////////////////// // 群发消息返回的结果 /////////////////////////////////////// From 15b7460d922d93da56962df610c5d05cc0debeea Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Mon, 3 Mar 2025 15:25:33 +0800 Subject: [PATCH 22/56] =?UTF-8?q?:art:=20=E5=A2=9E=E5=8A=A0=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E8=B5=9E=E5=8A=A9=E5=95=86logo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f55394ef6..e02e046b3 100644 --- a/README.md +++ b/README.md @@ -21,24 +21,29 @@ - + 计全支付Jeepay,开源支付系统 + + + Mall4j + + - + mp qrcode - + diboot低代码开发平台 - + aliyun ad From 71fbc2b1e83e7b96863c486f1f32380c33d8019e Mon Sep 17 00:00:00 2001 From: giveup Date: Mon, 3 Mar 2025 15:28:35 +0800 Subject: [PATCH 23/56] =?UTF-8?q?:art:=20#3499=20=E3=80=90=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E9=85=8D=E7=BD=AE=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E8=81=94=E7=B3=BB=E3=80=8C=E8=81=94=E7=B3=BB=E6=88=91?= =?UTF-8?q?=E3=80=8D=E6=96=B9=E5=BC=8F=E7=9A=84=E6=8E=A5=E5=8F=A3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20is=5Fexclusive=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chanjar/weixin/cp/api/WxCpExternalContactService.java | 1 + .../weixin/cp/bean/external/WxCpContactWayInfo.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java index c886fcab6..7f3cdeab7 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpExternalContactService.java @@ -38,6 +38,7 @@ public interface WxCpExternalContactService { * 用户需要妥善存储返回的config_id,config_id丢失可能导致用户无法编辑或删除「联系我」。 * 临时会话模式不占用「联系我」数量,但每日最多添加10万个,并且仅支持单人。 * 临时会话模式的二维码,添加好友完成后该二维码即刻失效。 + * 文档地址 * * * @param info 客户联系「联系我」方式 diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java index 3a6a61902..5da6a8fd5 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/external/WxCpContactWayInfo.java @@ -152,6 +152,13 @@ public static class ContactWay implements Serializable { @SerializedName("unionid") private String unionId; + + /** + *非必填,是否开启同一外部企业客户只能添加同一个员工,默认为否,开启后,同一个企业的客户会优先添加到同一个跟进人 + */ + @SerializedName("is_exclusive") + private boolean isExclusive; + /** *
      * 非必填

From 2bf31411c09dd81dee663b96b2797bc2521de0f1 Mon Sep 17 00:00:00 2001
From: altusea <114981887+altusea@users.noreply.github.com>
Date: Mon, 3 Mar 2025 15:34:00 +0800
Subject: [PATCH 24/56] =?UTF-8?q?:art:=20#3492=E3=80=90=E8=A7=86=E9=A2=91?=
 =?UTF-8?q?=E5=8F=B7=E3=80=91=20=E5=BE=AE=E4=BF=A1=E5=B0=8F=E5=BA=97?=
 =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E6=8E=A5?=
 =?UTF-8?q?=E5=8F=A3=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=B8=A6=E8=B4=A7=E5=B9=B3?=
 =?UTF-8?q?=E5=8F=B0Id=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../weixin/channel/bean/order/OrderCommissionInfo.java        | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderCommissionInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderCommissionInfo.java
index 78e391e77..f3cab1f4b 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderCommissionInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderCommissionInfo.java
@@ -42,4 +42,8 @@ public class OrderCommissionInfo implements Serializable {
   /** 达人openfinderid */
   @JsonProperty("openfinderid")
   private String openFinderId;
+
+  /** 新带货平台 id */
+  @JsonProperty("talent_id")
+  private String talentId;
 }

From 44a95578d949987bb124728ef13f755f95c563dd Mon Sep 17 00:00:00 2001
From: sober 
Date: Mon, 3 Mar 2025 15:39:23 +0800
Subject: [PATCH 25/56] =?UTF-8?q?:bug:=20#3508=20=E3=80=90=E4=BC=81?=
 =?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E8=8E=B7=E5=8F=96=E4=BC=81?=
 =?UTF-8?q?=E4=B8=9A=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?=
 =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7=E4=BF=A1=E6=81=AF=E5=A4=A7?=
 =?UTF-8?q?=E5=B0=8F=E5=86=99=E5=AF=BC=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java
index 2a64f52bc..d04a051c0 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpOAuth2ServiceImpl.java
@@ -13,6 +13,8 @@
 import me.chanjar.weixin.cp.bean.workbench.WxCpSecondVerificationInfo;
 import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
 
+import java.util.Optional;
+
 import static me.chanjar.weixin.common.api.WxConsts.OAuth2Scope.*;
 import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.OAuth2.*;
 
@@ -74,9 +76,9 @@ public WxCpOauth2UserInfo getUserInfo(Integer agentId, String code) throws WxErr
     JsonObject jo = GsonParser.parse(responseText);
 
     return WxCpOauth2UserInfo.builder()
-      .userId(GsonHelper.getString(jo, "UserId"))
+      .userId(Optional.ofNullable(GsonHelper.getString(jo, "UserId")).orElse(GsonHelper.getString(jo, "userid")))
       .deviceId(GsonHelper.getString(jo, "DeviceId"))
-      .openId(GsonHelper.getString(jo, "OpenId"))
+      .openId(Optional.ofNullable(GsonHelper.getString(jo, "OpenId")).orElse(GsonHelper.getString(jo, "openid")))
       .userTicket(GsonHelper.getString(jo, "user_ticket"))
       .expiresIn(GsonHelper.getString(jo, "expires_in"))
       .externalUserId(GsonHelper.getString(jo, "external_userid"))

From 5decfcb917b9562fea49be35c728768a082d6fe6 Mon Sep 17 00:00:00 2001
From: raven <52941626+raven1997s@users.noreply.github.com>
Date: Mon, 3 Mar 2025 15:40:52 +0800
Subject: [PATCH 26/56] =?UTF-8?q?:art:=20=20#3505=E3=80=90=E5=BE=AE?=
 =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E5=BE=AE?=
 =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E5=BC=82=E6=AD=A5=E9=80=9A=E7=9F=A5?=
 =?UTF-8?q?=E8=AF=B7=E6=B1=82=E8=A7=A3=E6=9E=90=E5=A4=B1=E8=B4=A5=E9=97=AE?=
 =?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index 1fa2f8dc8..16fa7a799 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -323,12 +323,13 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String sign
       log.debug("微信支付异步通知请求参数:{}", xmlData);
       WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlData);
       if (signType == null) {
+        String configKey = this.getConfigKey(result.getMchId(), result.getAppid());
         if (result.getSignType() != null) {
           // 如果解析的通知对象中signType有值,则使用它进行验签
           signType = result.getSignType();
-        } else if (configMap.get(result.getMchId()).getSignType() != null) {
+        } else if (configMap.get(configKey).getSignType() != null) {
           // 如果配置中signType有值,则使用它进行验签
-          signType = configMap.get(result.getMchId()).getSignType();
+          signType = configMap.get(configKey).getSignType();
           this.switchover(result.getMchId(), result.getAppid());
         }
       }

From 404102a4c8a5df1bd93bf3cc3125cf28209d053b Mon Sep 17 00:00:00 2001
From: wzl <45782921+wzl-1221@users.noreply.github.com>
Date: Mon, 3 Mar 2025 15:42:26 +0800
Subject: [PATCH 27/56] =?UTF-8?q?:art:=20#3493=20=E3=80=90=E5=BE=AE?=
 =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E5=90=88?=
 =?UTF-8?q?=E5=8D=95=E6=94=AF=E4=BB=98combineTransactions=E6=8E=A5?=
 =?UTF-8?q?=E5=8F=A3=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index 16fa7a799..077562f03 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -809,7 +809,7 @@ public CombineTransactionsResult combine(TradeTypeEnum tradeType, CombineTransac
   @Override
   public  T combineTransactions(TradeTypeEnum tradeType, CombineTransactionsRequest request) throws WxPayException {
     CombineTransactionsResult result = this.combine(tradeType, request);
-    return result.getPayInfo(tradeType, request.getCombineAppid(), request.getCombineAppid(), this.getConfig().getPrivateKey());
+    return result.getPayInfo(tradeType, request.getCombineAppid(), request.getCombineMchid(), this.getConfig().getPrivateKey());
   }
 
   @Override

From 1f0dbcc2aa07f0dcb8c37a260567c1336ad9d7d2 Mon Sep 17 00:00:00 2001
From: Lyx Fly 
Date: Mon, 3 Mar 2025 15:43:38 +0800
Subject: [PATCH 28/56] =?UTF-8?q?:art:=20#3516=E3=80=90=E5=85=AC=E4=BC=97?=
 =?UTF-8?q?=E5=8F=B7=E3=80=91=E4=BF=AE=E6=AD=A3=E4=BB=A3=E7=90=86=E8=AE=A4?=
 =?UTF-8?q?=E8=AF=81=E8=AF=B7=E6=B1=82=E5=A4=B4=E8=AE=BE=E7=BD=AE=E9=94=99?=
 =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../me/chanjar/weixin/mp/api/impl/WxMpServiceOkHttpImpl.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceOkHttpImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceOkHttpImpl.java
index 6d4869b6a..86555aa4a 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceOkHttpImpl.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpServiceOkHttpImpl.java
@@ -50,12 +50,12 @@ public void initHttp() {
       clientBuilder.proxy(getRequestHttpProxy().getProxy());
 
       //设置授权
-      clientBuilder.authenticator(new Authenticator() {
+      clientBuilder.proxyAuthenticator(new Authenticator() {
         @Override
         public Request authenticate(Route route, Response response) throws IOException {
           String credential = Credentials.basic(httpProxy.getProxyUsername(), httpProxy.getProxyPassword());
           return response.request().newBuilder()
-            .header("Authorization", credential)
+            .header("Proxy-Authorization", credential)
             .build();
         }
       });

From 03790d64bcf56b2c0ac202a84997bd0bfb38ed0c Mon Sep 17 00:00:00 2001
From: zhongjq 
Date: Thu, 6 Mar 2025 20:56:12 +0800
Subject: [PATCH 29/56] =?UTF-8?q?:art:=20WxMaMessage.allFieldsMap=E6=94=AF?=
 =?UTF-8?q?=E6=8C=81json=E6=A0=BC=E5=BC=8F=E6=95=B0=E6=8D=AE=E5=AD=98?=
 =?UTF-8?q?=E6=94=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java
index 7a004b845..75d8174ca 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/WxMaMessage.java
@@ -31,7 +31,7 @@ public class WxMaMessage implements Serializable {
   private static final long serialVersionUID = -3586245291677274914L;
 
   /**
-   * 使用dom4j解析的存放所有xml属性和值的map.
+   * 使用dom4j解析的存放所有xml或json属性和值的map.
    */
   private Map allFieldsMap;
 
@@ -287,6 +287,7 @@ public static WxMaMessage fromJson(String json) {
       }
       message.setUselessMsg(null);
     }
+    message.setAllFieldsMap(WxMaGsonBuilder.create().fromJson(json, Map.class));
     return message;
   }
 

From 5ac9922f8d56e345ecc4ded6b095a8a14957a1d5 Mon Sep 17 00:00:00 2001
From: SynchPj <46849861+SynchPj@users.noreply.github.com>
Date: Mon, 17 Mar 2025 10:58:50 +0800
Subject: [PATCH 30/56] =?UTF-8?q?:art:=20#3498=E3=80=90=E5=BE=AE=E4=BF=A1?=
 =?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E6=9C=8D=E5=8A=A1=E5=95=86=E6=A8=A1?=
 =?UTF-8?q?=E5=BC=8F-=E5=85=BC=E5=AE=B9=E5=85=AC=E9=92=A5=E6=A8=A1?=
 =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E8=AF=B7=E6=B1=82=E5=A4=B4=E5=BA=8F=E5=88=97?=
 =?UTF-8?q?=E5=8F=B7=E4=BB=A5=E5=8F=8A=E7=81=B0=E5=BA=A6=E5=88=87=E6=8D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../binarywang/wxpay/config/WxPayConfig.java  | 26 +++++++++++--------
 .../impl/WxPayServiceApacheHttpImpl.java      |  7 ++---
 .../v3/auth/PublicCertificateVerifier.java    |  9 +++++++
 .../binarywang/wxpay/v3/auth/Verifier.java    |  2 ++
 4 files changed, 30 insertions(+), 14 deletions(-)

diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index 35558d563..dedbc6413 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -320,16 +320,7 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
       //构造Http Proxy正向代理
       WxPayHttpProxy wxPayHttpProxy = getWxPayHttpProxy();
 
-      Verifier certificatesVerifier;
-      if (publicKey == null) {
-        certificatesVerifier =
-          new AutoUpdateCertificatesVerifier(
-            new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
-            this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
-            this.getPayBaseUrl(), wxPayHttpProxy);
-      } else {
-        certificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
-      }
+      Verifier certificatesVerifier = getVerifier(merchantPrivateKey, wxPayHttpProxy, publicKey);
 
       WxPayV3HttpClientBuilder wxPayV3HttpClientBuilder = WxPayV3HttpClientBuilder.create()
         .withMerchant(mchId, certSerialNo, merchantPrivateKey)
@@ -355,6 +346,19 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
     }
   }
 
+  private Verifier getVerifier(PrivateKey merchantPrivateKey, WxPayHttpProxy wxPayHttpProxy, PublicKey publicKey) {
+    Verifier certificatesVerifier = new AutoUpdateCertificatesVerifier(
+      new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
+      this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
+      this.getPayBaseUrl(), wxPayHttpProxy);
+    if (publicKey != null) {
+      Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
+      publicCertificatesVerifier.setOtherVerifier(certificatesVerifier);
+      certificatesVerifier = publicCertificatesVerifier;
+    }
+    return certificatesVerifier;
+  }
+
   /**
    * 初始化一个WxPayHttpProxy对象
    *
@@ -382,7 +386,7 @@ private InputStream loadConfigInputStream(String configString, String configPath
     if (configContent != null) {
       return new ByteArrayInputStream(configContent);
     }
-    
+
     if (StringUtils.isNotEmpty(configString)) {
       configContent = Base64.getDecoder().decode(configString);
       return new ByteArrayInputStream(configContent);
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
index 7fd793979..d8ba95971 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
@@ -100,6 +100,8 @@ public String postV3(String url, String requestStr) throws WxPayException {
     HttpPost httpPost = this.createHttpPost(url, requestStr);
     httpPost.addHeader(ACCEPT, APPLICATION_JSON);
     httpPost.addHeader(CONTENT_TYPE, APPLICATION_JSON);
+    String serialNumber = getWechatpaySerial(getConfig());
+    httpPost.addHeader("Wechatpay-Serial", serialNumber);
     try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
       //v3已经改为通过状态码判断200 204 成功
       int statusCode = response.getStatusLine().getStatusCode();
@@ -387,10 +389,9 @@ private WxPayException convertException(JsonObject jsonObject) {
    * @return
    */
   private String getWechatpaySerial(WxPayConfig wxPayConfig) {
-    String serialNumber = wxPayConfig.getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase();
     if (StringUtils.isNotBlank(wxPayConfig.getPublicKeyId())) {
-      serialNumber = wxPayConfig.getPublicKeyId();
+      return wxPayConfig.getPublicKeyId();
     }
-    return serialNumber;
+    return wxPayConfig.getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase();
   }
 }
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
index 9344fc6f8..45f76818c 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
@@ -9,6 +9,8 @@ public class PublicCertificateVerifier implements Verifier{
 
     private final PublicKey publicKey;
 
+    private Verifier certificateVerifier;
+
     private final X509PublicCertificate publicCertificate;
 
     public PublicCertificateVerifier(PublicKey publicKey, String publicId) {
@@ -16,8 +18,15 @@ public PublicCertificateVerifier(PublicKey publicKey, String publicId) {
         this.publicCertificate = new X509PublicCertificate(publicKey, publicId);
     }
 
+   public void setOtherVerifier(Verifier verifier) {
+      this.certificateVerifier = verifier;
+   }
+
     @Override
     public boolean verify(String serialNumber, byte[] message, String signature) {
+        if (!serialNumber.contains("PUB_KEY_ID")) {
+            return this.certificateVerifier.verify(serialNumber, message, signature);
+        }
         try {
             Signature sign = Signature.getInstance("SHA256withRSA");
             sign.initVerify(publicKey);
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/Verifier.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/Verifier.java
index 49f92e2f5..22676601c 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/Verifier.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/Verifier.java
@@ -7,4 +7,6 @@ public interface Verifier {
 
 
   X509Certificate getValidCertificate();
+
+  default void setOtherVerifier(Verifier verifier) {};
 }

From 25309e06ad0f631591f0c9bcdd85ed5b34de87f4 Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Tue, 18 Mar 2025 12:58:09 +0800
Subject: [PATCH 31/56] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.3.B?=
 =?UTF-8?q?=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 pom.xml                                                         | 2 +-
 solon-plugins/pom.xml                                           | 2 +-
 solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml        | 2 +-
 solon-plugins/wx-java-channel-solon-plugin/pom.xml              | 2 +-
 solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml             | 2 +-
 solon-plugins/wx-java-cp-solon-plugin/pom.xml                   | 2 +-
 solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml        | 2 +-
 solon-plugins/wx-java-miniapp-solon-plugin/pom.xml              | 2 +-
 solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml             | 2 +-
 solon-plugins/wx-java-mp-solon-plugin/pom.xml                   | 2 +-
 solon-plugins/wx-java-open-solon-plugin/pom.xml                 | 2 +-
 solon-plugins/wx-java-pay-solon-plugin/pom.xml                  | 2 +-
 solon-plugins/wx-java-qidian-solon-plugin/pom.xml               | 2 +-
 spring-boot-starters/pom.xml                                    | 2 +-
 .../wx-java-channel-multi-spring-boot-starter/pom.xml           | 2 +-
 .../wx-java-channel-spring-boot-starter/pom.xml                 | 2 +-
 .../wx-java-cp-multi-spring-boot-starter/pom.xml                | 2 +-
 spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml     | 2 +-
 .../wx-java-miniapp-multi-spring-boot-starter/pom.xml           | 2 +-
 .../wx-java-miniapp-spring-boot-starter/pom.xml                 | 2 +-
 .../wx-java-mp-multi-spring-boot-starter/pom.xml                | 2 +-
 spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml     | 2 +-
 spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml   | 2 +-
 spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml    | 2 +-
 spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +-
 weixin-graal/pom.xml                                            | 2 +-
 weixin-java-channel/pom.xml                                     | 2 +-
 weixin-java-common/pom.xml                                      | 2 +-
 weixin-java-cp/pom.xml                                          | 2 +-
 weixin-java-miniapp/pom.xml                                     | 2 +-
 weixin-java-mp/pom.xml                                          | 2 +-
 weixin-java-open/pom.xml                                        | 2 +-
 weixin-java-pay/pom.xml                                         | 2 +-
 weixin-java-qidian/pom.xml                                      | 2 +-
 34 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/pom.xml b/pom.xml
index c7c40521b..2151c117a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
   4.0.0
   com.github.binarywang
   wx-java
-  4.7.2.B
+  4.7.3.B
   pom
   WxJava - Weixin/Wechat Java SDK
   微信开发Java SDK
diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml
index 9585e9617..8dbc6b43d 100644
--- a/solon-plugins/pom.xml
+++ b/solon-plugins/pom.xml
@@ -6,7 +6,7 @@
   
     com.github.binarywang
     wx-java
-    4.7.2.B
+    4.7.3.B
   
   pom
   wx-java-solon-plugins
diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
index a9b794a96..fc2796117 100644
--- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-solon-plugins
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
index 4e0dc723a..83a00deac 100644
--- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
   
     wx-java-solon-plugins
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
index 9cf2b3172..512cb41d4 100644
--- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
   
     wx-java-solon-plugins
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
index 46266b8e8..f147e36ee 100644
--- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
   
     wx-java-solon-plugins
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
index 1e5dab26b..b8387c3c0 100644
--- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-solon-plugins
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
index 805018b81..712e1abfb 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml
@@ -4,7 +4,7 @@
   
     wx-java-solon-plugins
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
index 4ccc4fa7d..39df8cfef 100644
--- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-solon-plugins
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
index 3aa2b9be4..cd2bca716 100644
--- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-solon-plugins
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml
index 355ef6f93..bbd6b39ab 100644
--- a/solon-plugins/wx-java-open-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-solon-plugins
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
index 6357cc908..31698e010 100644
--- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-solon-plugins
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
index 4ff6dba00..8a45c7284 100644
--- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
+++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml
@@ -3,7 +3,7 @@
   
     wx-java-solon-plugins
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml
index c5cb2954d..fbb85e686 100644
--- a/spring-boot-starters/pom.xml
+++ b/spring-boot-starters/pom.xml
@@ -6,7 +6,7 @@
   
     com.github.binarywang
     wx-java
-    4.7.2.B
+    4.7.3.B
   
   pom
   wx-java-spring-boot-starters
diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
index dca311c01..4018347e6 100644
--- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-spring-boot-starters
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
index 8f427c6d0..7b9ae6ee2 100644
--- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
   
     wx-java-spring-boot-starters
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
index 6ea0eb005..03cb191fe 100644
--- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
   
     wx-java-spring-boot-starters
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
index fdbe3d1e5..8de92d3ee 100644
--- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
   
     wx-java-spring-boot-starters
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
index cedde8174..886cf8f88 100644
--- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-spring-boot-starters
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml
index fba6da9e0..a2f3aa742 100644
--- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml
@@ -4,7 +4,7 @@
   
     wx-java-spring-boot-starters
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
index 867f57055..3f3ecc50d 100644
--- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-spring-boot-starters
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
index cddf39300..ab6d89e6f 100644
--- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-spring-boot-starters
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
index 189ff9467..cdb43685f 100644
--- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-spring-boot-starters
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml
index d4de4e77f..1aa1dc6f6 100644
--- a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml
@@ -5,7 +5,7 @@
   
     wx-java-spring-boot-starters
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
index e118aba65..c38a1d350 100644
--- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
+++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml
@@ -3,7 +3,7 @@
   
     wx-java-spring-boot-starters
     com.github.binarywang
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml
index 338a22a56..ab9ec8c91 100644
--- a/weixin-graal/pom.xml
+++ b/weixin-graal/pom.xml
@@ -6,7 +6,7 @@
   
     com.github.binarywang
     wx-java
-    4.7.2.B
+    4.7.3.B
   
 
   weixin-graal
diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml
index 8d34754cb..76be718a4 100644
--- a/weixin-java-channel/pom.xml
+++ b/weixin-java-channel/pom.xml
@@ -6,7 +6,7 @@
   
     com.github.binarywang
     wx-java
-    4.7.2.B
+    4.7.3.B
   
 
   weixin-java-channel
diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml
index e89234d17..88e1b2c3f 100644
--- a/weixin-java-common/pom.xml
+++ b/weixin-java-common/pom.xml
@@ -6,7 +6,7 @@
   
     com.github.binarywang
     wx-java
-    4.7.2.B
+    4.7.3.B
   
 
   weixin-java-common
diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml
index 467ba9885..95d067244 100644
--- a/weixin-java-cp/pom.xml
+++ b/weixin-java-cp/pom.xml
@@ -7,7 +7,7 @@
   
     com.github.binarywang
     wx-java
-    4.7.2.B
+    4.7.3.B
   
 
   weixin-java-cp
diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml
index cfe52b968..500add0e4 100644
--- a/weixin-java-miniapp/pom.xml
+++ b/weixin-java-miniapp/pom.xml
@@ -7,7 +7,7 @@
   
     com.github.binarywang
     wx-java
-    4.7.2.B
+    4.7.3.B
   
 
   weixin-java-miniapp
diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml
index 0aecd36da..dde82cf5d 100644
--- a/weixin-java-mp/pom.xml
+++ b/weixin-java-mp/pom.xml
@@ -7,7 +7,7 @@
   
     com.github.binarywang
     wx-java
-    4.7.2.B
+    4.7.3.B
   
 
   weixin-java-mp
diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml
index f7fac62e6..e94059131 100644
--- a/weixin-java-open/pom.xml
+++ b/weixin-java-open/pom.xml
@@ -7,7 +7,7 @@
   
     com.github.binarywang
     wx-java
-    4.7.2.B
+    4.7.3.B
   
 
   weixin-java-open
diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml
index 6eeb06624..f66456aa4 100644
--- a/weixin-java-pay/pom.xml
+++ b/weixin-java-pay/pom.xml
@@ -5,7 +5,7 @@
   
     com.github.binarywang
     wx-java
-    4.7.2.B
+    4.7.3.B
   
   4.0.0
 
diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml
index 737af413d..4e96a904b 100644
--- a/weixin-java-qidian/pom.xml
+++ b/weixin-java-qidian/pom.xml
@@ -7,7 +7,7 @@
   
     com.github.binarywang
     wx-java
-    4.7.2.B
+    4.7.3.B
   
 
   weixin-java-qidian

From 5604a16ae89dcbfb2cf4db45d2f908bdc6a72758 Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Sun, 23 Mar 2025 20:00:52 +0800
Subject: [PATCH 32/56] :art: fix doc

---
 CONTRIBUTING.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c70396482..0b16b4779 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -28,7 +28,7 @@ $ git push
 * 定期使用项目仓库内容更新自己仓库内容。
 
 ```bash
-$ git remote add upstream https://github.com/Wechat-Group/WxJava
+$ git remote add upstream https://github.com/binarywang/WxJava
 $ git fetch upstream
 $ git checkout develop
 $ git rebase upstream/develop

From b225afbd68f69ebe44af3b6fad0bc3404d28d067 Mon Sep 17 00:00:00 2001
From: yangmengyu2021 <87807185+yangmengyu2021@users.noreply.github.com>
Date: Sun, 23 Mar 2025 20:07:01 +0800
Subject: [PATCH 33/56] =?UTF-8?q?:art:=20#3532=20=E3=80=90=E5=BE=AE?=
 =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E6=94=AF?=
 =?UTF-8?q?=E4=BB=98=E9=80=9A=E7=9F=A5=E5=9B=9E=E8=B0=83=E8=A7=A3=E6=9E=90?=
 =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../wxpay/service/impl/BaseWxPayServiceImpl.java           | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index 077562f03..05d1f8c22 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -323,14 +323,13 @@ public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData, String sign
       log.debug("微信支付异步通知请求参数:{}", xmlData);
       WxPayOrderNotifyResult result = WxPayOrderNotifyResult.fromXML(xmlData);
       if (signType == null) {
-        String configKey = this.getConfigKey(result.getMchId(), result.getAppid());
+        this.switchover(result.getMchId(), result.getAppid());
         if (result.getSignType() != null) {
           // 如果解析的通知对象中signType有值,则使用它进行验签
           signType = result.getSignType();
-        } else if (configMap.get(configKey).getSignType() != null) {
+        } else if (this.getConfig().getSignType() != null) {
           // 如果配置中signType有值,则使用它进行验签
-          signType = configMap.get(configKey).getSignType();
-          this.switchover(result.getMchId(), result.getAppid());
+          signType = this.getConfig().getSignType();
         }
       }
 

From dd407141b03c102f1aaff878685a7ebd14271147 Mon Sep 17 00:00:00 2001
From: SynchPj <46849861+SynchPj@users.noreply.github.com>
Date: Mon, 7 Apr 2025 13:01:53 +0800
Subject: [PATCH 34/56] =?UTF-8?q?:art:=20#3530=20=E3=80=90=E5=BE=AE?=
 =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E6=9C=AA?=
 =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=B9=B3=E5=8F=B0=E8=AF=81=E4=B9=A6=E5=BC=95?=
 =?UTF-8?q?=E8=B5=B7=E7=9A=84v3=E8=AF=B7=E6=B1=82=E6=9E=84=E9=80=A0?=
 =?UTF-8?q?=E5=BC=82=E5=B8=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../github/binarywang/wxpay/config/WxPayConfig.java  | 12 ++++++++----
 .../wxpay/v3/auth/PublicCertificateVerifier.java     |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
index dedbc6413..7a14ea152 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java
@@ -347,10 +347,14 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
   }
 
   private Verifier getVerifier(PrivateKey merchantPrivateKey, WxPayHttpProxy wxPayHttpProxy, PublicKey publicKey) {
-    Verifier certificatesVerifier = new AutoUpdateCertificatesVerifier(
-      new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
-      this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
-      this.getPayBaseUrl(), wxPayHttpProxy);
+    Verifier certificatesVerifier = null;
+    // 如果配置了平台证书,则初始化验证器以备v2版本接口验签(公钥灰度实现)
+    if (this.getPrivateCertPath() != null && this.getPrivateKeyPath() != null) {
+      certificatesVerifier = new AutoUpdateCertificatesVerifier(
+        new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)),
+        this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(),
+        this.getPayBaseUrl(), wxPayHttpProxy);
+    }
     if (publicKey != null) {
       Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId);
       publicCertificatesVerifier.setOtherVerifier(certificatesVerifier);
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
index 45f76818c..8c9c4f356 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/v3/auth/PublicCertificateVerifier.java
@@ -24,7 +24,7 @@ public void setOtherVerifier(Verifier verifier) {
 
     @Override
     public boolean verify(String serialNumber, byte[] message, String signature) {
-        if (!serialNumber.contains("PUB_KEY_ID")) {
+        if (!serialNumber.contains("PUB_KEY_ID") && this.certificateVerifier != null) {
             return this.certificateVerifier.verify(serialNumber, message, signature);
         }
         try {

From 3f0b8d4e2bf4fe2d355e412e074078f71eef261b Mon Sep 17 00:00:00 2001
From: cloudX 
Date: Mon, 7 Apr 2025 13:03:10 +0800
Subject: [PATCH 35/56] =?UTF-8?q?:art:=20#3538=20=E3=80=90=E5=BE=AE?=
 =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91V3=E6=8E=A5=E5=8F=A3?=
 =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=9E=E5=90=8D=E6=94=AF=E4=BB=98=E5=8F=82?=
 =?UTF-8?q?=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../request/WxPayUnifiedOrderV3Request.java   | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayUnifiedOrderV3Request.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayUnifiedOrderV3Request.java
index 98dae388e..8ac588de8 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayUnifiedOrderV3Request.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayUnifiedOrderV3Request.java
@@ -250,6 +250,12 @@ public static class Payer implements Serializable {
      */
     @SerializedName(value = "openid")
     private String openid;
+
+    /**
+     * 实名支付用户身份标识
+     */
+    @SerializedName(value = "identity")
+    private Identity identity;
   }
 
   @Data
@@ -572,4 +578,36 @@ public static class SettleInfo implements Serializable {
     @SerializedName(value = "profit_sharing")
     private Boolean profitSharing;
   }
+
+
+  @Data
+  @NoArgsConstructor
+  public static class Identity implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 证件类型
+     * IDCARD:身份证
+     * HONGKONG_MACAO:港澳回乡证
+     * HONGKONG_MACAO_RESIDENT:港澳居住证
+     * TAIWAN_RESIDENT:台湾居住证
+     * FOREIGN_RESIDENT:外国人永居证
+     * OVERSEA_PASSPORT:护照
+     */
+    @SerializedName(value = "type")
+    private String type;
+    /**
+     * 证件号
+     * 证件号,如身份证号。
+     * 示例值:43102119910910512X
+     */
+    @SerializedName(value = "number")
+    private String number;
+    /**
+     * 证件姓名。
+     * 示例值:周星星
+     */
+    @SerializedName(value = "name")
+    private String name;
+  }
 }

From 4828a314e9f5a721dfc8cadc04a25f1d0ff63649 Mon Sep 17 00:00:00 2001
From: yangmengyu2021 <87807185+yangmengyu2021@users.noreply.github.com>
Date: Mon, 7 Apr 2025 13:04:33 +0800
Subject: [PATCH 36/56] =?UTF-8?q?:art:=20#3534=20=E4=B8=BAconnectionReques?=
 =?UTF-8?q?tTimeout=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4=E5=80=BC=EF=BC=8C?=
 =?UTF-8?q?=E9=81=BF=E5=85=8D=E5=BC=80=E5=8F=91=E8=80=85=E5=9C=A8=E8=99=9A?=
 =?UTF-8?q?=E6=8B=9F=E7=BA=BF=E7=A8=8B=E4=B8=AD=E8=B0=83=E7=94=A8=E6=A1=86?=
 =?UTF-8?q?=E6=9E=B6=E7=9A=84httpClient=E6=97=B6=E9=80=A0=E6=88=90?=
 =?UTF-8?q?=E7=9A=84=E6=97=A0=E9=99=90=E7=AD=89=E5=BE=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../common/util/http/apache/DefaultApacheHttpClientBuilder.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java
index 4c06f5168..12f04ba20 100644
--- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java
+++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/util/http/apache/DefaultApacheHttpClientBuilder.java
@@ -59,7 +59,7 @@ public class DefaultApacheHttpClientBuilder implements ApacheHttpClientBuilder {
    * 设置为负数是使用系统默认设置(非3000ms的默认值,而是httpClient的默认设置).
    * 

*/ - private int connectionRequestTimeout = -1; + private int connectionRequestTimeout = 3000; /** * 建立链接的超时时间,默认为5000ms.由于是在链接池获取链接,此设置应该并不起什么作用 From 0452a05dd4e093dc50d4b3fed859521b830036fc Mon Sep 17 00:00:00 2001 From: cxiaoxifeng <11973717+cxiaoxifeng@user.noreply.gitee.com> Date: Wed, 19 Mar 2025 08:54:05 +0000 Subject: [PATCH 37/56] =?UTF-8?q?:art:=20=E3=80=90=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E3=80=91=E4=BF=AE=E5=A4=8D=E7=89=A9=E6=B5=81=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=9F=A5=E8=AF=A2=E7=BB=84=E4=BB=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=89=A9=E5=93=81=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wx/miniapp/api/impl/WxMaImmediateDeliveryServiceImpl.java | 2 +- .../cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImmediateDeliveryServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImmediateDeliveryServiceImpl.java index 05e8f2e0a..342224eff 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImmediateDeliveryServiceImpl.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImmediateDeliveryServiceImpl.java @@ -207,7 +207,7 @@ public GetDeliveryListResponse getDeliveryList() throws WxErrorException { @Override public WxMaBaseResponse updateWaybillGoods(UpdateWaybillGoodsRequest request) throws WxErrorException { - String responseContent = this.wxMaService.post(InstantDelivery.GET_DELIVERY_LIST_URL,request); + String responseContent = this.wxMaService.post(InstantDelivery.UPDATE_WAYBILL_GOODS_URL,request); WxMaBaseResponse response = WxMaGsonBuilder.create().fromJson(responseContent, WxMaBaseResponse.class); if (response.getErrcode() == -1) { throw new WxErrorException(WxError.fromJson(responseContent, WxType.MiniApp)); diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java index d61ade73c..30d52b17c 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java @@ -626,7 +626,7 @@ public interface InstantDelivery { String GET_DELIVERY_LIST_URL = "https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/get_delivery_list"; - /** 获取运力id列表get_delivery_list 商户使用此接口获取所有运力id的列表 */ + /** 物流服务-查询组件-更新物品信息接口 update_waybill_goods 更新物品信息 */ String UPDATE_WAYBILL_GOODS_URL = "https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/update_waybill_goods"; From b6c3d74cbae1946ccd2e996bbb3ce097ff1fa08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=88=E7=AC=91?= <2300064869@qq.com> Date: Wed, 19 Mar 2025 08:57:40 +0000 Subject: [PATCH 38/56] =?UTF-8?q?:new:=20#3529=20=E3=80=90=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E5=A2=9E=E5=8A=A0=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E8=AE=BE=E7=BD=AE=E5=BA=94=E7=94=A8=E5=9C=A8=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=B7=A5=E4=BD=9C=E5=8F=B0=E5=B1=95=E7=A4=BA=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cp/api/WxCpAgentWorkBenchService.java | 8 ++ .../impl/WxCpAgentWorkBenchServiceImpl.java | 6 ++ .../weixin/cp/bean/WxCpAgentWorkBench.java | 91 +++++++++++++++++++ .../weixin/cp/constant/WxCpApiPathConsts.java | 4 + 4 files changed, 109 insertions(+) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpAgentWorkBenchService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpAgentWorkBenchService.java index c50aa2f5f..67c57a8a8 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpAgentWorkBenchService.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpAgentWorkBenchService.java @@ -36,4 +36,12 @@ public interface WxCpAgentWorkBenchService { * @throws WxErrorException the wx error exception */ void setWorkBenchData(WxCpAgentWorkBench wxCpAgentWorkBench) throws WxErrorException; + + /** + * Batch sets work bench data. + * + * @param wxCpAgentWorkBench the wx cp agent work bench + * @throws WxErrorException the wx error exception + */ + void batchSetWorkBenchData(WxCpAgentWorkBench wxCpAgentWorkBench) throws WxErrorException; } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpAgentWorkBenchServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpAgentWorkBenchServiceImpl.java index bb5c191e9..b0bbb3864 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpAgentWorkBenchServiceImpl.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpAgentWorkBenchServiceImpl.java @@ -38,4 +38,10 @@ public void setWorkBenchData(WxCpAgentWorkBench wxCpAgentWorkBench) throws WxErr final String url = String.format(this.mainService.getWxCpConfigStorage().getApiUrl(WORKBENCH_DATA_SET)); this.mainService.post(url, wxCpAgentWorkBench.toUserDataString()); } + + @Override + public void batchSetWorkBenchData(WxCpAgentWorkBench wxCpAgentWorkBench) throws WxErrorException { + final String url = String.format(this.mainService.getWxCpConfigStorage().getApiUrl(WORKBENCH_BATCH_DATA_SET)); + this.mainService.post(url, wxCpAgentWorkBench.toBatchUserDataString()); + } } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java index e74173ee3..6687e8761 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java @@ -6,12 +6,14 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import me.chanjar.weixin.common.util.json.WxGsonBuilder; import me.chanjar.weixin.cp.bean.workbench.WorkBenchKeyData; import me.chanjar.weixin.cp.bean.workbench.WorkBenchList; import me.chanjar.weixin.cp.constant.WxCpConsts; import java.io.Serializable; import java.util.List; +import java.util.Set; /** * The type Wx cp agent work bench. @@ -33,6 +35,10 @@ public class WxCpAgentWorkBench implements Serializable { * 用户的userid */ private String userId; + /** + * 用户的userIds + */ + private Set userIds; /** * 应用id */ @@ -93,6 +99,20 @@ public String toUserDataString() { return userDataObject.toString(); } + /** + * 生成批量用户数据Json字符串 + * + * @return the string + */ + public String toBatchUserDataString() { + JsonObject userDataObject = new JsonObject(); + userDataObject.addProperty("agentid", this.agentId); + JsonArray useridList = WxGsonBuilder.create().toJsonTree(this.userIds).getAsJsonArray(); + userDataObject.add("userid_list", useridList); + this.handleBatch(userDataObject); + return userDataObject.toString(); + } + /** * 处理不用类型的工作台数据 */ @@ -152,4 +172,75 @@ private void handle(JsonObject templateObject) { } } + /** + * 处理不用类型的工作台数据 + */ + private void handleBatch(JsonObject templateObject) { + switch (this.getType()) { + case WxCpConsts.WorkBenchType.KEYDATA: { + JsonArray keyDataArray = new JsonArray(); + JsonObject itemsObject = new JsonObject(); + for (WorkBenchKeyData keyDataItem : this.keyDataList) { + JsonObject keyDataObject = new JsonObject(); + keyDataObject.addProperty("key", keyDataItem.getKey()); + keyDataObject.addProperty("data", keyDataItem.getData()); + keyDataObject.addProperty("jump_url", keyDataItem.getJumpUrl()); + keyDataObject.addProperty("pagepath", keyDataItem.getPagePath()); + keyDataArray.add(keyDataObject); + } + itemsObject.add("items", keyDataArray); + JsonObject dataObject = new JsonObject(); + dataObject.addProperty("type", WxCpConsts.WorkBenchType.KEYDATA); + dataObject.add("keydata", itemsObject); + templateObject.add("data", dataObject); + break; + } + case WxCpConsts.WorkBenchType.IMAGE: { + JsonObject image = new JsonObject(); + image.addProperty("url", this.url); + image.addProperty("jump_url", this.jumpUrl); + image.addProperty("pagepath", this.pagePath); + JsonObject dataObject = new JsonObject(); + dataObject.addProperty("type", WxCpConsts.WorkBenchType.IMAGE); + dataObject.add("image", image); + templateObject.add("data", dataObject); + break; + } + case WxCpConsts.WorkBenchType.LIST: { + JsonArray listArray = new JsonArray(); + JsonObject itemsObject = new JsonObject(); + for (WorkBenchList listItem : this.lists) { + JsonObject listObject = new JsonObject(); + listObject.addProperty("title", listItem.getTitle()); + listObject.addProperty("jump_url", listItem.getJumpUrl()); + listObject.addProperty("pagepath", listItem.getPagePath()); + listArray.add(listObject); + } + itemsObject.add("items", listArray); + JsonObject dataObject = new JsonObject(); + dataObject.addProperty("type", WxCpConsts.WorkBenchType.LIST); + dataObject.add("list", itemsObject); + templateObject.add("data", dataObject); + break; + } + case WxCpConsts.WorkBenchType.WEBVIEW: { + JsonObject webview = new JsonObject(); + webview.addProperty("url", this.url); + webview.addProperty("jump_url", this.jumpUrl); + webview.addProperty("pagepath", this.pagePath); + if (null != this.enableWebviewClick) { + webview.addProperty("enable_webview_click", this.enableWebviewClick); + } + JsonObject dataObject = new JsonObject(); + dataObject.addProperty("type", WxCpConsts.WorkBenchType.WEBVIEW); + dataObject.add("webview", webview); + templateObject.add("data", dataObject); + break; + } + default: { + //do nothing + } + } + } + } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java index 3aecf7212..d70f0ff4c 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java @@ -130,6 +130,10 @@ interface WorkBench { * The constant WORKBENCH_DATA_SET. */ String WORKBENCH_DATA_SET = "/cgi-bin/agent/set_workbench_data"; + /** + * The constant WORKBENCH_BATCH_DATA_SET. + */ + String WORKBENCH_BATCH_DATA_SET = "/cgi-bin/agent/batch_set_workbench_data"; } /** From b44dd2e34758e66a0c8fbe0c740ba21f11a0d28d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=88=E7=AC=91?= <2300064869@qq.com> Date: Mon, 7 Apr 2025 07:01:35 +0000 Subject: [PATCH 39/56] =?UTF-8?q?:art:=20#3541=E3=80=90=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E3=80=91=E5=A2=9E=E5=8A=A0=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?WebView=E5=9E=8B=E5=BA=94=E7=94=A8=E5=9C=A8=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=E5=B1=95=E7=A4=BA=E7=9A=84=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/cp/bean/WxCpAgentWorkBench.java | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java index 6687e8761..2a3e4448b 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/WxCpAgentWorkBench.java @@ -13,7 +13,6 @@ import java.io.Serializable; import java.util.List; -import java.util.Set; /** * The type Wx cp agent work bench. @@ -38,7 +37,7 @@ public class WxCpAgentWorkBench implements Serializable { /** * 用户的userIds */ - private Set userIds; + private List useridList; /** * 应用id */ @@ -64,6 +63,15 @@ public class WxCpAgentWorkBench implements Serializable { * 参考示例:今日要闻 */ private Boolean enableWebviewClick; + /** + * 高度。可以有两种选择:single_row与double_row。当为single_row时,高度为106px(如果隐藏标题则为147px)。 + * 当为double_row时,高度固定为171px(如果隐藏标题则为212px)。默认值为double_row + */ + private String height; + /** + * 是否要隐藏展示了应用名称的标题部分,默认值为false。 + */ + private Boolean hideTitle; private List keyDataList; @@ -107,7 +115,7 @@ public String toUserDataString() { public String toBatchUserDataString() { JsonObject userDataObject = new JsonObject(); userDataObject.addProperty("agentid", this.agentId); - JsonArray useridList = WxGsonBuilder.create().toJsonTree(this.userIds).getAsJsonArray(); + JsonArray useridList = WxGsonBuilder.create().toJsonTree(this.useridList).getAsJsonArray(); userDataObject.add("userid_list", useridList); this.handleBatch(userDataObject); return userDataObject.toString(); @@ -160,9 +168,9 @@ private void handle(JsonObject templateObject) { webview.addProperty("url", this.url); webview.addProperty("jump_url", this.jumpUrl); webview.addProperty("pagepath", this.pagePath); - if (null != this.enableWebviewClick) { - webview.addProperty("enable_webview_click", this.enableWebviewClick); - } + webview.addProperty("enable_webview_click", this.enableWebviewClick); + webview.addProperty("height", this.height); + webview.addProperty("hide_title", this.hideTitle); templateObject.add("webview", webview); break; } @@ -228,9 +236,9 @@ private void handleBatch(JsonObject templateObject) { webview.addProperty("url", this.url); webview.addProperty("jump_url", this.jumpUrl); webview.addProperty("pagepath", this.pagePath); - if (null != this.enableWebviewClick) { - webview.addProperty("enable_webview_click", this.enableWebviewClick); - } + webview.addProperty("enable_webview_click", this.enableWebviewClick); + webview.addProperty("height", this.height); + webview.addProperty("hide_title", this.hideTitle); JsonObject dataObject = new JsonObject(); dataObject.addProperty("type", WxCpConsts.WorkBenchType.WEBVIEW); dataObject.add("webview", webview); From 373c1e65cbc3e1efcc3691728bacadd7fc7d95a7 Mon Sep 17 00:00:00 2001 From: jimmyjimmy-sw <57387749+jimmyjimmy-sw@users.noreply.github.com> Date: Mon, 7 Apr 2025 17:47:48 +0800 Subject: [PATCH 40/56] =?UTF-8?q?:bug:=20#3522=20=E3=80=90=E5=85=AC?= =?UTF-8?q?=E4=BC=97=E5=8F=B7=E3=80=91=E4=BF=AE=E5=A4=8DWxMpMapConfigImpl?= =?UTF-8?q?=E9=9D=99=E6=80=81=E5=B1=9E=E6=80=A7=E5=AD=98=E5=82=A8token?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=A4=9A=E4=B8=AA=E5=AE=9E=E4=BE=8B=E6=97=B6?= =?UTF-8?q?=E5=87=BA=E7=8E=B0token=E6=B2=A1=E6=9C=89=E9=9A=94=E7=A6=BB?= =?UTF-8?q?=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mp/config/impl/WxMpMapConfigImpl.java | 2 +- .../mp/api/impl/WxMpMapConfigImplTest.java | 58 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpMapConfigImplTest.java diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpMapConfigImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpMapConfigImpl.java index cd701d1ef..72e6e615f 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpMapConfigImpl.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/config/impl/WxMpMapConfigImpl.java @@ -15,7 +15,7 @@ public class WxMpMapConfigImpl extends WxMpDefaultConfigImpl { private static final long serialVersionUID = 5311395137835650104L; - private static final ConcurrentHashMap CONCURRENT_HASH_MAP = new ConcurrentHashMap<>(1); + private final ConcurrentHashMap CONCURRENT_HASH_MAP = new ConcurrentHashMap<>(1); private static final String MAP_KEY = "access_token"; diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpMapConfigImplTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpMapConfigImplTest.java new file mode 100644 index 000000000..167c0e019 --- /dev/null +++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpMapConfigImplTest.java @@ -0,0 +1,58 @@ +package me.chanjar.weixin.mp.api.impl; + +import com.google.inject.Inject; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.api.test.ApiTestModule; +import me.chanjar.weixin.mp.config.impl.WxMpMapConfigImpl; +import me.chanjar.weixin.mp.util.WxMpConfigStorageHolder; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + +/** + * 测试 ConcurrentHashMap 保存配置信息 + * @author jimmyjimmy-sw + */ +@Test +@Guice(modules = ApiTestModule.class) +public class WxMpMapConfigImplTest { + + @Inject + private WxMpService wxService; + + /** + * 测试多租户保存 WxMpMapConfigImpl 到 WxMpService,切换之后能获取到租户各自AppId对应的token + * @throws WxErrorException + */ + @Test + public void testAppidSwitch() throws WxErrorException { + // 保存租户A的配置信息,并获取token + WxMpMapConfigImpl configAppA = new WxMpMapConfigImpl(); + String appidA = "APPID_A"; + configAppA.setAppId(appidA); + configAppA.setSecret("APP_SECRET_A"); + configAppA.useStableAccessToken(true); + String tokenA = "TOKEN_A"; + configAppA.updateAccessToken(tokenA,60 * 60 * 1); + wxService.addConfigStorage(appidA, configAppA); + WxMpConfigStorageHolder.set(appidA); + assertEquals(this.wxService.getAccessToken(),tokenA); + + // 保存租户B的配置信息,并获取token + WxMpMapConfigImpl configAppB = new WxMpMapConfigImpl(); + String appidB = "APPID_B"; + configAppB.setAppId(appidB); + configAppB.setSecret("APP_SECRET_B"); + configAppB.useStableAccessToken(true); + String tokenB = "TOKEN_B"; + configAppB.updateAccessToken(tokenB,60 * 60 * 1); + wxService.addConfigStorage(appidB, configAppB); + WxMpConfigStorageHolder.set(appidB); + assertEquals(this.wxService.getAccessToken(),tokenB); + + // 上下文切换到租户A 获取租户A的token + WxMpConfigStorageHolder.set(appidA); + assertEquals(this.wxService.getAccessToken(),tokenA); + } +} From 833ff706805770babca343f8f907608d3159fed8 Mon Sep 17 00:00:00 2001 From: zhangrongguang <123545250@qq.com> Date: Thu, 27 Mar 2025 18:07:27 +0800 Subject: [PATCH 41/56] =?UTF-8?q?=E3=80=90=E4=BC=81=E4=B8=9A=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E3=80=91=E6=8E=A5=E5=BE=85=E4=BA=BA=E5=91=98=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=BE=85=E4=BA=BA?= =?UTF-8?q?=E5=91=98/=E5=88=A0=E9=99=A4=E6=8E=A5=E5=BE=85=E4=BA=BA?= =?UTF-8?q?=E5=91=98=20=E5=A2=9E=E5=8A=A0=20department=5Fid=5Flist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chanjar/weixin/cp/api/WxCpKfService.java | 26 +++++++++ .../weixin/cp/api/impl/WxCpKfServiceImpl.java | 53 ++++++++++++++++--- 2 files changed, 72 insertions(+), 7 deletions(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpKfService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpKfService.java index 86b342f2f..5a53829dc 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpKfService.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpKfService.java @@ -75,6 +75,19 @@ public interface WxCpKfService { */ WxCpKfServicerOpResp addServicer(String openKfid, List userIdList) throws WxErrorException; + /** + * 接待人员管理 + * 添加指定客服账号的接待人员,每个客服账号目前最多可添加2000个接待人员,20个部门。 + * userid_list和department_id_list至少需要填其中一个 + * + * @param openKfid 客服帐号ID + * @param userIdList 接待人员userid列表。第三方应用填密文userid,即open_userid 可填充个数:1 ~ 100。超过100个需分批调用。 + * @param departmentIdList 接待人员部门id列表 可填充个数:0 ~ 20。 + * @return 添加客服账号结果 wx cp kf servicer op resp + * @throws WxErrorException 异常 + */ + WxCpKfServicerOpResp addServicer(String openKfid, List userIdList,List departmentIdList) throws WxErrorException; + /** * 接待人员管理 * 从客服帐号删除接待人员 @@ -86,6 +99,19 @@ public interface WxCpKfService { */ WxCpKfServicerOpResp delServicer(String openKfid, List userIdList) throws WxErrorException; + /** + * 接待人员管理 + * 从客服帐号删除接待人员 + * userid_list和department_id_list至少需要填其中一个 + * + * @param openKfid 客服帐号ID + * @param userIdList 接待人员userid列表。第三方应用填密文userid,即open_userid 可填充个数:1 ~ 100。超过100个需分批调用。 + * @param departmentIdList 接待人员部门id列表 可填充个数:0 ~ 100。超过100个需分批调用。 + * @return 删除客服账号结果 wx cp kf servicer op resp + * @throws WxErrorException 异常 + */ + WxCpKfServicerOpResp delServicer(String openKfid, List userIdList, List departmentIdList) throws WxErrorException; + /** * 接待人员管理 * 获取某个客服帐号的接待人员列表 diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpKfServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpKfServiceImpl.java index 29e84c516..be4f2a585 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpKfServiceImpl.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpKfServiceImpl.java @@ -70,23 +70,62 @@ public WxCpKfAccountLinkResp getAccountLink(WxCpKfAccountLink link) throws WxErr @Override public WxCpKfServicerOpResp addServicer(String openKfid, List userIdList) throws WxErrorException { - return servicerOp(openKfid, userIdList, SERVICER_ADD); + return servicerOp(openKfid, userIdList, null, SERVICER_ADD); + } + + @Override + public WxCpKfServicerOpResp addServicer(String openKfId, List userIdList, List departmentIdList) throws WxErrorException { + validateParameters(SERVICER_ADD, userIdList, departmentIdList); + return servicerOp(openKfId, userIdList, departmentIdList, SERVICER_ADD); } @Override public WxCpKfServicerOpResp delServicer(String openKfid, List userIdList) throws WxErrorException { - return servicerOp(openKfid, userIdList, SERVICER_DEL); + return servicerOp(openKfid, userIdList, null, SERVICER_DEL); } - private WxCpKfServicerOpResp servicerOp(String openKfid, List userIdList, String uri) throws WxErrorException { + @Override + public WxCpKfServicerOpResp delServicer(String openKfid, List userIdList, List departmentIdList) throws WxErrorException { + validateParameters(SERVICER_DEL, userIdList, departmentIdList); + return servicerOp(openKfid, userIdList, departmentIdList, SERVICER_DEL); + } + + private void validateParameters(String uri, List userIdList, List departmentIdList) { + if ((userIdList == null || userIdList.isEmpty()) && (departmentIdList == null || departmentIdList.isEmpty())) { + throw new IllegalArgumentException("userid_list和department_id_list至少需要填其中一个"); + } + if (SERVICER_DEL.equals(uri)) { + if (userIdList != null && userIdList.size() > 100) { + throw new IllegalArgumentException("可填充个数:0 ~ 100。超过100个需分批调用。"); + } + if (departmentIdList != null && departmentIdList.size() > 100) { + throw new IllegalArgumentException("可填充个数:0 ~ 100。超过100个需分批调用。"); + } + } else { + if (userIdList != null && userIdList.size() > 100) { + throw new IllegalArgumentException("可填充个数:0 ~ 100。超过100个需分批调用。"); + } + if (departmentIdList != null && departmentIdList.size() > 20) { + throw new IllegalArgumentException("可填充个数:0 ~ 20。"); + } + } + } + + private WxCpKfServicerOpResp servicerOp(String openKfid, List userIdList, List departmentIdList, String uri) throws WxErrorException { String url = cpService.getWxCpConfigStorage().getApiUrl(uri); JsonObject json = new JsonObject(); json.addProperty("open_kfid", openKfid); - JsonArray userIdArray = new JsonArray(); - userIdList.forEach(userIdArray::add); - json.add("userid_list", userIdArray); - + if (userIdList != null && !userIdList.isEmpty()) { + JsonArray userIdArray = new JsonArray(); + userIdList.forEach(userIdArray::add); + json.add("userid_list", userIdArray); + } + if (departmentIdList != null && !departmentIdList.isEmpty()) { + JsonArray departmentIdArray = new JsonArray(); + departmentIdList.forEach(departmentIdArray::add); + json.add("department_id_list", departmentIdArray); + } String responseContent = cpService.post(url, json.toString()); return WxCpKfServicerOpResp.fromJson(responseContent); } From 0423e6849ddfef9bfcf90b39118145f054d7b0da Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Tue, 8 Apr 2025 08:39:24 +0800 Subject: [PATCH 42/56] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.4.B?= =?UTF-8?q?=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- solon-plugins/pom.xml | 2 +- solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +- spring-boot-starters/pom.xml | 2 +- .../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +- .../wx-java-channel-spring-boot-starter/pom.xml | 2 +- .../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +- .../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +- .../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +- .../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +- weixin-graal/pom.xml | 2 +- weixin-java-channel/pom.xml | 2 +- weixin-java-common/pom.xml | 2 +- weixin-java-cp/pom.xml | 2 +- weixin-java-miniapp/pom.xml | 2 +- weixin-java-mp/pom.xml | 2 +- weixin-java-open/pom.xml | 2 +- weixin-java-pay/pom.xml | 2 +- weixin-java-qidian/pom.xml | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/pom.xml b/pom.xml index 2151c117a..5c00e66a7 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B pom WxJava - Weixin/Wechat Java SDK 微信开发Java SDK diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml index 8dbc6b43d..3bec9cb54 100644 --- a/solon-plugins/pom.xml +++ b/solon-plugins/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B pom wx-java-solon-plugins diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml index fc2796117..84c14a101 100644 --- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml index 83a00deac..6238a55e4 100644 --- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml @@ -3,7 +3,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml index 512cb41d4..742b86239 100644 --- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml index f147e36ee..b758ff8a5 100644 --- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml index b8387c3c0..52db2699b 100644 --- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml index 712e1abfb..fd8643699 100644 --- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml index 39df8cfef..4ba79c8a5 100644 --- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml index cd2bca716..bea895694 100644 --- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml index bbd6b39ab..80a5df100 100644 --- a/solon-plugins/wx-java-open-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml index 31698e010..4dabbe46b 100644 --- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml index 8a45c7284..23ad77ea1 100644 --- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml @@ -3,7 +3,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml index fbb85e686..7f185f9fe 100644 --- a/spring-boot-starters/pom.xml +++ b/spring-boot-starters/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B pom wx-java-spring-boot-starters diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml index 4018347e6..e7faca156 100644 --- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml index 7b9ae6ee2..360c71d1a 100644 --- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml @@ -3,7 +3,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml index 03cb191fe..a32306110 100644 --- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml index 8de92d3ee..37b185228 100644 --- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml index 886cf8f88..5736c9dec 100644 --- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml index a2f3aa742..41f449da3 100644 --- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml index 3f3ecc50d..11680de01 100644 --- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml index ab6d89e6f..20a527eba 100644 --- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml index cdb43685f..95d3a9941 100644 --- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml index 1aa1dc6f6..9a415ef12 100644 --- a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml index c38a1d350..795cfcbe7 100644 --- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml @@ -3,7 +3,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml index ab9ec8c91..323df0d86 100644 --- a/weixin-graal/pom.xml +++ b/weixin-graal/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B weixin-graal diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml index 76be718a4..3264a2fe9 100644 --- a/weixin-java-channel/pom.xml +++ b/weixin-java-channel/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B weixin-java-channel diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml index 88e1b2c3f..d45cc46d4 100644 --- a/weixin-java-common/pom.xml +++ b/weixin-java-common/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B weixin-java-common diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml index 95d067244..23cdd4d22 100644 --- a/weixin-java-cp/pom.xml +++ b/weixin-java-cp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B weixin-java-cp diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml index 500add0e4..3c5c3fd95 100644 --- a/weixin-java-miniapp/pom.xml +++ b/weixin-java-miniapp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B weixin-java-miniapp diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml index dde82cf5d..0b8adf038 100644 --- a/weixin-java-mp/pom.xml +++ b/weixin-java-mp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B weixin-java-mp diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml index e94059131..d09746719 100644 --- a/weixin-java-open/pom.xml +++ b/weixin-java-open/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B weixin-java-open diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml index f66456aa4..4525620d7 100644 --- a/weixin-java-pay/pom.xml +++ b/weixin-java-pay/pom.xml @@ -5,7 +5,7 @@ com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B 4.0.0 diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml index 4e96a904b..f7f0d9ac6 100644 --- a/weixin-java-qidian/pom.xml +++ b/weixin-java-qidian/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.3.B + 4.7.4.B weixin-java-qidian From 89280abd004b3691a53003bca9c73675c9c1c956 Mon Sep 17 00:00:00 2001 From: Holy <34299400+holylcd@users.noreply.github.com> Date: Mon, 14 Apr 2025 11:32:34 +0800 Subject: [PATCH 43/56] =?UTF-8?q?:art:=20=20#3547=E3=80=90=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E5=99=A8=E6=9C=AA=E6=AD=A3=E7=A1=AE=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=AF=BC=E8=87=B4=E7=9A=84v3=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=9E=84=E9=80=A0=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wxpay/config/VerifierBuilder.java | 131 ++++++++++++++++++ .../binarywang/wxpay/config/WxPayConfig.java | 28 ++-- 2 files changed, 139 insertions(+), 20 deletions(-) create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/VerifierBuilder.java diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/VerifierBuilder.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/VerifierBuilder.java new file mode 100644 index 000000000..c7bc14f52 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/VerifierBuilder.java @@ -0,0 +1,131 @@ +package com.github.binarywang.wxpay.config; + +import com.github.binarywang.wxpay.exception.WxPayException; +import com.github.binarywang.wxpay.v3.auth.*; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + +import java.nio.charset.StandardCharsets; +import java.security.PrivateKey; +import java.security.PublicKey; + +/** + * 验证器构建. + * + * @author holy + */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) +class VerifierBuilder { + /** + * 构建验证器. + *

+ * 场景 + *

+   *   1. 老商户号,只有平台证书,未开通公钥 (已验证)
+   *   2. 新商户号,被强制开通公钥,没有平台证书 (已验证)
+   *   3. 老商户号,有平台证书,主动开通公钥 (未验证,具备条件的朋友,可以帮忙验证下)
+   *   ...
+   * 
+ * + * @param certSerialNo c + * @param mchId m + * @param apiV3Key a + * @param merchantPrivateKey m + * @param wxPayHttpProxy w + * @param certAutoUpdateTime c + * @param payBaseUrl p + * @param publicKeyId p + * @param publicKey p + * @return v + * @throws WxPayException e + */ + @SuppressWarnings("java:S107") + static Verifier build( + // 平台证书 - 依赖参数 + String certSerialNo, + String mchId, + String apiV3Key, + PrivateKey merchantPrivateKey, + WxPayHttpProxy wxPayHttpProxy, + int certAutoUpdateTime, + String payBaseUrl, + // 公钥 - 依赖参数 + String publicKeyId, + PublicKey publicKey + ) throws WxPayException { + Verifier certificatesVerifier = null; + Exception ex = null; + + // 构建平台证书验证器 + // (沿用旧逻辑)优先构建平台证书验证器,因为公钥验证器需要平台证书验证器 (见以下 .setOtherVerifier ) + // 新商户号默认无平台证书,已确认无法构建平台证书验证器,会抛出异常;老商户号,有平台证书主动开通公钥的情况,待具备条件的朋友验证 + // 建议公钥模式稳定后,优先构建公钥验证器,以免每次都尝试构建平台证书验证器,且失败 {@link com.github.binarywang.wxpay.v3.auth.PublicCertificateVerifier.verify} + if (merchantPrivateKey != null && StringUtils.isNoneBlank(certSerialNo, apiV3Key)) { + try { + certificatesVerifier = getCertificatesVerifier( + certSerialNo, mchId, apiV3Key, merchantPrivateKey, wxPayHttpProxy, certAutoUpdateTime, payBaseUrl + ); + } catch (Exception e) { + ex = e; + } + } + + // 构建公钥验证器 + if (publicKey != null && StringUtils.isNotBlank(publicKeyId)) { + try { + certificatesVerifier = getPublicCertVerifier(publicKeyId, publicKey, certificatesVerifier); + } catch (Exception e) { + ex = e; + } + } + if (certificatesVerifier != null) { + return certificatesVerifier; + } + + // 有异常时抛出 + if (ex != null) { + throw new WxPayException(ex.getMessage(), ex); + } + + // 没有证书验证器时。不确定是否抛出异常,沿用之前逻辑,返回 null + return null; + } + + /** + * 获取证书验证器. + * + * @param certSerialNo certSerialNo + * @param mchId mchId + * @param apiV3Key apiV3Key + * @param merchantPrivateKey merchantPrivateKey + * @param wxPayHttpProxy wxPayHttpProxy + * @param certAutoUpdateTime certAutoUpdateTime + * @param payBaseUrl payBaseUrl + * @return verifier + */ + private static AutoUpdateCertificatesVerifier getCertificatesVerifier( + String certSerialNo, String mchId, String apiV3Key, PrivateKey merchantPrivateKey, + WxPayHttpProxy wxPayHttpProxy, int certAutoUpdateTime, String payBaseUrl + ) { + return new AutoUpdateCertificatesVerifier( + new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)), + apiV3Key.getBytes(StandardCharsets.UTF_8), certAutoUpdateTime, + payBaseUrl, wxPayHttpProxy); + } + + /** + * 获取公钥验证器. + * + * @param publicKeyId id + * @param publicKey key + * @param certificatesVerifier verifier + * @return verifier + */ + private static Verifier getPublicCertVerifier(String publicKeyId, PublicKey publicKey, Verifier certificatesVerifier) { + Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId); + publicCertificatesVerifier.setOtherVerifier(certificatesVerifier); + certificatesVerifier = publicCertificatesVerifier; + return certificatesVerifier; + } +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java index 7a14ea152..43f41e963 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java @@ -4,7 +4,8 @@ import com.github.binarywang.wxpay.util.HttpProxyUtils; import com.github.binarywang.wxpay.util.ResourcesUtils; import com.github.binarywang.wxpay.v3.WxPayV3HttpClientBuilder; -import com.github.binarywang.wxpay.v3.auth.*; +import com.github.binarywang.wxpay.v3.auth.Verifier; +import com.github.binarywang.wxpay.v3.auth.WxPayValidator; import com.github.binarywang.wxpay.v3.util.PemUtils; import lombok.Data; import lombok.EqualsAndHashCode; @@ -19,7 +20,6 @@ import javax.net.ssl.SSLContext; import java.io.*; import java.net.URL; -import java.nio.charset.StandardCharsets; import java.security.KeyStore; import java.security.PrivateKey; import java.security.PublicKey; @@ -320,7 +320,12 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException { //构造Http Proxy正向代理 WxPayHttpProxy wxPayHttpProxy = getWxPayHttpProxy(); - Verifier certificatesVerifier = getVerifier(merchantPrivateKey, wxPayHttpProxy, publicKey); + // 构造证书验签器 + Verifier certificatesVerifier = VerifierBuilder.build( + this.getCertSerialNo(), this.getMchId(), this.getApiV3Key(), merchantPrivateKey, wxPayHttpProxy, + this.getCertAutoUpdateTime(), this.getPayBaseUrl(), + this.getPublicKeyId(), publicKey + ); WxPayV3HttpClientBuilder wxPayV3HttpClientBuilder = WxPayV3HttpClientBuilder.create() .withMerchant(mchId, certSerialNo, merchantPrivateKey) @@ -346,23 +351,6 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException { } } - private Verifier getVerifier(PrivateKey merchantPrivateKey, WxPayHttpProxy wxPayHttpProxy, PublicKey publicKey) { - Verifier certificatesVerifier = null; - // 如果配置了平台证书,则初始化验证器以备v2版本接口验签(公钥灰度实现) - if (this.getPrivateCertPath() != null && this.getPrivateKeyPath() != null) { - certificatesVerifier = new AutoUpdateCertificatesVerifier( - new WxPayCredentials(mchId, new PrivateKeySigner(certSerialNo, merchantPrivateKey)), - this.getApiV3Key().getBytes(StandardCharsets.UTF_8), this.getCertAutoUpdateTime(), - this.getPayBaseUrl(), wxPayHttpProxy); - } - if (publicKey != null) { - Verifier publicCertificatesVerifier = new PublicCertificateVerifier(publicKey, publicKeyId); - publicCertificatesVerifier.setOtherVerifier(certificatesVerifier); - certificatesVerifier = publicCertificatesVerifier; - } - return certificatesVerifier; - } - /** * 初始化一个WxPayHttpProxy对象 * From e16e0e93735884472300c7e77df63e4d586ec11d Mon Sep 17 00:00:00 2001 From: HerveyHall Date: Tue, 15 Apr 2025 15:14:12 +0800 Subject: [PATCH 44/56] =?UTF-8?q?:art:=20#3548=E3=80=90=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91=E4=BF=AE=E5=A4=8D=E5=85=AC=E9=92=A5?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8BV3=E6=8E=A5=E5=8F=A3=E6=9C=AA?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEWechatpay-Serial=E8=AF=B7=E6=B1=82=E5=A4=B4?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E9=AA=8C=E7=AD=BE=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../binarywang/wxpay/config/WxPayConfig.java | 5 +++ .../service/impl/BaseWxPayServiceImpl.java | 34 +++++++++---------- .../impl/WxPayServiceApacheHttpImpl.java | 3 ++ 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java index 43f41e963..2cfec2bc1 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java @@ -227,6 +227,11 @@ public class WxPayConfig { */ private Verifier verifier; + /** + * 是否将全部v3接口的请求都添加Wechatpay-Serial请求头,默认不添加 + */ + private boolean strictlyNeedWechatPaySerial = false; + /** * 返回所设置的微信支付接口请求地址域名. * diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java index 05d1f8c22..530609a7d 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java @@ -251,7 +251,7 @@ public WxPayRefundResult refundV2(WxPayRefundRequest request) throws WxPayExcept @Override public WxPayRefundV3Result refundV3(WxPayRefundV3Request request) throws WxPayException { String url = String.format("%s/v3/refund/domestic/refunds", this.getPayBaseUrl()); - String response = this.postV3(url, GSON.toJson(request)); + String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(response, WxPayRefundV3Result.class); } @@ -294,21 +294,21 @@ public WxPayRefundQueryResult refundQueryV2(WxPayRefundQueryRequest request) thr @Override public WxPayRefundQueryV3Result refundQueryV3(String outRefundNo) throws WxPayException { String url = String.format("%s/v3/refund/domestic/refunds/%s", this.getPayBaseUrl(), outRefundNo); - String response = this.getV3(url); + String response = this.getV3WithWechatPaySerial(url); return GSON.fromJson(response, WxPayRefundQueryV3Result.class); } @Override public WxPayRefundQueryV3Result refundQueryV3(WxPayRefundQueryV3Request request) throws WxPayException { String url = String.format("%s/v3/refund/domestic/refunds/%s", this.getPayBaseUrl(), request.getOutRefundNo()); - String response = this.getV3(url); + String response = this.getV3WithWechatPaySerial(url); return GSON.fromJson(response, WxPayRefundQueryV3Result.class); } @Override public WxPayRefundQueryV3Result refundPartnerQueryV3(WxPayRefundQueryV3Request request) throws WxPayException { String url = String.format("%s/v3/refund/domestic/refunds/%s?sub_mchid=%s", this.getPayBaseUrl(), request.getOutRefundNo(), request.getSubMchid()); - String response = this.getV3(url); + String response = this.getV3WithWechatPaySerial(url); return GSON.fromJson(response, WxPayRefundQueryV3Result.class); } @@ -523,7 +523,7 @@ public WxPayOrderQueryV3Result queryOrderV3(WxPayOrderQueryV3Request request) th url = String.format("%s/v3/pay/transactions/id/%s", this.getPayBaseUrl(), request.getTransactionId()); } String query = String.format("?mchid=%s", request.getMchid()); - String response = this.getV3(url + query); + String response = this.getV3WithWechatPaySerial(url + query); return GSON.fromJson(response, WxPayOrderQueryV3Result.class); } @@ -548,14 +548,14 @@ public WxPayPartnerOrderQueryV3Result queryPartnerOrderV3(WxPayPartnerOrderQuery url = String.format("%s/v3/pay/partner/transactions/id/%s", this.getPayBaseUrl(), request.getTransactionId()); } String query = String.format("?sp_mchid=%s&sub_mchid=%s", request.getSpMchId(), request.getSubMchId()); - String response = this.getV3(url + query); + String response = this.getV3WithWechatPaySerial(url + query); return GSON.fromJson(response, WxPayPartnerOrderQueryV3Result.class); } @Override public CombineQueryResult queryCombine(String combineOutTradeNo) throws WxPayException { String url = String.format("%s/v3/combine-transactions/out-trade-no/%s", this.getPayBaseUrl(), combineOutTradeNo); - String response = this.getV3(url); + String response = this.getV3WithWechatPaySerial(url); return GSON.fromJson(response, CombineQueryResult.class); } @@ -609,7 +609,7 @@ public void closeOrderV3(WxPayOrderCloseV3Request request) throws WxPayException request.setMchid(this.getConfig().getMchId()); } String url = String.format("%s/v3/pay/transactions/out-trade-no/%s/close", this.getPayBaseUrl(), request.getOutTradeNo()); - this.postV3(url, GSON.toJson(request)); + this.postV3WithWechatpaySerial(url, GSON.toJson(request)); } @Override @@ -621,13 +621,13 @@ public void closePartnerOrderV3(WxPayPartnerOrderCloseV3Request request) throws request.setSubMchId(this.getConfig().getSubMchId()); } String url = String.format("%s/v3/pay/partner/transactions/out-trade-no/%s/close", this.getPayBaseUrl(), request.getOutTradeNo()); - this.postV3(url, GSON.toJson(request)); + this.postV3WithWechatpaySerial(url, GSON.toJson(request)); } @Override public void closeCombine(CombineCloseRequest request) throws WxPayException { String url = String.format("%s/v3/combine-transactions/out-trade-no/%s/close", this.getPayBaseUrl(), request.getCombineOutTradeNo()); - this.postV3(url, GSON.toJson(request)); + this.postV3WithWechatpaySerial(url, GSON.toJson(request)); } @Override @@ -771,7 +771,7 @@ public WxPayUnifiedOrderV3Result unifiedPartnerOrderV3(TradeTypeEnum tradeType, } String url = this.getPayBaseUrl() + tradeType.getBasePartnerUrl(); - String response = this.postV3(url, GSON.toJson(request)); + String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(response, WxPayUnifiedOrderV3Result.class); } @@ -788,7 +788,7 @@ public WxPayUnifiedOrderV3Result unifiedOrderV3(TradeTypeEnum tradeType, WxPayUn } String url = this.getPayBaseUrl() + tradeType.getPartnerUrl(); - String response = this.postV3(url, GSON.toJson(request)); + String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(response, WxPayUnifiedOrderV3Result.class); } @@ -801,7 +801,7 @@ public CombineTransactionsResult combine(TradeTypeEnum tradeType, CombineTransac request.setCombineMchid(this.getConfig().getMchId()); } String url = this.getPayBaseUrl() + tradeType.getCombineUrl(); - String response = this.postV3(url, GSON.toJson(request)); + String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(response, CombineTransactionsResult.class); } @@ -1114,7 +1114,7 @@ public WxPayApplyBillV3Result applyTradeBill(WxPayApplyTradeBillV3Request reques } else { url = String.format("%s/v3/bill/tradebill?bill_date=%s&bill_type=%s&tar_type=%s", this.getPayBaseUrl(), request.getBillDate(), request.getBillType(), request.getTarType()); } - String response = this.getV3(url); + String response = this.getV3WithWechatPaySerial(url); return GSON.fromJson(response, WxPayApplyBillV3Result.class); } @@ -1126,7 +1126,7 @@ public WxPayApplyBillV3Result applyFundFlowBill(WxPayApplyFundFlowBillV3Request } else { url = String.format("%s/v3/bill/fundflowbill?bill_date=%s&account_type=%s&tar_type=%s", this.getPayBaseUrl(), request.getBillDate(), request.getAccountType(), request.getTarType()); } - String response = this.getV3(url); + String response = this.getV3WithWechatPaySerial(url); return GSON.fromJson(response, WxPayApplyBillV3Result.class); } @@ -1155,7 +1155,7 @@ public WxPayCodepayResult codepay(WxPayCodepayRequest request) throws WxPayExcep request.setMchid(this.getConfig().getMchId()); } String url = String.format("%s/v3/pay/transactions/codepay", this.getPayBaseUrl()); - String body = this.postV3(url, GSON.toJson(request)); + String body = this.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(body, WxPayCodepayResult.class); } @@ -1181,7 +1181,7 @@ public WxPayOrderReverseV3Result reverseOrderV3(WxPayOrderReverseV3Request reque } // 拼接参数请求路径并发送 String url = String.format("%s/v3/pay/transactions/out-trade-no/%s/reverse", this.getPayBaseUrl(), request.getOutTradeNo()); - String response = this.postV3(url, GSON.toJson(request)); + String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request)); return GSON.fromJson(response, WxPayOrderReverseV3Result.class); } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java index d8ba95971..f57ff13d4 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java @@ -243,6 +243,9 @@ public String requestV3(String url, HttpRequestBase httpRequest) throws WxPayExc @Override public String getV3(String url) throws WxPayException { + if (this.getConfig().isStrictlyNeedWechatPaySerial()) { + return getV3WithWechatPaySerial(url); + } HttpGet httpGet = new HttpGet(url); httpGet.addHeader(ACCEPT, APPLICATION_JSON); httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON); From bb76db052d8e9dd7a8a2a4efc88a61b445691544 Mon Sep 17 00:00:00 2001 From: Henry Heng Date: Tue, 15 Apr 2025 19:32:54 +0800 Subject: [PATCH 45/56] =?UTF-8?q?:art:=20#3554=E3=80=90=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E3=80=91=E4=BF=AE=E5=A4=8D=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E8=8A=82=E7=82=B9=E8=8E=B7=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E7=94=A8=E6=88=B7ID=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java index 7193c7cf6..997a463f9 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java @@ -190,7 +190,7 @@ public static class Item implements Serializable { /** * 分支审批人userid */ - @XStreamAlias("ItemUserid") + @XStreamAlias("ItemUserId") @XStreamConverter(value = XStreamCDataConverter.class) private String itemUserId; From 3718b499a0f7f69ea432d78bc0065d4f627d598f Mon Sep 17 00:00:00 2001 From: Henry Heng Date: Wed, 16 Apr 2025 10:43:55 +0800 Subject: [PATCH 46/56] =?UTF-8?q?:art:=20#3554=E3=80=90=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E3=80=91=E4=BF=AE=E5=A4=8D=E5=AE=A1=E6=89=B9?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E8=8A=82=E7=82=B9=E8=8E=B7=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E7=94=A8=E6=88=B7ID=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java index 997a463f9..798a5c8b0 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlApprovalInfo.java @@ -118,7 +118,7 @@ public static class NotifyNode implements Serializable { /** * 抄送人userid */ - @XStreamAlias("ItemUserid") + @XStreamAlias("ItemUserId") @XStreamConverter(value = XStreamCDataConverter.class) private String itemUserId; From 59f5a99fda363cb426f90f50d714a5c3d3cbe3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E4=B8=9C?= Date: Mon, 21 Apr 2025 09:55:13 +0800 Subject: [PATCH 47/56] =?UTF-8?q?:new:=20=E6=B7=BB=E5=8A=A0wx-java-channel?= =?UTF-8?q?-solon-plugin=20README.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- solon-plugins/pom.xml | 2 +- .../wx-java-channel-solon-plugin/README.md | 92 +++++++++++++++++++ 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 solon-plugins/wx-java-channel-solon-plugin/README.md diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml index 3bec9cb54..8d14b4461 100644 --- a/solon-plugins/pom.xml +++ b/solon-plugins/pom.xml @@ -14,7 +14,7 @@ WxJava 各个模块的 Solon Plugin - 3.0.1 + 3.2.0 diff --git a/solon-plugins/wx-java-channel-solon-plugin/README.md b/solon-plugins/wx-java-channel-solon-plugin/README.md new file mode 100644 index 000000000..a7168a8ed --- /dev/null +++ b/solon-plugins/wx-java-channel-solon-plugin/README.md @@ -0,0 +1,92 @@ +# wx-java-channel-solon-plugin + +## 快速开始 +1. 引入依赖 + ```xml + + + com.github.binarywang + wx-java-channel-solon-plugin + ${version} + + + + + redis.clients + jedis + ${jedis.version} + + + + + org.redisson + redisson + ${redisson.version} + + + ``` +2. 添加配置(app.properties) + ```properties + # 视频号配置(必填) + ## 视频号小店的appId和secret + wx.channel.app-id=@appId + wx.channel.secret=@secret + # 视频号配置 选填 + ## 设置视频号小店消息服务器配置的token + wx.channel.token=@token + ## 设置视频号小店消息服务器配置的EncodingAESKey + wx.channel.aes-key= + ## 支持JSON或者XML格式,默认JSON + wx.channel.msg-data-format=JSON + ## 是否使用稳定版 Access Token + wx.channel.use-stable-access-token=false + + + # ConfigStorage 配置(选填) + ## 配置类型: memory(默认), jedis, redisson, redis_template + wx.channel.config-storage.type=memory + ## 相关redis前缀配置: wx:channel(默认) + wx.channel.config-storage.key-prefix=wx:channel + wx.channel.config-storage.redis.host=127.0.0.1 + wx.channel.config-storage.redis.port=6379 + wx.channel.config-storage.redis.password=123456 + + + # http 客户端配置(选填) + ## # http客户端类型: http_client(默认) + wx.channel.config-storage.http-client-type=http_client + wx.channel.config-storage.http-proxy-host= + wx.channel.config-storage.http-proxy-port= + wx.channel.config-storage.http-proxy-username= + wx.channel.config-storage.http-proxy-password= + ## 最大重试次数,默认:5 次,如果小于 0,则为 0 + wx.channel.config-storage.max-retry-times=5 + ## 重试时间间隔步进,默认:1000 毫秒,如果小于 0,则为 1000 + wx.channel.config-storage.retry-sleep-millis=1000 + ``` +3. 自动注入的类型 +- `WxChannelService` +- `WxChannelConfig` +4. 使用样例 + +```java +import me.chanjar.weixin.channel.api.WxChannelService; +import me.chanjar.weixin.channel.bean.shop.ShopInfoResponse; +import me.chanjar.weixin.channel.util.JsonUtils; +import me.chanjar.weixin.common.error.WxErrorException; +import org.noear.solon.annotation.Inject; + +@Component +public class DemoService { + @Inject + private WxChannelService wxChannelService; + + public String getShopInfo() throws WxErrorException { + // 获取店铺基本信息 + ShopInfoResponse response = wxChannelService.getBasicService().getShopInfo(); + // 此处为演示,如果要返回response的结果,建议自己封装一个VO,避免直接返回response + return JsonUtils.encode(response); + } +} +``` + From 6a4ed91ae2bedee4c65edf749f2de6cfd4b2a847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=8B=E4=BA=BAA?= <2330172120@qq.com> Date: Mon, 21 Apr 2025 09:58:51 +0800 Subject: [PATCH 48/56] =?UTF-8?q?:art:=20#3558=20=E3=80=90=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E4=BF=AE=E5=A4=8D=E4=BC=9A?= =?UTF-8?q?=E8=AF=9D=E5=86=85=E5=AE=B9=E5=AD=98=E6=A1=A3=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A7=A3=E5=AF=86=E7=9A=84=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=E6=96=87=E4=BB=B6=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E5=87=BA=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java index 8a9d2130d..c88cb7b9b 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/msgaudit/WxCpChatModel.java @@ -603,7 +603,7 @@ public static class File implements Serializable { private String sdkFileId; @SerializedName("filesize") - private Integer fileSize; + private Long fileSize; /** * From json file. From ddfbee25e139e7f2f50a6205803b777b1ee53ea5 Mon Sep 17 00:00:00 2001 From: giveup Date: Mon, 21 Apr 2025 10:00:39 +0800 Subject: [PATCH 49/56] =?UTF-8?q?:bug:=20#3557=20=E3=80=90=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E4=BF=AE=E5=A4=8DagentId?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B=E4=B8=8D=E4=B8=80=E8=87=B4?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84WxCpTpMessageRouterRule.test()?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=8C=B9=E9=85=8D=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java | 2 +- .../me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessageTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java index 8b6b0689a..e26b152da 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessage.java @@ -403,7 +403,7 @@ public class WxCpTpXmlMessage implements Serializable { * The Agent id. */ @XStreamAlias("AgentID") - protected String agentID; + protected Integer agentID; /** * The Pic url. diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessageTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessageTest.java index d6cd82763..28246cf00 100644 --- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessageTest.java +++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpTpXmlMessageTest.java @@ -152,7 +152,7 @@ public void enterAppTest() { assertEquals(wxXmlMessage.getCreateTime(), Long.valueOf(1408091189)); assertEquals(wxXmlMessage.getEvent(), "enter_agent"); assertEquals(wxXmlMessage.getEventKey(), ""); - assertEquals(wxXmlMessage.getAgentID(), Integer.valueOf(1)); + assertEquals(wxXmlMessage.getAgentID(), 1); } /** From cbb3b24577b5d2754f96d563dfa8901fca66bc23 Mon Sep 17 00:00:00 2001 From: SynchPj <46849861+SynchPj@users.noreply.github.com> Date: Tue, 22 Apr 2025 11:08:50 +0800 Subject: [PATCH 50/56] =?UTF-8?q?:art:=20#3553=E3=80=90=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91v3=E8=AF=B7=E6=B1=82=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E5=8A=A0=E4=B8=8AWechatpay-Serial=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../binarywang/wxpay/config/WxPayConfig.java | 4 ++-- .../impl/WxPayServiceApacheHttpImpl.java | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java index 2cfec2bc1..75db10a07 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/config/WxPayConfig.java @@ -300,13 +300,13 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException { this.certSerialNo = certificate.getSerialNumber().toString(16).toUpperCase(); } try { - if (merchantPrivateKey == null) { + if (merchantPrivateKey == null && StringUtils.isNotBlank(this.getPrivateKeyPath())) { try (InputStream keyInputStream = this.loadConfigInputStream(this.getPrivateKeyString(), this.getPrivateKeyPath(), this.privateKeyContent, "privateKeyPath")) { merchantPrivateKey = PemUtils.loadPrivateKey(keyInputStream); } } - if (certificate == null && StringUtils.isBlank(this.getCertSerialNo())) { + if (certificate == null && StringUtils.isBlank(this.getCertSerialNo()) && StringUtils.isNotBlank(this.getPrivateCertPath())) { try (InputStream certInputStream = this.loadConfigInputStream(this.getPrivateCertString(), this.getPrivateCertPath(), this.privateCertContent, "privateCertPath")) { certificate = PemUtils.loadCertificate(certInputStream); diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java index f57ff13d4..f273fe1f9 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java @@ -44,6 +44,7 @@ public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl { private static final String ACCEPT = "Accept"; private static final String CONTENT_TYPE = "Content-Type"; private static final String APPLICATION_JSON = "application/json"; + private static final String WECHATPAY_SERIAL = "Wechatpay-Serial"; @Override public byte[] postForBytes(String url, String requestStr, boolean useKey) throws WxPayException { @@ -101,7 +102,7 @@ public String postV3(String url, String requestStr) throws WxPayException { httpPost.addHeader(ACCEPT, APPLICATION_JSON); httpPost.addHeader(CONTENT_TYPE, APPLICATION_JSON); String serialNumber = getWechatpaySerial(getConfig()); - httpPost.addHeader("Wechatpay-Serial", serialNumber); + httpPost.addHeader(WECHATPAY_SERIAL, serialNumber); try (CloseableHttpResponse response = httpClient.execute(httpPost)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); @@ -133,6 +134,8 @@ public String postV3(String url, String requestStr) throws WxPayException { public String patchV3(String url, String requestStr) throws WxPayException { CloseableHttpClient httpClient = this.createApiV3HttpClient(); HttpPatch httpPatch = new HttpPatch(url); + String serialNumber = getWechatpaySerial(getConfig()); + httpPatch.addHeader(WECHATPAY_SERIAL, serialNumber); httpPatch.setEntity(this.createEntry(requestStr)); httpPatch.setConfig(RequestConfig.custom() @@ -204,6 +207,8 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx @Override public String postV3(String url, HttpPost httpPost) throws WxPayException { + String serialNumber = getWechatpaySerial(getConfig()); + httpPost.addHeader(WECHATPAY_SERIAL, serialNumber); return this.requestV3(url, httpPost); } @@ -249,6 +254,8 @@ public String getV3(String url) throws WxPayException { HttpGet httpGet = new HttpGet(url); httpGet.addHeader(ACCEPT, APPLICATION_JSON); httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON); + String serialNumber = getWechatpaySerial(getConfig()); + httpGet.addHeader(WECHATPAY_SERIAL, serialNumber); return this.requestV3(url, httpGet); } @@ -258,7 +265,7 @@ public String getV3WithWechatPaySerial(String url) throws WxPayException { httpGet.addHeader(ACCEPT, APPLICATION_JSON); httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON); String serialNumber = getWechatpaySerial(getConfig()); - httpGet.addHeader("Wechatpay-Serial", serialNumber); + httpGet.addHeader(WECHATPAY_SERIAL, serialNumber); return this.requestV3(url, httpGet); } @@ -267,6 +274,8 @@ public InputStream downloadV3(String url) throws WxPayException { CloseableHttpClient httpClient = this.createApiV3HttpClient(); HttpGet httpGet = new WxPayV3DownloadHttpGet(url); httpGet.addHeader(ACCEPT, ContentType.WILDCARD.getMimeType()); + String serialNumber = getWechatpaySerial(getConfig()); + httpGet.addHeader(WECHATPAY_SERIAL, serialNumber); try (CloseableHttpResponse response = httpClient.execute(httpGet)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); @@ -298,6 +307,8 @@ public String putV3(String url, String requestStr) throws WxPayException { httpPut.setEntity(entity); httpPut.addHeader(ACCEPT, APPLICATION_JSON); httpPut.addHeader(CONTENT_TYPE, APPLICATION_JSON); + String serialNumber = getWechatpaySerial(getConfig()); + httpPut.addHeader(WECHATPAY_SERIAL, serialNumber); return requestV3(url, httpPut); } @@ -306,6 +317,8 @@ public String deleteV3(String url) throws WxPayException { HttpDelete httpDelete = new HttpDelete(url); httpDelete.addHeader(ACCEPT, APPLICATION_JSON); httpDelete.addHeader(CONTENT_TYPE, APPLICATION_JSON); + String serialNumber = getWechatpaySerial(getConfig()); + httpDelete.addHeader(WECHATPAY_SERIAL, serialNumber); return requestV3(url, httpDelete); } From 2279105fef5f1d9a722debd75f82e8c1923eb590 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Sat, 26 Apr 2025 11:18:56 +0800 Subject: [PATCH 51/56] =?UTF-8?q?:art=EF=BC=9A=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98=E8=AF=B7=E6=B1=82=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E6=8A=BD=E5=8F=96=E5=90=88=E5=B9=B6=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/BaseWxPayServiceImpl.java | 2 - .../impl/WxPayServiceApacheHttpImpl.java | 152 +++++++----------- .../impl/WxPayServiceJoddHttpImpl.java | 14 +- 3 files changed, 65 insertions(+), 103 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java index 530609a7d..c5bab0126 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java @@ -64,8 +64,6 @@ public abstract class BaseWxPayServiceImpl implements WxPayService { private static final Gson GSON = new GsonBuilder().create(); - final Logger log = LoggerFactory.getLogger(this.getClass()); - static ThreadLocal wxApiData = new ThreadLocal<>(); diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java index f273fe1f9..e40c92a19 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java @@ -6,6 +6,7 @@ import com.github.binarywang.wxpay.v3.WxPayV3DownloadHttpGet; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.util.json.GsonParser; import org.apache.commons.lang3.StringUtils; import org.apache.http.*; @@ -39,12 +40,13 @@ * * @author Binary Wang */ +@Slf4j public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl { private static final String ACCEPT = "Accept"; private static final String CONTENT_TYPE = "Content-Type"; private static final String APPLICATION_JSON = "application/json"; - private static final String WECHATPAY_SERIAL = "Wechatpay-Serial"; + private static final String WECHAT_PAY_SERIAL = "Wechatpay-Serial"; @Override public byte[] postForBytes(String url, String requestStr, boolean useKey) throws WxPayException { @@ -55,7 +57,7 @@ public byte[] postForBytes(String url, String requestStr, boolean useKey) throws try (CloseableHttpResponse response = httpClient.execute(httpPost)) { final byte[] bytes = EntityUtils.toByteArray(response.getEntity()); final String responseData = Base64.getEncoder().encodeToString(bytes); - this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据(Base64编码后)】:{}", url, requestStr, responseData); + this.logRequestAndResponse(url, requestStr, responseData); wxApiData.set(new WxPayApiData(url, requestStr, responseData, null)); return bytes; } @@ -63,7 +65,7 @@ public byte[] postForBytes(String url, String requestStr, boolean useKey) throws httpPost.releaseConnection(); } } catch (Exception e) { - this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); + this.logError( url, requestStr, e); wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage())); throw new WxPayException(e.getMessage(), e); } @@ -77,7 +79,7 @@ public String post(String url, String requestStr, boolean useKey) throws WxPayEx try (CloseableHttpClient httpClient = httpClientBuilder.build()) { try (CloseableHttpResponse response = httpClient.execute(httpPost)) { String responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); - this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString); + this.logRequestAndResponse(url, requestStr, responseString); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, responseString, null)); } @@ -87,7 +89,7 @@ public String post(String url, String requestStr, boolean useKey) throws WxPayEx httpPost.releaseConnection(); } } catch (Exception e) { - this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); + this.logError(url, requestStr, e); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage())); } @@ -97,13 +99,14 @@ public String post(String url, String requestStr, boolean useKey) throws WxPayEx @Override public String postV3(String url, String requestStr) throws WxPayException { - CloseableHttpClient httpClient = this.createApiV3HttpClient(); HttpPost httpPost = this.createHttpPost(url, requestStr); - httpPost.addHeader(ACCEPT, APPLICATION_JSON); - httpPost.addHeader(CONTENT_TYPE, APPLICATION_JSON); - String serialNumber = getWechatpaySerial(getConfig()); - httpPost.addHeader(WECHATPAY_SERIAL, serialNumber); - try (CloseableHttpResponse response = httpClient.execute(httpPost)) { + this.configureRequest(httpPost); + return this.requestV3(url, requestStr, httpPost); + } + + private String requestV3(String url, String requestStr, HttpRequestBase httpRequestBase) throws WxPayException { + try (CloseableHttpClient httpClient = this.createApiV3HttpClient(); + CloseableHttpResponse response = httpClient.execute(httpRequestBase)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); //post方法有可能会没有返回值的情况 @@ -113,7 +116,7 @@ public String postV3(String url, String requestStr) throws WxPayException { } if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) { - this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString); + this.logRequestAndResponse(url, requestStr, responseString); return responseString; } @@ -121,65 +124,26 @@ public String postV3(String url, String requestStr) throws WxPayException { JsonObject jsonObject = GsonParser.parse(responseString); throw convertException(jsonObject); } catch (Exception e) { - this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); + this.logError(url, requestStr, e); throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); } finally { - httpPost.releaseConnection(); + httpRequestBase.releaseConnection(); } - - } @Override public String patchV3(String url, String requestStr) throws WxPayException { - CloseableHttpClient httpClient = this.createApiV3HttpClient(); HttpPatch httpPatch = new HttpPatch(url); - String serialNumber = getWechatpaySerial(getConfig()); - httpPatch.addHeader(WECHATPAY_SERIAL, serialNumber); httpPatch.setEntity(this.createEntry(requestStr)); - - httpPatch.setConfig(RequestConfig.custom() - .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout()) - .setConnectTimeout(this.getConfig().getHttpConnectionTimeout()) - .setSocketTimeout(this.getConfig().getHttpTimeout()) - .build()); - - httpPatch.addHeader(ACCEPT, APPLICATION_JSON); - httpPatch.addHeader(CONTENT_TYPE, APPLICATION_JSON); - try (CloseableHttpResponse response = httpClient.execute(httpPatch)) { - //v3已经改为通过状态码判断200 204 成功 - int statusCode = response.getStatusLine().getStatusCode(); - //post方法有可能会没有返回值的情况 - String responseString = null; - if (response.getEntity() != null) { - responseString = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); - } - - if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) { - this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString); - return responseString; - } - - //有错误提示信息返回 - JsonObject jsonObject = GsonParser.parse(responseString); - throw convertException(jsonObject); - } catch (Exception e) { - this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); - throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); - } finally { - httpPatch.releaseConnection(); - } + return this.requestV3(url, requestStr, httpPatch); } @Override public String postV3WithWechatpaySerial(String url, String requestStr) throws WxPayException { - CloseableHttpClient httpClient = this.createApiV3HttpClient(); HttpPost httpPost = this.createHttpPost(url, requestStr); - httpPost.addHeader(ACCEPT, APPLICATION_JSON); - httpPost.addHeader(CONTENT_TYPE, APPLICATION_JSON); - String serialNumber = getWechatpaySerial(getConfig()); - httpPost.addHeader("Wechatpay-Serial", serialNumber); - try (CloseableHttpResponse response = httpClient.execute(httpPost)) { + this.configureRequest(httpPost); + try (CloseableHttpClient httpClient = this.createApiV3HttpClient(); + CloseableHttpResponse response = httpClient.execute(httpPost)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); String responseString = "{}"; @@ -189,7 +153,7 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx } if (HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) { - this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString); + this.logRequestAndResponse(url, requestStr, responseString); return responseString; } @@ -197,8 +161,7 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx JsonObject jsonObject = GsonParser.parse(responseString); throw convertException(jsonObject); } catch (Exception e) { - this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); - e.printStackTrace(); + this.logError(url, requestStr, e); throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); } finally { httpPost.releaseConnection(); @@ -207,21 +170,17 @@ public String postV3WithWechatpaySerial(String url, String requestStr) throws Wx @Override public String postV3(String url, HttpPost httpPost) throws WxPayException { - String serialNumber = getWechatpaySerial(getConfig()); - httpPost.addHeader(WECHATPAY_SERIAL, serialNumber); + String serialNumber = getWechatPaySerial(getConfig()); + httpPost.addHeader(WECHAT_PAY_SERIAL, serialNumber); return this.requestV3(url, httpPost); } @Override public String requestV3(String url, HttpRequestBase httpRequest) throws WxPayException { - httpRequest.setConfig(RequestConfig.custom() - .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout()) - .setConnectTimeout(this.getConfig().getHttpConnectionTimeout()) - .setSocketTimeout(this.getConfig().getHttpTimeout()) - .build()); + this.configureRequest(httpRequest); - CloseableHttpClient httpClient = this.createApiV3HttpClient(); - try (CloseableHttpResponse response = httpClient.execute(httpRequest)) { + try (CloseableHttpClient httpClient = this.createApiV3HttpClient(); + CloseableHttpResponse response = httpClient.execute(httpRequest)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); //post方法有可能会没有返回值的情况 @@ -252,38 +211,30 @@ public String getV3(String url) throws WxPayException { return getV3WithWechatPaySerial(url); } HttpGet httpGet = new HttpGet(url); - httpGet.addHeader(ACCEPT, APPLICATION_JSON); - httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON); - String serialNumber = getWechatpaySerial(getConfig()); - httpGet.addHeader(WECHATPAY_SERIAL, serialNumber); return this.requestV3(url, httpGet); } @Override public String getV3WithWechatPaySerial(String url) throws WxPayException { HttpGet httpGet = new HttpGet(url); - httpGet.addHeader(ACCEPT, APPLICATION_JSON); - httpGet.addHeader(CONTENT_TYPE, APPLICATION_JSON); - String serialNumber = getWechatpaySerial(getConfig()); - httpGet.addHeader(WECHATPAY_SERIAL, serialNumber); return this.requestV3(url, httpGet); } @Override public InputStream downloadV3(String url) throws WxPayException { - CloseableHttpClient httpClient = this.createApiV3HttpClient(); HttpGet httpGet = new WxPayV3DownloadHttpGet(url); httpGet.addHeader(ACCEPT, ContentType.WILDCARD.getMimeType()); - String serialNumber = getWechatpaySerial(getConfig()); - httpGet.addHeader(WECHATPAY_SERIAL, serialNumber); - try (CloseableHttpResponse response = httpClient.execute(httpGet)) { + String serialNumber = getWechatPaySerial(getConfig()); + httpGet.addHeader(WECHAT_PAY_SERIAL, serialNumber); + try (CloseableHttpClient httpClient = this.createApiV3HttpClient(); + CloseableHttpResponse response = httpClient.execute(httpGet)) { //v3已经改为通过状态码判断200 204 成功 int statusCode = response.getStatusLine().getStatusCode(); Header contentType = response.getFirstHeader(HttpHeaders.CONTENT_TYPE); boolean isJsonContentType = Objects.nonNull(contentType) && ContentType.APPLICATION_JSON.getMimeType() .equals(ContentType.parse(String.valueOf(contentType.getValue())).getMimeType()); if ((HttpStatus.SC_OK == statusCode || HttpStatus.SC_NO_CONTENT == statusCode) && !isJsonContentType) { - this.log.info("\n【请求地址】:{}\n", url); + log.info("\n【请求地址】:{}\n", url); return response.getEntity().getContent(); } @@ -293,7 +244,7 @@ public InputStream downloadV3(String url) throws WxPayException { JsonObject jsonObject = GsonParser.parse(responseString); throw convertException(jsonObject); } catch (Exception e) { - this.log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage()); + log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage()); throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e); } finally { httpGet.releaseConnection(); @@ -305,23 +256,28 @@ public String putV3(String url, String requestStr) throws WxPayException { HttpPut httpPut = new HttpPut(url); StringEntity entity = this.createEntry(requestStr); httpPut.setEntity(entity); - httpPut.addHeader(ACCEPT, APPLICATION_JSON); - httpPut.addHeader(CONTENT_TYPE, APPLICATION_JSON); - String serialNumber = getWechatpaySerial(getConfig()); - httpPut.addHeader(WECHATPAY_SERIAL, serialNumber); return requestV3(url, httpPut); } @Override public String deleteV3(String url) throws WxPayException { HttpDelete httpDelete = new HttpDelete(url); - httpDelete.addHeader(ACCEPT, APPLICATION_JSON); - httpDelete.addHeader(CONTENT_TYPE, APPLICATION_JSON); - String serialNumber = getWechatpaySerial(getConfig()); - httpDelete.addHeader(WECHATPAY_SERIAL, serialNumber); return requestV3(url, httpDelete); } + private void configureRequest(HttpRequestBase request) { + String serialNumber = getWechatPaySerial(getConfig()); + request.addHeader(ACCEPT, APPLICATION_JSON); + request.addHeader(CONTENT_TYPE, APPLICATION_JSON); + request.addHeader(WECHAT_PAY_SERIAL, serialNumber); + + request.setConfig(RequestConfig.custom() + .setConnectionRequestTimeout(this.getConfig().getHttpConnectionTimeout()) + .setConnectTimeout(this.getConfig().getHttpConnectionTimeout()) + .setSocketTimeout(this.getConfig().getHttpTimeout()) + .build()); + } + private CloseableHttpClient createApiV3HttpClient() throws WxPayException { CloseableHttpClient apiV3HttpClient = this.getConfig().getApiV3HttpClient(); if (null == apiV3HttpClient) { @@ -387,7 +343,6 @@ private void initSSLContext(HttpClientBuilder httpClientBuilder) throws WxPayExc new DefaultHostnameVerifier())); } - private WxPayException convertException(JsonObject jsonObject) { //todo 这里考虑使用新的适用于V3的异常 JsonElement codeElement = jsonObject.get("code"); @@ -401,13 +356,20 @@ private WxPayException convertException(JsonObject jsonObject) { /** * 兼容微信支付公钥模式 - * @param wxPayConfig - * @return */ - private String getWechatpaySerial(WxPayConfig wxPayConfig) { + private String getWechatPaySerial(WxPayConfig wxPayConfig) { if (StringUtils.isNotBlank(wxPayConfig.getPublicKeyId())) { return wxPayConfig.getPublicKeyId(); } + return wxPayConfig.getVerifier().getValidCertificate().getSerialNumber().toString(16).toUpperCase(); } + + private void logRequestAndResponse(String url, String requestStr, String responseStr) { + log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseStr); + } + + private void logError(String url, String requestStr, Exception e) { + log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); + } } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java index 5e6d23eac..7c2f1e82c 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java @@ -9,6 +9,7 @@ import jodd.http.ProxyInfo.ProxyType; import jodd.http.net.SSLSocketHttpConnectionProvider; import jodd.http.net.SocketHttpConnectionProvider; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; @@ -24,6 +25,7 @@ * * @author Binary Wang */ +@Slf4j public class WxPayServiceJoddHttpImpl extends BaseWxPayServiceImpl { @Override public byte[] postForBytes(String url, String requestStr, boolean useKey) throws WxPayException { @@ -31,13 +33,13 @@ public byte[] postForBytes(String url, String requestStr, boolean useKey) throws HttpRequest request = this.buildHttpRequest(url, requestStr, useKey); byte[] responseBytes = request.send().bodyBytes(); final String responseString = Base64.getEncoder().encodeToString(responseBytes); - this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据(Base64编码后)】:{}", url, requestStr, responseString); + log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据(Base64编码后)】:{}", url, requestStr, responseString); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, responseString, null)); } return responseBytes; } catch (Exception e) { - this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); + log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage())); throw new WxPayException(e.getMessage(), e); } @@ -49,13 +51,13 @@ public String post(String url, String requestStr, boolean useKey) throws WxPayEx HttpRequest request = this.buildHttpRequest(url, requestStr, useKey); String responseString = this.getResponseString(request.send()); - this.log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString); + log.info("\n【请求地址】:{}\n【请求数据】:{}\n【响应数据】:{}", url, requestStr, responseString); if (this.getConfig().isIfSaveApiData()) { wxApiData.set(new WxPayApiData(url, requestStr, responseString, null)); } return responseString; } catch (Exception e) { - this.log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); + log.error("\n【请求地址】:{}\n【请求数据】:{}\n【异常信息】:{}", url, requestStr, e.getMessage()); wxApiData.set(new WxPayApiData(url, requestStr, null, e.getMessage())); throw new WxPayException(e.getMessage(), e); } @@ -146,9 +148,9 @@ private HttpRequest buildHttpRequest(String url, String requestStr, boolean useK private String getResponseString(HttpResponse response) throws WxPayException { try { - this.log.debug("【微信服务器响应头信息】:\n{}", response.toString(false)); + log.debug("【微信服务器响应头信息】:\n{}", response.toString(false)); } catch (NullPointerException e) { - this.log.warn("HttpResponse.toString() 居然抛出空指针异常了", e); + log.warn("HttpResponse.toString() 居然抛出空指针异常了", e); } String responseString = response.bodyText(); From 2d8d1df00e52b84bab4e4adbc6e4ed947bd4c440 Mon Sep 17 00:00:00 2001 From: imyzt Date: Tue, 29 Apr 2025 11:29:09 +0800 Subject: [PATCH 52/56] =?UTF-8?q?:new:=20#3320=E3=80=90=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E3=80=91=E5=A2=9E=E5=8A=A0=E5=BC=82=E6=AD=A5?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=B8=B4=E6=97=B6=E7=B4=A0=E6=9D=90=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/cp/api/WxCpMediaService.java | 19 +++++ .../cp/api/impl/WxCpMediaServiceImpl.java | 28 ++++++- .../cp/bean/media/MediaUploadByUrlReq.java | 58 +++++++++++++ .../cp/bean/media/MediaUploadByUrlResult.java | 82 +++++++++++++++++++ .../cp/bean/message/WxCpXmlMessage.java | 7 ++ .../weixin/cp/constant/WxCpApiPathConsts.java | 6 ++ .../weixin/cp/constant/WxCpConsts.java | 5 ++ .../cp/api/impl/WxCpMediaServiceImplTest.java | 36 ++++++++ .../cp/bean/message/WxCpXmlMessageTest.java | 21 +++++ 9 files changed, 261 insertions(+), 1 deletion(-) create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlReq.java create mode 100644 weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlResult.java diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpMediaService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpMediaService.java index 82f6db917..e874b26f4 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpMediaService.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpMediaService.java @@ -2,6 +2,8 @@ import me.chanjar.weixin.common.bean.result.WxMediaUploadResult; import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlReq; +import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlResult; import java.io.File; import java.io.IOException; @@ -133,4 +135,21 @@ WxMediaUploadResult upload(String mediaType, String filename, String url) * @throws WxErrorException the wx error exception */ String uploadImg(File file) throws WxErrorException; + + /** + * 生成异步上传任务 + * 跟上传临时素材拿到的media_id使用场景是不通用的,目前适配的接口如下:https://developer.work.weixin.qq.com/document/path/96488#%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF%E8%AF%B4%E6%98%8E + * @param req 请求参数 + * @return 返回异步任务id + * @throws WxErrorException the wx error exception + */ + String uploadByUrl(MediaUploadByUrlReq req) throws WxErrorException; + + /** + * 查询异步任务结果 + * @param jobId 任务id。最长为128字节,60分钟内有效 + * @return 返回异步任务结果 + * @throws WxErrorException the wx error exception + */ + MediaUploadByUrlResult uploadByUrl(String jobId) throws WxErrorException; } diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImpl.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImpl.java index 863dd7c1d..427ce9d89 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImpl.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImpl.java @@ -1,5 +1,6 @@ package me.chanjar.weixin.cp.api.impl; +import com.google.gson.JsonObject; import lombok.RequiredArgsConstructor; import me.chanjar.weixin.common.bean.result.WxMediaUploadResult; import me.chanjar.weixin.common.error.WxErrorException; @@ -9,8 +10,12 @@ import me.chanjar.weixin.common.util.http.InputStreamData; import me.chanjar.weixin.common.util.http.MediaInputStreamUploadRequestExecutor; import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor; +import me.chanjar.weixin.common.util.json.GsonHelper; +import me.chanjar.weixin.common.util.json.GsonParser; import me.chanjar.weixin.cp.api.WxCpMediaService; import me.chanjar.weixin.cp.api.WxCpService; +import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlReq; +import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlResult; import java.io.File; import java.io.IOException; @@ -20,7 +25,12 @@ import java.nio.file.Files; import java.util.UUID; -import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.*; +import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.GET_UPLOAD_BY_URL_RESULT; +import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.IMG_UPLOAD; +import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.JSSDK_MEDIA_GET; +import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.MEDIA_GET; +import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.MEDIA_UPLOAD; +import static me.chanjar.weixin.cp.constant.WxCpApiPathConsts.Media.UPLOAD_BY_URL; /** *
@@ -119,4 +129,20 @@ public String uploadImg(File file) throws WxErrorException {
     return this.mainService.execute(MediaUploadRequestExecutor.create(this.mainService.getRequestHttp()), url, file)
       .getUrl();
   }
+
+  @Override
+  public String uploadByUrl(MediaUploadByUrlReq req) throws WxErrorException {
+    final String url = this.mainService.getWxCpConfigStorage().getApiUrl(UPLOAD_BY_URL);
+    String responseContent = this.mainService.post(url, req.toJson());
+    return GsonHelper.getString(GsonParser.parse(responseContent), "jobid");
+  }
+
+  @Override
+  public MediaUploadByUrlResult uploadByUrl(String jobId) throws WxErrorException {
+    final String url = this.mainService.getWxCpConfigStorage().getApiUrl(GET_UPLOAD_BY_URL_RESULT);
+    JsonObject jsonObject = new JsonObject();
+    jsonObject.addProperty("jobid", jobId);
+    String post = this.mainService.post(url, jsonObject.toString());
+    return MediaUploadByUrlResult.fromJson(post);
+  }
 }
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlReq.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlReq.java
new file mode 100644
index 000000000..c5cb21bde
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlReq.java
@@ -0,0 +1,58 @@
+package me.chanjar.weixin.cp.bean.media;
+
+import lombok.Data;
+import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+
+/**
+ * 生成异步上传任务
+ * @author imyzt
+ * @date 2025/04/27
+ */
+@Data
+public class MediaUploadByUrlReq {
+
+  /**
+   * 场景值。1-客户联系入群欢迎语素材(目前仅支持1)。 注意:每个场景值有对应的使用范围,详见上面的「使用场景说明」
+   */
+  private Integer scene;
+
+  /**
+   * 媒体文件类型。目前仅支持video-视频,file-普通文件 不超过32字节。
+   */
+  private String type;
+
+  /**
+   * 文件名,标识文件展示的名称。比如,使用该media_id发消息时,展示的文件名由该字段控制。 不超过128字节。
+   */
+  private String filename;
+
+  /**
+   * 文件cdn url。url要求支持Range分块下载 不超过1024字节。 如果为腾讯云cos链接,则需要设置为「公有读」权限。
+   */
+  private String url;
+
+  /**
+   * 文件md5。对比从url下载下来的文件md5是否一致。 不超过32字节。
+   */
+  private String md5;
+
+  /**
+   * From json wx cp base resp.
+   *
+   * @param json the json
+   * @return the wx cp base resp
+   */
+  public static MediaUploadByUrlReq fromJson(String json) {
+    return WxCpGsonBuilder.create().fromJson(json, MediaUploadByUrlReq.class);
+  }
+
+  /**
+   * To json string.
+   *
+   * @return the string
+   */
+  public String toJson() {
+    return WxCpGsonBuilder.create().toJson(this);
+  }
+
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlResult.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlResult.java
new file mode 100644
index 000000000..cc931eed3
--- /dev/null
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/media/MediaUploadByUrlResult.java
@@ -0,0 +1,82 @@
+package me.chanjar.weixin.cp.bean.media;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import me.chanjar.weixin.cp.bean.WxCpBaseResp;
+import me.chanjar.weixin.cp.util.json.WxCpGsonBuilder;
+
+import java.io.Serializable;
+
+/**
+ * 异步上传企微素材
+ * @author imyzt
+ * @date 2025/4/27
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class MediaUploadByUrlResult extends WxCpBaseResp implements Serializable {
+
+  private static final long serialVersionUID = 330834334738622341L;
+
+  /**
+   * 任务状态。1-处理中,2-完成,3-异常失败
+   */
+  @SerializedName("status")
+  private Integer status;
+
+  @SerializedName("detail")
+  private Detail detail;
+
+  @Data
+  public static class Detail {
+
+    /**
+     * 任务失败返回码。当status为3时返回非0,其他返回0
+     * 830001 url非法 确认url是否支持Range分块下载
+     * 830003 url下载数据失败 确认url本身是否能正常访问
+     * 45001 文件大小超过限制 确认文件在5字节~200M范围内
+     * 301019 文件MD5不匹配 确认url对应的文件内容md5,跟所填的md5参数是否一致
+     * 注意: status=2时,此处微信并未返回任何值
+     */
+    @SerializedName("errcode")
+    private Integer errCode;
+
+    /**
+     * 注意: status=2时,此处微信并未返回任何值
+     */
+    @SerializedName("errmsg")
+    private String errMsg;
+
+    /**
+     * 媒体文件上传后获取的唯一标识,3天内有效。当status为2时返回。
+     */
+    @SerializedName("media_id")
+    private String mediaId;
+
+    /**
+     * 媒体文件创建的时间戳。当status为2时返回。
+     */
+    @SerializedName("created_at")
+    private String createdAt;
+  }
+
+  /**
+   * From json wx cp media upload by url result.
+   *
+   * @param json the json
+   * @return the wx cp media upload by url result
+   */
+  public static MediaUploadByUrlResult fromJson(String json) {
+    return WxCpGsonBuilder.create().fromJson(json, MediaUploadByUrlResult.class);
+  }
+
+  /**
+   * To json string.
+   *
+   * @return the string
+   */
+  public String toJson() {
+    return WxCpGsonBuilder.create().toJson(this);
+  }
+}
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java
index fb4213f50..81d09a11c 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java
@@ -198,6 +198,13 @@ public class WxCpXmlMessage implements Serializable {
   @XStreamAlias("SelectedItems")
   private List selectedItems;
 
+  /**
+   * 异步任务id
+   */
+  @XStreamAlias("JobId")
+  @XStreamConverter(value = XStreamCDataConverter.class)
+  private String jobId;
+
   /**
    * 微信客服
    * 调用拉取消息接口时,需要传此token,用于校验请求的合法性
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
index d70f0ff4c..093d386e6 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpApiPathConsts.java
@@ -238,6 +238,12 @@ interface Media {
      * The constant JSSDK_MEDIA_GET.
      */
     String JSSDK_MEDIA_GET = "/cgi-bin/media/get/jssdk";
+
+    /** The constant GET_UPLOAD_BY_URL_RESULT. */
+    String GET_UPLOAD_BY_URL_RESULT = "/cgi-bin/media/get_upload_by_url_result";
+
+    /** The constant UPLOAD_BY_URL. */
+    String UPLOAD_BY_URL = "/cgi-bin/media/upload_by_url";
   }
 
   /**
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpConsts.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpConsts.java
index 606dcea6d..3d51c9e2c 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpConsts.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/constant/WxCpConsts.java
@@ -219,6 +219,11 @@ public static class EventType {
      */
     public static final String CUSTOMER_ACQUISITION = "customer_acquisition";
 
+    /**
+     * 异步上传临时素材结果回调通知
+     */
+    public static final String UPLOAD_MEDIA_JOB_FINISH = "upload_media_job_finish";
+
   }
 
   /**
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImplTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImplTest.java
index b964aad51..381a4c145 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImplTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpMediaServiceImplTest.java
@@ -7,6 +7,8 @@
 import me.chanjar.weixin.cp.api.ApiTestModule;
 import me.chanjar.weixin.cp.api.TestConstants;
 import me.chanjar.weixin.cp.api.WxCpService;
+import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlReq;
+import me.chanjar.weixin.cp.bean.media.MediaUploadByUrlResult;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Guice;
 import org.testng.annotations.Test;
@@ -127,4 +129,38 @@ public void testGetJssdkFile() throws WxErrorException {
     assertThat(file).isNotNull();
     System.out.println(file);
   }
+
+  /**
+   * Test upload media by url.
+   *
+   * @throws WxErrorException the wx error exception
+   */
+  @Test
+  public void testUploadMediaByUrl() throws WxErrorException {
+    MediaUploadByUrlReq req = new MediaUploadByUrlReq();
+    req.setScene(1);
+    req.setType("video");
+    req.setFilename("mov_bbb");
+    req.setUrl("https://www.w3school.com.cn/example/html5/mov_bbb.mp4");
+    req.setMd5("198918f40ecc7cab0fc4231adaf67c96");
+    String jobId = this.wxService.getMediaService().uploadByUrl(req);
+    System.out.println(jobId);
+  }
+
+  /**
+   * Test upload media by url.
+   *
+   * @throws WxErrorException the wx error exception
+   */
+  @Test
+  public void testUploadMediaByUrlResult() throws WxErrorException, InterruptedException {
+    String jobId = "job1745801375_5GIKWuFF3M7hcIkeSNMqs_W26xy5VeSWjLaLFTEdSfQ";
+    MediaUploadByUrlResult result = this.wxService.getMediaService().uploadByUrl(jobId);
+    System.out.println(result);
+  }
+
+  @Test
+  public void testUploadMediaJobFinishEvent() throws WxErrorException {
+    File file = this.wxService.getMediaService().getJssdkFile("....");
+  }
 }
diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessageTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessageTest.java
index a760a17ff..5bcfe9698 100644
--- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessageTest.java
+++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessageTest.java
@@ -6,6 +6,7 @@
 import org.testng.annotations.Test;
 
 import static me.chanjar.weixin.cp.constant.WxCpConsts.EventType.TASKCARD_CLICK;
+import static me.chanjar.weixin.cp.constant.WxCpConsts.EventType.UPLOAD_MEDIA_JOB_FINISH;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
@@ -421,4 +422,24 @@ public void testOpenApprovalChange() {
     assertThat(wxCpXmlMessage.getApprovalInfo().getApprovalNodes().get(0).getItems().get(0).getItemName()).isNotEmpty();
     assertThat(wxCpXmlMessage.getApprovalInfo().getNotifyNodes().get(0).getItemName()).isNotEmpty();
   }
+
+  /**
+   * Test open approval change.
+   */
+  public void testUploadMediaJobFinishEvent() {
+    String xml = "\n" +
+      "\t\n" +
+      "\t\n" +
+      "\t1425284517\n" +
+      "\t\n" +
+      "\t\n" +
+      "\t\n" +
+      "";
+
+    WxCpXmlMessage wxCpXmlMessage = WxCpXmlMessage.fromXml(xml);
+    assertThat(wxCpXmlMessage).isNotNull();
+    assertThat(wxCpXmlMessage.getJobId()).isNotEmpty();
+    assertThat(wxCpXmlMessage.getJobId()).isEqualTo("jobid_S0MrnndvRG5fadSlLwiBqiDDbM143UqTmKP3152FZk4");
+    assertThat(wxCpXmlMessage.getEvent()).isEqualTo(UPLOAD_MEDIA_JOB_FINISH);
+  }
 }

From 854b50bd5164f9cb6c77cd04e763b846ed1bf78f Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Tue, 29 Apr 2025 11:33:46 +0800
Subject: [PATCH 53/56] =?UTF-8?q?:art:=20=E4=BF=AE=E5=A4=8D=E6=97=A5?=
 =?UTF-8?q?=E5=BF=97=E4=BB=A3=E7=A0=81=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java   | 2 ++
 .../wxpay/service/impl/WxPayServiceApacheHttpImpl.java        | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
index c5bab0126..3a63f0d7f 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/BaseWxPayServiceImpl.java
@@ -30,6 +30,7 @@
 import com.google.gson.GsonBuilder;
 import lombok.Getter;
 import lombok.Setter;
+import lombok.extern.slf4j.Slf4j;
 import me.chanjar.weixin.common.error.WxRuntimeException;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.reflect.ConstructorUtils;
@@ -59,6 +60,7 @@
  *
  * @author Binary Wang
  */
+@Slf4j
 public abstract class BaseWxPayServiceImpl implements WxPayService {
   private static final String TOTAL_FUND_COUNT = "资金流水总笔数";
 
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
index e40c92a19..dcd70b523 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java
@@ -198,7 +198,7 @@ public String requestV3(String url, HttpRequestBase httpRequest) throws WxPayExc
       JsonObject jsonObject = GsonParser.parse(responseString);
       throw convertException(jsonObject);
     } catch (Exception e) {
-      this.log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage());
+      log.error("\n【请求地址】:{}\n【异常信息】:{}", url, e.getMessage());
       throw (e instanceof WxPayException) ? (WxPayException) e : new WxPayException(e.getMessage(), e);
     } finally {
       httpRequest.releaseConnection();
@@ -344,7 +344,7 @@ private void initSSLContext(HttpClientBuilder httpClientBuilder) throws WxPayExc
   }
 
   private WxPayException convertException(JsonObject jsonObject) {
-    //todo 这里考虑使用新的适用于V3的异常
+    //TODO 这里考虑使用新的适用于V3的异常
     JsonElement codeElement = jsonObject.get("code");
     String code = codeElement == null ? null : codeElement.getAsString();
     String message = jsonObject.get("message").getAsString();

From dc674ce024bd61685d6395e25bc5387c44de9c39 Mon Sep 17 00:00:00 2001
From: Binary Wang 
Date: Tue, 29 Apr 2025 12:12:34 +0800
Subject: [PATCH 54/56] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E9=83=A8?=
 =?UTF-8?q?=E5=88=86javadoc?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../me/chanjar/weixin/cp/api/WxCpOaService.java    | 14 +++++++-------
 .../weixin/cp/api/impl/WxCpOaServiceImplTest.java  |  2 --
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java
index 4647e0ed3..ee57107b5 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOaService.java
@@ -22,7 +22,7 @@ public interface WxCpOaService {
    *
    * 请求方式:POST(HTTPS)
    * 请求地址: https://qyapi.weixin.qq.com/cgi-bin/oa/applyevent?access_token=ACCESS_TOKEN
-   * 文档地址:https://work.weixin.qq.com/api/doc/90000/90135/91853
+   * 文档地址
    * 
* * @param request 请求 @@ -34,7 +34,7 @@ public interface WxCpOaService { /** *
    *  获取打卡数据
-   *  API doc : https://work.weixin.qq.com/api/doc#90000/90135/90262
+   *  文档地址
    * 
* * @param openCheckinDataType 打卡类型。1:上下班打卡;2:外出打卡;3:全部打卡 @@ -50,7 +50,7 @@ List getCheckinData(Integer openCheckinDataType, Date startTime /** *
    *   获取打卡规则
-   *   API doc : https://work.weixin.qq.com/api/doc#90000/90135/90263
+   *  文档地址
    * 
* * @param datetime 需要获取规则的当天日期 @@ -64,7 +64,7 @@ List getCheckinData(Integer openCheckinDataType, Date startTime /** *
    *   获取企业所有打卡规则
-   *   API doc : https://work.weixin.qq.com/api/doc/90000/90135/93384
+   * 文档地址
    * 
* * @return 打卡规则列表 crop checkin option @@ -82,7 +82,7 @@ List getCheckinData(Integer openCheckinDataType, Date startTime * * 一次拉取调用最多拉取100个审批记录,可以通过多次拉取的方式来满足需求,但调用频率不可超过600次/分。 * - * API doc : https://work.weixin.qq.com/api/doc/90000/90135/91816 + * 文档地址 *
* * @param startTime 开始时间 @@ -121,7 +121,7 @@ WxCpApprovalInfo getApprovalInfo(@NonNull Date startTime, @NonNull Date endTime, * * 一次拉取调用最多拉取100个审批记录,可以通过多次拉取的方式来满足需求,但调用频率不可超过600次/分。 * - * API doc : https://work.weixin.qq.com/api/doc/90000/90135/91816 + * 文档地址 * * 1 接口频率限制 600次/分钟 * 2 请求的参数endtime需要大于startime, 起始时间跨度不能超过31天; @@ -146,7 +146,7 @@ WxCpApprovalInfo getApprovalInfo(@NonNull Date startTime, @NonNull Date endTime, * * 企业可通过审批应用或自建应用Secret调用本接口,根据审批单号查询企业微信“审批应用”的审批申请详情。 * - * API Doc : https://work.weixin.qq.com/api/doc/90000/90135/91983 + * 文档地址 * * * @param spNo 审批单编号。 diff --git a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImplTest.java b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImplTest.java index a37a42ee6..0cb1e8e5e 100644 --- a/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImplTest.java +++ b/weixin-java-cp/src/test/java/me/chanjar/weixin/cp/api/impl/WxCpOaServiceImplTest.java @@ -162,8 +162,6 @@ public void testGetCheckinOption() throws WxErrorException { */ @Test public void testGetCropCheckinOption() throws WxErrorException { - - Date now = new Date(); List results = wxService.getOaService().getCropCheckinOption(); assertThat(results).isNotNull(); System.out.println("results "); From 88a5bc4f43fcd11af64928a13652984787f5f5a4 Mon Sep 17 00:00:00 2001 From: jimson Date: Thu, 8 May 2025 22:15:06 +0800 Subject: [PATCH 55/56] =?UTF-8?q?:art:=20=E4=BC=81=E5=BE=AE=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=BE=A4=E5=9B=9E=E8=B0=83=E4=BA=8B=E4=BB=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0MemChangeList=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java index 81d09a11c..2313bcb51 100644 --- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java +++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/bean/message/WxCpXmlMessage.java @@ -155,6 +155,10 @@ public class WxCpXmlMessage implements Serializable { @XStreamConverter(value = XStreamCDataConverter.class) private String memChangeCnt; + @XStreamAlias("MemChangeList") + @XStreamConverter(value = XStreamCDataConverter.class) + private String MemChangeList; + @XStreamAlias("Source") @XStreamConverter(value = XStreamCDataConverter.class) private String source; From fb57af7409628e7e66b971671b41876bf919f64c Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Thu, 8 May 2025 23:04:32 +0800 Subject: [PATCH 56/56] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.5.B?= =?UTF-8?q?=20=E6=B5=8B=E8=AF=95=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- solon-plugins/pom.xml | 2 +- solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-channel-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-cp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-miniapp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-mp-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-open-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-pay-solon-plugin/pom.xml | 2 +- solon-plugins/wx-java-qidian-solon-plugin/pom.xml | 2 +- spring-boot-starters/pom.xml | 2 +- .../wx-java-channel-multi-spring-boot-starter/pom.xml | 2 +- .../wx-java-channel-spring-boot-starter/pom.xml | 2 +- .../wx-java-cp-multi-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml | 2 +- .../wx-java-miniapp-multi-spring-boot-starter/pom.xml | 2 +- .../wx-java-miniapp-spring-boot-starter/pom.xml | 2 +- .../wx-java-mp-multi-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml | 2 +- spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml | 2 +- weixin-graal/pom.xml | 2 +- weixin-java-channel/pom.xml | 2 +- weixin-java-common/pom.xml | 2 +- weixin-java-cp/pom.xml | 2 +- weixin-java-miniapp/pom.xml | 2 +- weixin-java-mp/pom.xml | 2 +- weixin-java-open/pom.xml | 2 +- weixin-java-pay/pom.xml | 2 +- weixin-java-qidian/pom.xml | 2 +- 34 files changed, 34 insertions(+), 34 deletions(-) diff --git a/pom.xml b/pom.xml index 5c00e66a7..3c660ac65 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B pom WxJava - Weixin/Wechat Java SDK 微信开发Java SDK diff --git a/solon-plugins/pom.xml b/solon-plugins/pom.xml index 8d14b4461..4270e7aae 100644 --- a/solon-plugins/pom.xml +++ b/solon-plugins/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B pom wx-java-solon-plugins diff --git a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml index 84c14a101..072019106 100644 --- a/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-channel-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/solon-plugins/wx-java-channel-solon-plugin/pom.xml b/solon-plugins/wx-java-channel-solon-plugin/pom.xml index 6238a55e4..256dd4a17 100644 --- a/solon-plugins/wx-java-channel-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-channel-solon-plugin/pom.xml @@ -3,7 +3,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml index 742b86239..eeea99b44 100644 --- a/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-cp-multi-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/solon-plugins/wx-java-cp-solon-plugin/pom.xml b/solon-plugins/wx-java-cp-solon-plugin/pom.xml index b758ff8a5..1d12f05ac 100644 --- a/solon-plugins/wx-java-cp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-cp-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml index 52db2699b..9d7b0b728 100644 --- a/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-miniapp-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml index fd8643699..416f84259 100644 --- a/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-miniapp-solon-plugin/pom.xml @@ -4,7 +4,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml index 4ba79c8a5..f01f20608 100644 --- a/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-mp-multi-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/solon-plugins/wx-java-mp-solon-plugin/pom.xml b/solon-plugins/wx-java-mp-solon-plugin/pom.xml index bea895694..54b49d266 100644 --- a/solon-plugins/wx-java-mp-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-mp-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/solon-plugins/wx-java-open-solon-plugin/pom.xml b/solon-plugins/wx-java-open-solon-plugin/pom.xml index 80a5df100..88c035eba 100644 --- a/solon-plugins/wx-java-open-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-open-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/solon-plugins/wx-java-pay-solon-plugin/pom.xml b/solon-plugins/wx-java-pay-solon-plugin/pom.xml index 4dabbe46b..032e69a53 100644 --- a/solon-plugins/wx-java-pay-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-pay-solon-plugin/pom.xml @@ -5,7 +5,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml index 23ad77ea1..c3c0d322e 100644 --- a/solon-plugins/wx-java-qidian-solon-plugin/pom.xml +++ b/solon-plugins/wx-java-qidian-solon-plugin/pom.xml @@ -3,7 +3,7 @@ wx-java-solon-plugins com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/spring-boot-starters/pom.xml b/spring-boot-starters/pom.xml index 7f185f9fe..a849cc8e4 100644 --- a/spring-boot-starters/pom.xml +++ b/spring-boot-starters/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B pom wx-java-spring-boot-starters diff --git a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml index e7faca156..f9ffa4cac 100644 --- a/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-channel-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml index 360c71d1a..8c1018d4f 100644 --- a/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-channel-spring-boot-starter/pom.xml @@ -3,7 +3,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml index a32306110..205a39ce0 100644 --- a/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-cp-multi-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml index 37b185228..f9ef3aaed 100644 --- a/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-cp-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml index 5736c9dec..e0e781cc6 100644 --- a/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-miniapp-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml index 41f449da3..c38db4802 100644 --- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/pom.xml @@ -4,7 +4,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml index 11680de01..40487f9bd 100644 --- a/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-mp-multi-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml index 20a527eba..d87b66200 100644 --- a/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-mp-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml index 95d3a9941..31c9e158b 100644 --- a/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-open-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml index 9a415ef12..91a92769c 100644 --- a/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-pay-spring-boot-starter/pom.xml @@ -5,7 +5,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml index 795cfcbe7..e44dc428b 100644 --- a/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml +++ b/spring-boot-starters/wx-java-qidian-spring-boot-starter/pom.xml @@ -3,7 +3,7 @@ wx-java-spring-boot-starters com.github.binarywang - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/weixin-graal/pom.xml b/weixin-graal/pom.xml index 323df0d86..edf9c81d5 100644 --- a/weixin-graal/pom.xml +++ b/weixin-graal/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B weixin-graal diff --git a/weixin-java-channel/pom.xml b/weixin-java-channel/pom.xml index 3264a2fe9..ac1d8f4c8 100644 --- a/weixin-java-channel/pom.xml +++ b/weixin-java-channel/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B weixin-java-channel diff --git a/weixin-java-common/pom.xml b/weixin-java-common/pom.xml index d45cc46d4..4afef6ade 100644 --- a/weixin-java-common/pom.xml +++ b/weixin-java-common/pom.xml @@ -6,7 +6,7 @@ com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B weixin-java-common diff --git a/weixin-java-cp/pom.xml b/weixin-java-cp/pom.xml index 23cdd4d22..4ba0471db 100644 --- a/weixin-java-cp/pom.xml +++ b/weixin-java-cp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B weixin-java-cp diff --git a/weixin-java-miniapp/pom.xml b/weixin-java-miniapp/pom.xml index 3c5c3fd95..3c3898f3f 100644 --- a/weixin-java-miniapp/pom.xml +++ b/weixin-java-miniapp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B weixin-java-miniapp diff --git a/weixin-java-mp/pom.xml b/weixin-java-mp/pom.xml index 0b8adf038..22ec60f38 100644 --- a/weixin-java-mp/pom.xml +++ b/weixin-java-mp/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B weixin-java-mp diff --git a/weixin-java-open/pom.xml b/weixin-java-open/pom.xml index d09746719..1588287bc 100644 --- a/weixin-java-open/pom.xml +++ b/weixin-java-open/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B weixin-java-open diff --git a/weixin-java-pay/pom.xml b/weixin-java-pay/pom.xml index 4525620d7..c396980a5 100644 --- a/weixin-java-pay/pom.xml +++ b/weixin-java-pay/pom.xml @@ -5,7 +5,7 @@ com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B 4.0.0 diff --git a/weixin-java-qidian/pom.xml b/weixin-java-qidian/pom.xml index f7f0d9ac6..08bdfa0af 100644 --- a/weixin-java-qidian/pom.xml +++ b/weixin-java-qidian/pom.xml @@ -7,7 +7,7 @@ com.github.binarywang wx-java - 4.7.4.B + 4.7.5.B weixin-java-qidian