* 字段名:开户银行支行名称
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankInfo.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankInfo.java
index 89756b07d5..adafc9b280 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankInfo.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankInfo.java
@@ -5,6 +5,8 @@
import lombok.Getter;
import lombok.Setter;
+import java.io.Serializable;
+
/**
* 银行信息
*
@@ -12,7 +14,10 @@
* created on 2022/5/12
**/
@Data
-public class BankInfo {
+public class BankInfo implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
/**
* 银行别名
*/
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankingResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankingResult.java
index 407ad5fc55..1d3a48c200 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankingResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/BankingResult.java
@@ -43,7 +43,10 @@ public class BankingResult implements Serializable {
@Getter
@Setter
- public static class Link {
+ public static class Link implements Serializable {
+
+ private static final long serialVersionUID = -8372812998971715894L;
+
/**
* 下一页链接
*/
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/CitiesResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/CitiesResult.java
index b5bf87c816..b6914ee814 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/CitiesResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/CitiesResult.java
@@ -47,7 +47,10 @@ public class CitiesResult implements Serializable {
@Getter
@Setter
- public static class CityInfo {
+ public static class CityInfo implements Serializable {
+
+ private static final long serialVersionUID = -6089905695087974693L;
+
/**
*
* 字段名:城市名称
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/ProvincesResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/ProvincesResult.java
index 6525fc1c91..162c976347 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/ProvincesResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/bank/ProvincesResult.java
@@ -47,7 +47,9 @@ public class ProvincesResult implements Serializable {
@Getter
@Setter
- public static class ProvinceInfo {
+ public static class ProvinceInfo implements Serializable {
+
+ private static final long serialVersionUID = -4118613374545722650L;
/**
*
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/FundBillResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/FundBillResult.java
index 206cd1218b..077c2c2336 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/FundBillResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/FundBillResult.java
@@ -48,7 +48,9 @@ public class FundBillResult implements Serializable {
private FundBill[] downloadBillList;
@Data
- public static class FundBill {
+ public static class FundBill implements Serializable {
+
+ private static final long serialVersionUID = 4008480977464421822L;
/**
*
From f6b114d0eab95fdc47558309420437fe4adb67cc Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 17 Dec 2024 00:32:15 +0800
Subject: [PATCH 007/276] :arrow_up: Bump com.thoughtworks.xstream:xstream
---
others/weixin-java-osgi/pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/others/weixin-java-osgi/pom.xml b/others/weixin-java-osgi/pom.xml
index 67e4f42beb..b8531da88d 100644
--- a/others/weixin-java-osgi/pom.xml
+++ b/others/weixin-java-osgi/pom.xml
@@ -28,7 +28,7 @@
com.thoughtworks.xstream
xstream
- 1.4.19
+ 1.4.21
provided
From 27f1fcaec6cae003e39333e60eb46aae0b902106 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=BD=97=E5=8B=8B?=
Date: Wed, 18 Dec 2024 03:19:46 +0000
Subject: [PATCH 008/276] =?UTF-8?q?:bug:=20=E3=80=90=E8=A7=86=E9=A2=91?=
=?UTF-8?q?=E5=8F=B7=E3=80=91=E4=BF=AE=E5=A4=8D=E5=BE=AE=E4=BF=A1=E5=B0=8F?=
=?UTF-8?q?=E5=BA=97=E4=B8=BB=E9=A1=B5=E7=AE=A1=E7=90=86API=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96=E5=9C=A8=E5=BA=97=E9=93=BA=E4=B8=BB=E9=A1=B5=E5=B1=95?=
=?UTF-8?q?=E7=A4=BA=E7=9A=84=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E7=9A=84=E8=BF=94=E5=9B=9E=E5=AE=9E=E4=BD=93=E7=B1=BB?=
=?UTF-8?q?=E7=9A=84=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java | 5 +++--
.../weixin/channel/bean/home/tree/OneLevelTreeNode.java | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java
index c74fff1246..104588202e 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/LevelTreeInfo.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
+import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@@ -17,7 +18,7 @@
public class LevelTreeInfo implements Serializable {
/** 一级分类 */
- @JsonProperty("level1")
- private OneLevelTreeNode level1;
+ @JsonProperty("level_1")
+ private List level1;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java
index 74103e2b89..76499c86e7 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/OneLevelTreeNode.java
@@ -1,6 +1,7 @@
package me.chanjar.weixin.channel.bean.home.tree;
import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -18,7 +19,7 @@
public class OneLevelTreeNode extends CatTreeNode {
/** 二级分类 */
- @JsonProperty("level2")
- private CatTreeNode level2;
+ @JsonProperty("level_2")
+ private List level2;
}
From 47471a6c0b10e2e7429b419f386ee98e5acea72b Mon Sep 17 00:00:00 2001
From: Binary Wang <5303+binary@user.noreply.gitee.com>
Date: Wed, 18 Dec 2024 03:23:35 +0000
Subject: [PATCH 009/276] update .gitee/ISSUE_TEMPLATE.md.
Signed-off-by: Binary Wang <5303+binary@user.noreply.gitee.com>
---
.gitee/ISSUE_TEMPLATE.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitee/ISSUE_TEMPLATE.md b/.gitee/ISSUE_TEMPLATE.md
index cdae693d35..a0b60ba750 100644
--- a/.gitee/ISSUE_TEMPLATE.md
+++ b/.gitee/ISSUE_TEMPLATE.md
@@ -1,4 +1,4 @@
-强烈建议大家到 `github` 相关页面提交问题,方便统一查询管理,具体页面地址:https://github.com/Wechat-Group/WxJava/issues
+强烈建议大家到 `github` 相关页面提交问题,方便统一查询管理,具体页面地址:https://github.com/binarywang/WxJava/issues
当然如果必须在这里提问,请务必按以下格式填写,谢谢配合~
From 8891b68e7986d6ec53aa52fb60985dd9272cd66a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ader1y=20=E6=A0=88=E7=83=9F?=
Date: Wed, 18 Dec 2024 11:37:37 +0800
Subject: [PATCH 010/276] =?UTF-8?q?:bug:=20#3443=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E5=88=9D=E5=A7=8B=E5=8C=96?=
=?UTF-8?q?V3=E8=AF=B7=E6=B1=82=E6=97=B6=E5=8F=96=E6=B6=88=E5=AF=B9?=
=?UTF-8?q?=E7=A7=81=E9=92=A5=E7=9A=84=E5=8A=A0=E5=AF=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../binarywang/wxpay/config/WxPayConfig.java | 5 ----
.../config/CustomizedWxPayConfigTest.java | 9 ++++---
.../wxpay/config/WxPayConfigTest.java | 24 -------------------
.../testbase/CustomizedApiTestModule.java | 20 +++++++++++++---
4 files changed, 23 insertions(+), 35 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 a8ad909b3e..293c52eac6 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,7 +14,6 @@
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;
@@ -295,10 +294,6 @@ public CloseableHttpClient initApiV3HttpClient() throws WxPayException {
}
try {
if (merchantPrivateKey == null) {
- if (StringUtils.isNotBlank(this.getPrivateKeyString())) {
- this.setPrivateKeyString(Base64.getEncoder().encodeToString(this.getPrivateKeyString().getBytes()));
- }
-
try (InputStream keyInputStream = this.loadConfigInputStream(this.getPrivateKeyString(), this.getPrivateKeyPath(),
this.privateKeyContent, "privateKeyPath")) {
merchantPrivateKey = PemUtils.loadPrivateKey(keyInputStream);
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/CustomizedWxPayConfigTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/CustomizedWxPayConfigTest.java
index a42026e3ee..3b2bdfeaa6 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/CustomizedWxPayConfigTest.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/CustomizedWxPayConfigTest.java
@@ -1,5 +1,9 @@
package com.github.binarywang.wxpay.config;
+import static org.testng.Assert.assertEquals;
+
+import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryV3Result;
+import com.github.binarywang.wxpay.constant.WxPayErrorCode;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.testbase.CustomizedApiTestModule;
@@ -30,10 +34,9 @@ public void testCustomizerHttpClient() {
public void testCustomizerV3HttpClient() {
try {
- wxPayService.queryOrderV3("a", null);
+ WxPayOrderQueryV3Result result = wxPayService.queryOrderV3("a", null);
} catch (WxPayException e) {
- // ignore
- e.printStackTrace();
+ assertEquals(e.getErrCode(), WxPayErrorCode.RefundQuery.PARAM_ERROR);
}
}
}
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/WxPayConfigTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/WxPayConfigTest.java
index 72750e01cd..46bc23aac2 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/WxPayConfigTest.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/config/WxPayConfigTest.java
@@ -1,16 +1,7 @@
package com.github.binarywang.wxpay.config;
-import com.github.binarywang.wxpay.exception.WxPayException;
-import org.bouncycastle.jce.provider.BouncyCastleProvider;
-import org.bouncycastle.pqc.jcajce.provider.util.KeyUtil;
import org.testng.annotations.Test;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.SecureRandom;
-import java.security.Security;
-import java.util.Base64;
-
/**
*
* Created by BinaryWang on 2017/6/18.
@@ -54,19 +45,4 @@ public void testInitSSLContext_base64() throws Exception {
payConfig.initSSLContext();
}
-
- @Test
- public void testInitApiV3HttpClient() throws Exception {
- Security.addProvider(new BouncyCastleProvider());
- KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA","BC");
- keyPairGenerator.initialize(2048,new SecureRandom());
- KeyPair keyPair = keyPairGenerator.genKeyPair();
- byte[] encoded = keyPair.getPrivate().getEncoded();
- // 模拟用户配置
- String privateKeyString = Base64.getEncoder().encodeToString(encoded);
- payConfig.setPrivateKeyString(privateKeyString);
- payConfig.setApiV3Key("Test");
- payConfig.initApiV3HttpClient();
- }
-
}
diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/CustomizedApiTestModule.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/CustomizedApiTestModule.java
index a0cc399ea9..484227e34e 100644
--- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/CustomizedApiTestModule.java
+++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/testbase/CustomizedApiTestModule.java
@@ -6,15 +6,14 @@
import com.google.inject.Binder;
import com.google.inject.Module;
import com.thoughtworks.xstream.XStream;
+import java.io.*;
+import java.nio.charset.StandardCharsets;
import me.chanjar.weixin.common.error.WxRuntimeException;
import me.chanjar.weixin.common.util.xml.XStreamInitializer;
import org.apache.http.HttpRequestInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.io.InputStream;
-
/**
* The type Api test module.
*/
@@ -39,7 +38,22 @@ public void configure(Binder binder) {
config.setHttpClientBuilderCustomizer((builder) -> {
builder.addInterceptorLast((HttpRequestInterceptor) (r, c) -> System.out.println("--------> HttpRequestInterceptor ..."));
});
+ try (FileInputStream fis = new FileInputStream(config.getPrivateKeyPath());
+ InputStreamReader isr = new InputStreamReader(fis, StandardCharsets.UTF_8);
+ BufferedReader reader = new BufferedReader(isr)) {
+
+ StringBuilder stringBuilder = new StringBuilder();
+ String line;
+ while ((line = reader.readLine()) != null) {
+ stringBuilder.append(line);
+ stringBuilder.append(System.lineSeparator());
+ }
+ String fileContent = stringBuilder.toString();
+ config.setPrivateKeyString(fileContent);
+ System.out.println(fileContent);
+
+ }
WxPayService wxService = new WxPayServiceImpl();
wxService.setConfig(config);
From 6b5d69667f9c0c76ae73c0a96ba856c3346964d0 Mon Sep 17 00:00:00 2001
From: Zeyes Lee
Date: Wed, 18 Dec 2024 12:39:27 +0800
Subject: [PATCH 011/276] =?UTF-8?q?:bug:=20=E3=80=90=E8=A7=86=E9=A2=91?=
=?UTF-8?q?=E5=8F=B7=E3=80=91=E4=BF=AE=E6=AD=A3=E5=BA=97=E9=93=BA=E4=B8=BB?=
=?UTF-8?q?=E9=A1=B5=E5=B1=95=E7=A4=BA=E7=9A=84=E5=95=86=E5=93=81=E5=88=86?=
=?UTF-8?q?=E7=B1=BB=E6=8A=A5=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../channel/bean/home/tree/CatTreeNode.java | 2 +-
.../channel/bean/home/tree/TreeShowInfo.java | 58 -------------------
2 files changed, 1 insertion(+), 59 deletions(-)
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java
index fda794428c..c545b8637f 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/CatTreeNode.java
@@ -28,5 +28,5 @@ public class CatTreeNode implements Serializable {
/** 是否在用户端展示该分类。1为是,0为否 */
@JsonProperty("is_displayed")
- private Integer displayed;
+ private Boolean displayed;
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java
index 485d29ce15..09da2c5b0c 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/home/tree/TreeShowInfo.java
@@ -1,6 +1,5 @@
package me.chanjar.weixin.channel.bean.home.tree;
-import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
@@ -43,61 +42,4 @@ protected LevelTreeInfo createTree() {
}
return tree;
}
-
- /**
- * 创建一级分类节点
- *
- * @return 一级分类节点
- */
- protected OneLevelTreeNode createLevel1() {
- this.createTree();
- if (tree.getLevel1() == null) {
- tree.setLevel1(new OneLevelTreeNode());
- }
- return tree.getLevel1();
- }
-
- /**
- * 创建二级分类节点
- *
- * @return 二级分类节点
- */
- protected CatTreeNode createLevel2() {
- OneLevelTreeNode level1 = this.createLevel1();
- if (level1.getLevel2() == null) {
- level1.setLevel2(new CatTreeNode());
- }
- return level1.getLevel2();
- }
-
-
- @JsonIgnore
- public void setLevel1Id(Integer id) {
- createLevel1().setId(id);
- }
-
- @JsonIgnore
- public void setLevel1Name(String name) {
- createLevel1().setName(name);
- }
-
- @JsonIgnore
- public void setLevel1Displayed(Integer displayed) {
- createLevel1().setDisplayed(displayed);
- }
-
- @JsonIgnore
- public void setLevel2Id(Integer id) {
- createLevel2().setId(id);
- }
-
- @JsonIgnore
- public void setLevel2Name(String name) {
- createLevel2().setName(name);
- }
-
- @JsonIgnore
- public void setLevel2Displayed(Integer displayed) {
- createLevel2().setDisplayed(displayed);
- }
}
From 24f03e957377ab034177bf061766865c171ff91f Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Wed, 18 Dec 2024 12:37:54 +0800
Subject: [PATCH 012/276] =?UTF-8?q?:art:=20=E4=BC=98=E5=8C=96=E9=A6=96?=
=?UTF-8?q?=E9=A1=B5=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 56 ++++++++++++++++++++++++-------------------------------
1 file changed, 24 insertions(+), 32 deletions(-)
diff --git a/README.md b/README.md
index c61c8d48da..ab645b7c4f 100644
--- a/README.md
+++ b/README.md
@@ -50,21 +50,23 @@
+
+
### 重要信息
-0. [`WxJava` 荣获 `GitCode` 2024年度十大开源社区奖项](https://mp.weixin.qq.com/s/wM_UlMsDm3IZ1CPPDvcvQw)。
-1. 项目合作洽谈请联系微信`binary0000`(在微信里自行搜索并添加好友,请注明来意,如有关于SDK问题需讨论请参考下文入群讨论,不要加此微信)。
-2. **2023-12-28 发布 [【4.6.0正式版】](https://mp.weixin.qq.com/s/9Hhc_8w-v7ogS_TEAsqfAg)**!
-3. 贡献源码可以参考视频:[【贡献源码全过程(上集)】](https://mp.weixin.qq.com/s/3xUZSATWwHR_gZZm207h7Q)、[【贡献源码全过程(下集)】](https://mp.weixin.qq.com/s/nyzJwVVoYSJ4hSbwyvTx9A) ,友情提供:[程序员小山与Bug](https://space.bilibili.com/473631007)
-4. 新手重要提示:本项目仅是一个SDK开发工具包,未提供Web实现,建议使用 `maven` 或 `gradle` 引用本项目即可使用本SDK提供的各种功能,详情可参考 **[【Demo项目】](demo.md)** 或本项目中的部分单元测试代码;
-5. 微信开发新手请务必阅读【开发文档】([Gitee Wiki](https://gitee.com/binary/weixin-java-tools/wikis/Home) 或者 [Github Wiki](https://github.com/binarywang/WxJava/wiki))的常见问题部分,可以少走很多弯路,节省不少时间。
-6. 技术交流群:想获得QQ群/微信群/钉钉企业群等信息的同学,请使用微信扫描上面的微信公众号二维码关注 `WxJava` 后点击相关菜单即可获取加入方式,同时也可以在微信中搜索 `weixin-java-tools` 或 `WxJava` 后选择正确的公众号进行关注,该公众号会及时通知SDK相关更新信息,并不定期分享微信Java开发相关技术知识;
-7. 钉钉技术交流群:`32206329`(技术交流2群), `30294972`(技术交流1群,目前已满),`35724728`(通知群,实时通知Github项目变更记录)。
-8. 微信开发新手或者Java开发新手在群内提问或新开Issue提问前,请先阅读[【提问的智慧】](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md),并确保已查阅过 [【开发文档Wiki】](https://github.com/binarywang/WxJava/wiki) ,避免浪费大家的宝贵时间;
-9. 寻求帮助时需贴代码或大长串异常信息的,请利用 http://paste.ubuntu.com
+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)**!
+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))的常见问题部分,可以少走很多弯路,节省不少时间。
+7. 技术交流群:想获得QQ群/微信群/钉钉企业群等信息的同学,请使用微信扫描上面的微信公众号二维码关注 `WxJava` 后点击相关菜单即可获取加入方式,同时也可以在微信中搜索 `weixin-java-tools` 或 `WxJava` 后选择正确的公众号进行关注,该公众号会及时通知SDK相关更新信息,并不定期分享微信Java开发相关技术知识;
+8. 钉钉技术交流群:`32206329`(技术交流2群), `30294972`(技术交流1群,目前已满),`35724728`(通知群,实时通知Github项目变更记录)。
+9. 微信开发新手或者Java开发新手在群内提问或新开Issue提问前,请先阅读[【提问的智慧】](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md),并确保已查阅过 [【开发文档Wiki】](https://github.com/binarywang/WxJava/wiki) ,避免浪费大家的宝贵时间;
+10. 寻求帮助时需贴代码或大长串异常信息的,请利用 http://paste.ubuntu.com
--------------------------------
### 其他说明
@@ -95,9 +97,9 @@
- 微信小程序:`weixin-java-miniapp`
- 微信支付:`weixin-java-pay`
- 微信开放平台:`weixin-java-open`
- - 公众号(包括订阅号和服务号):`weixin-java-mp`
- - 企业号/企业微信:`weixin-java-cp`
- - 视频号/微信小店:`weixin-java-channel`
+ - 微信公众号:`weixin-java-mp`
+ - 企业微信:`weixin-java-cp`
+ - 微信视频号/微信小店:`weixin-java-channel`
---------------------------------
@@ -117,7 +119,8 @@
### 应用案例
完整案例登记列表,请[【访问这里】](https://github.com/binarywang/WxJava/issues/729)查看,欢迎登记更多的案例。
-以下为节选的部分案例:
+
+以下为节选的部分案例, 点此展开查看
#### 开源项目:
- 基于微信公众号的签到、抽奖、发送弹幕程序:https://github.com/workcheng/weiya
@@ -180,26 +183,15 @@
- 微信公众号管理系统:http://demo.joolun.com
- 锐捷网络:Saleslink
+
+
----------------------------------
### 贡献者列表
特别感谢参与贡献的所有同学,所有贡献者列表请在[此处](https://github.com/binarywang/WxJava/graphs/contributors)查看,欢迎大家继续踊跃贡献代码!
-
-点击此处展开查看贡献次数最多的几位小伙伴
-
-1. [chanjarster (Daniel Qian)](https://github.com/chanjarster)
-2. [binarywang (Binary Wang)](https://github.com/binarywang)
-3. [007gzs](https://github.com/007gzs)
-4. [Silloy](https://github.com/silloy)
-5. [mgcnrx11](https://github.com/mgcnrx11)
-6. [0katekate0 (Wang_Wong)](https://github.com/0katekate0)
-7. [yuanqixun](https://github.com/yuanqixun)
-8. [kakotor](https://github.com/kakotor)
-9. [aimilin6688 (Jonk)](https://github.com/aimilin6688)
-10. [lkqm (Mario Luo)](https://github.com/lkqm)
-11. [kareanyi (MillerLin)](https://github.com/kareanyi)
-12. [Bincent (Hongbin.hsu)](https://gitee.com/bincent)
-
-### GitHub Stargazers over time
+
+
+
-[](https://starchart.cc/Wechat-Group/WxJava)
+### GitHub Stargazers over time
+[](https://star-history.com/#binarywang/WxJava&Date)
From 75aa3fce9a59360dfe8aebc79a36a912ab40610b Mon Sep 17 00:00:00 2001
From: Zeyes Lee
Date: Wed, 18 Dec 2024 21:50:53 +0800
Subject: [PATCH 013/276] =?UTF-8?q?:art:=20#3445=20=E3=80=90=E4=BC=81?=
=?UTF-8?q?=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=91=E7=AC=AC=E4=B8=89=E6=96=B9?=
=?UTF-8?q?=E5=BA=94=E7=94=A8=E5=BC=80=E5=8F=91=E6=B6=88=E6=81=AF=E5=A4=84?=
=?UTF-8?q?=E7=90=86=E5=88=A4=E6=96=AD=E9=87=8D=E5=A4=8D=E7=9A=84=E6=96=B9?=
=?UTF-8?q?=E6=B3=95=E8=BF=9B=E8=A1=8C=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../weixin/channel/message/WxChannelMessageRouter.java | 4 ++--
.../java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java | 2 +-
.../me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java | 5 +++--
.../cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java | 2 +-
.../java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java | 2 +-
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
index 8ccc2c5050..16fb0781cb 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
@@ -178,7 +178,7 @@ public Object route(final WxChannelMessage message, final String content, final
* @param wxMessage 消息
* @return 是否重复
*/
- private boolean isMsgDuplicated(WxChannelMessage wxMessage) {
+ protected boolean isMsgDuplicated(WxChannelMessage wxMessage) {
String messageId = this.generateMessageId(wxMessage);
return this.messageDuplicateChecker.isDuplicate(messageId);
}
@@ -188,7 +188,7 @@ private boolean isMsgDuplicated(WxChannelMessage wxMessage) {
*
* @return 消息id
*/
- private String generateMessageId(WxChannelMessage wxMessage) {
+ protected String generateMessageId(WxChannelMessage wxMessage) {
StringBuilder sb = new StringBuilder();
if (wxMessage.getMsgId() == null) {
sb.append(wxMessage.getCreateTime())
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java
index e2daeab546..a2417ec86d 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/message/WxCpMessageRouter.java
@@ -258,7 +258,7 @@ public WxCpXmlOutMessage route(final WxCpXmlMessage wxMessage) {
return this.route(wxMessage, new HashMap<>(2));
}
- private boolean isMsgDuplicated(WxCpXmlMessage wxMessage) {
+ protected boolean isMsgDuplicated(WxCpXmlMessage wxMessage) {
StringBuilder messageId = new StringBuilder();
if (wxMessage.getMsgId() == null) {
messageId.append(wxMessage.getCreateTime())
diff --git a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java
index 1df52149c8..8887a23d5f 100644
--- a/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java
+++ b/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/message/WxCpTpMessageRouter.java
@@ -278,7 +278,7 @@ public WxCpXmlOutMessage route(final WxCpTpXmlMessage wxMessage) {
return this.route(wxMessage, new HashMap<>(2));
}
- private boolean isMsgDuplicated(final String suiteId, WxCpTpXmlMessage wxMessage) {
+ protected boolean isMsgDuplicated(final String suiteId, WxCpTpXmlMessage wxMessage) {
StringBuilder messageId = new StringBuilder();
messageId.append(wxMessage.getToUserName());
if (wxMessage.getInfoType() != null) {
@@ -306,7 +306,8 @@ private boolean isMsgDuplicated(final String suiteId, WxCpTpXmlMessage wxMessage
.append("-").append(wxMessage.getCreateTime())
.append("-").append(wxMessage.getFromUserName())
.append("-").append(StringUtils.trimToEmpty(wxMessage.getEvent()))
- .append("-").append(StringUtils.trimToEmpty(wxMessage.getEventKey()));
+ .append("-").append(StringUtils.trimToEmpty(wxMessage.getEventKey()))
+ .append("-").append(StringUtils.trimToEmpty(wxMessage.getExternalUserID()));
}
}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java
index 6cd603929d..3d81b6d66a 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/message/WxMaMessageRouter.java
@@ -173,7 +173,7 @@ public WxMaXmlOutMessage route(final WxMaMessage wxMessage) {
return this.route(wxMessage, new HashMap<>(2));
}
- private boolean isMsgDuplicated(WxMaMessage wxMessage) {
+ protected boolean isMsgDuplicated(WxMaMessage wxMessage) {
StringBuilder messageId = new StringBuilder();
if (wxMessage.getMsgId() == null) {
messageId.append(wxMessage.getCreateTime())
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java
index 070e952c0f..f2a28c668c 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpMessageRouter.java
@@ -315,7 +315,7 @@ public WxMpXmlOutMessage route(String appid, final WxMpXmlMessage wxMessage) {
return this.route(appid, wxMessage, new HashMap<>(2));
}
- private boolean isMsgDuplicated(WxMpXmlMessage wxMessage) {
+ protected boolean isMsgDuplicated(WxMpXmlMessage wxMessage) {
StringBuilder messageId = new StringBuilder();
if (wxMessage.getMsgId() == null) {
messageId.append(wxMessage.getCreateTime())
From 6840722947445862620db495b48fbc6667b25761 Mon Sep 17 00:00:00 2001
From: Zeyes Lee
Date: Wed, 18 Dec 2024 22:40:10 +0800
Subject: [PATCH 014/276] =?UTF-8?q?:art:=20#3449=E3=80=90=E8=A7=86?=
=?UTF-8?q?=E9=A2=91=E5=8F=B7=E3=80=91=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85?=
=?UTF-8?q?=E5=92=8C=E5=88=86=E7=B1=BB=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5=EF=BC=8C?=
=?UTF-8?q?=E5=B9=B6=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=A2=9E=E5=BA=93=E5=AD=98?=
=?UTF-8?q?=E4=B8=8D=E8=B6=B3=E3=80=81=E5=9B=A2=E8=B4=AD=E4=BC=98=E6=83=A0?=
=?UTF-8?q?=E5=8F=91=E6=94=BE=E7=9A=84=E5=9B=9E=E8=B0=83=E9=80=9A=E7=9F=A5?=
=?UTF-8?q?=E5=A4=84=E7=90=86=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../api/BaseWxChannelMessageService.java | 25 +++++
.../impl/BaseWxChannelMessageServiceImpl.java | 19 ++++
.../bean/category/CategoryDetailResult.java | 4 +
.../bean/category/CategoryQualification.java | 4 +
.../bean/message/product/SpuStockMessage.java | 88 +++++++++++++++
.../bean/message/voucher/VoucherInfo.java | 106 ++++++++++++++++++
.../bean/message/voucher/VoucherMessage.java | 29 +++++
.../channel/bean/order/OrderAgentInfo.java | 30 +++++
.../channel/bean/order/OrderDetailInfo.java | 8 ++
.../channel/bean/order/OrderSourceInfo.java | 48 ++++++++
.../constant/MessageEventConstants.java | 4 +
.../message/WxChannelMessageRouter.java | 7 +-
12 files changed, 369 insertions(+), 3 deletions(-)
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/product/SpuStockMessage.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherMessage.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderAgentInfo.java
create mode 100644 weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSourceInfo.java
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
index 6f7be2f63f..a908da9479 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java
@@ -20,11 +20,13 @@
import me.chanjar.weixin.channel.bean.message.product.BrandMessage;
import me.chanjar.weixin.channel.bean.message.product.CategoryAuditMessage;
import me.chanjar.weixin.channel.bean.message.product.SpuAuditMessage;
+import me.chanjar.weixin.channel.bean.message.product.SpuStockMessage;
import me.chanjar.weixin.channel.bean.message.store.CloseStoreMessage;
import me.chanjar.weixin.channel.bean.message.store.NicknameUpdateMessage;
import me.chanjar.weixin.channel.bean.message.supplier.SupplierItemMessage;
import me.chanjar.weixin.channel.bean.message.vip.ExchangeInfoMessage;
import me.chanjar.weixin.channel.bean.message.vip.UserInfoMessage;
+import me.chanjar.weixin.channel.bean.message.voucher.VoucherMessage;
import me.chanjar.weixin.channel.message.WxChannelMessage;
import me.chanjar.weixin.channel.message.WxChannelMessageRouterRule;
import me.chanjar.weixin.common.session.WxSessionManager;
@@ -197,6 +199,18 @@ void spuStatusUpdate(SpuAuditMessage message, final String content, final String
void spuUpdate(SpuAuditMessage message, final String content, final String appId, final Map context,
final WxSessionManager sessionManager);
+ /**
+ * 商品库存不足通知
+ *
+ * @param message 消息
+ * @param content 消息原始内容
+ * @param appId appId
+ * @param context 上下文
+ * @param sessionManager session管理器
+ */
+ void stockNoEnough(SpuStockMessage message, final String content, final String appId,
+ final Map context, final WxSessionManager sessionManager);
+
/**
* 类目审核结果
*
@@ -353,6 +367,17 @@ void userCouponUse(UserCouponExpireMessage message, final String content, final
void userCouponUnuse(UserCouponExpireMessage message, final String content, final String appId,
final Map context, final WxSessionManager sessionManager);
+ /**
+ * 发放团购优惠成功回调
+ *
+ * @param message 消息
+ * @param content 消息原始内容
+ * @param appId appId
+ * @param context 上下文
+ * @param sessionManager session管理器
+ */
+ void voucherSendSucc(VoucherMessage message, final String content, final String appId,
+ final Map context, final WxSessionManager sessionManager);
/**
* 结算账户变更回调
*
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java
index ea0ee6c444..0aeabdd7c6 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/impl/BaseWxChannelMessageServiceImpl.java
@@ -23,12 +23,14 @@
import me.chanjar.weixin.channel.bean.message.product.BrandMessage;
import me.chanjar.weixin.channel.bean.message.product.CategoryAuditMessage;
import me.chanjar.weixin.channel.bean.message.product.SpuAuditMessage;
+import me.chanjar.weixin.channel.bean.message.product.SpuStockMessage;
import me.chanjar.weixin.channel.bean.message.sharer.SharerChangeMessage;
import me.chanjar.weixin.channel.bean.message.store.CloseStoreMessage;
import me.chanjar.weixin.channel.bean.message.store.NicknameUpdateMessage;
import me.chanjar.weixin.channel.bean.message.supplier.SupplierItemMessage;
import me.chanjar.weixin.channel.bean.message.vip.ExchangeInfoMessage;
import me.chanjar.weixin.channel.bean.message.vip.UserInfoMessage;
+import me.chanjar.weixin.channel.bean.message.voucher.VoucherMessage;
import me.chanjar.weixin.channel.message.WxChannelMessage;
import me.chanjar.weixin.channel.message.WxChannelMessageRouter;
import me.chanjar.weixin.channel.message.WxChannelMessageRouterRule;
@@ -64,6 +66,8 @@ protected void addDefaultRule() {
this.addRule(SpuAuditMessage.class, PRODUCT_SPU_STATUS_UPDATE, this::spuStatusUpdate);
/* 商品更新 */
this.addRule(SpuAuditMessage.class, PRODUCT_SPU_UPDATE, this::spuUpdate);
+ /* 商品库存不足 */
+ this.addRule(SpuStockMessage.class, PRODUCT_STOCK_NO_ENOUGH, this::stockNoEnough);
/* 类目审核结果 */
this.addRule(CategoryAuditMessage.class, PRODUCT_CATEGORY_AUDIT, this::categoryAudit);
/* 订单下单 */
@@ -106,6 +110,8 @@ protected void addDefaultRule() {
this.addRule(UserCouponExpireMessage.class, USER_COUPON_UNUSE, this::userCouponUnuse);
/* 优惠券返还通知 */
this.addRule(UserCouponExpireMessage.class, USER_COUPON_USE, this::userCouponUse);
+ /* 发放团购优惠成功通知 */
+ this.addRule(VoucherMessage.class, VOUCHER_SEND_SUCC, this::voucherSendSucc);
/* 结算账户变更回调 */
this.addRule(AccountNotifyMessage.class, ACCOUNT_NOTIFY, this::accountNotify);
/* 提现回调 */
@@ -151,6 +157,7 @@ protected void addRule(Class clazz, String event
consumer.accept(message, content, appId, context, sessionManager);
return "success";
});
+ rule.setNext(true);
this.addRule(rule);
}
@@ -242,6 +249,12 @@ public void spuUpdate(SpuAuditMessage message, String content, String appId,
log.info("商品更新:{}", JsonUtils.encode(message));
}
+ @Override
+ public void stockNoEnough(SpuStockMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("商品库存不足:{}", JsonUtils.encode(message));
+ }
+
@Override
public void categoryAudit(CategoryAuditMessage message, String content, String appId,
Map context, WxSessionManager sessionManager) {
@@ -320,6 +333,12 @@ public void userCouponUnuse(UserCouponExpireMessage message, String content, Str
log.info("用户优惠券取消使用:{}", JsonUtils.encode(message));
}
+ @Override
+ public void voucherSendSucc(VoucherMessage message, String content, String appId,
+ Map context, WxSessionManager sessionManager) {
+ log.info("发放团购优惠成功:{}", JsonUtils.encode(message));
+ }
+
@Override
public void accountNotify(AccountNotifyMessage message, String content, String appId,
Map context, WxSessionManager sessionManager) {
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryDetailResult.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryDetailResult.java
index a59559fb6c..32313b7e34 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryDetailResult.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryDetailResult.java
@@ -99,6 +99,10 @@ public static class Attr implements Serializable {
@JsonProperty("size_chart")
private SizeChart sizeChart;
+ /** 放心买必须打开坏损包赔 */
+ @JsonProperty("is_confidence_require_bad_must_pay")
+ private Boolean confidenceRequireBadMustPay;
+
/** 资质信息 */
@JsonProperty("product_qua_list")
private List productQuaList;
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualification.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualification.java
index 40258e067f..9cac327d6c 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualification.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/category/CategoryQualification.java
@@ -39,4 +39,8 @@ public class CategoryQualification implements Serializable {
@JsonProperty("product_qua_list")
private List productQuaList;
+ /** 放心买必须打开坏损包赔 */
+ @JsonProperty("is_confidence_require_bad_must_pay")
+ private Boolean confidenceRequireBadMustPay;
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/product/SpuStockMessage.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/product/SpuStockMessage.java
new file mode 100644
index 0000000000..96feac5a4a
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/product/SpuStockMessage.java
@@ -0,0 +1,88 @@
+package me.chanjar.weixin.channel.bean.message.product;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.Map;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.message.WxChannelMessage;
+
+/**
+ * SPU库存不足消息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JacksonXmlRootElement(localName = "xml")
+public class SpuStockMessage extends WxChannelMessage {
+
+ private static final long serialVersionUID = 2250860804161527363L;
+
+ /** 商品id */
+ @JsonProperty("product_id")
+ @JacksonXmlProperty(localName = "product_id")
+ private String productId;
+
+ /** 平台商品id */
+ @JsonProperty("sku_id")
+ @JacksonXmlProperty(localName = "sku_id")
+ private String skuId;
+
+ /** 剩余库存:当前实时库存数量 */
+ @JsonProperty("remaining_stock_amount")
+ @JacksonXmlProperty(localName = "remaining_stock_amount")
+ private Long remainingStockAmount;
+
+ /** 未发放的预存code数【该字段对code_source_type=2的团购优惠生效,其他类型该字段值为0】 */
+ @JsonProperty("remaining_code_amount")
+ @JacksonXmlProperty(localName = "remaining_code_amount")
+ private Long remainingCodeAmount;
+
+ /** ChannelsEcStockNoEnough */
+ @JsonProperty("channels_ec_stock_no_enough")
+ @JacksonXmlProperty(localName = "channels_ec_stock_no_enough")
+ private void stockNoEnough(Map map) {
+ this.unpackNameFromNestedObject(map);
+ }
+
+ /**
+ * 从嵌套对象中解析字段
+ *
+ * @param map 嵌套对象
+ */
+ protected void unpackNameFromNestedObject(Map map) {
+ if (map == null) {
+ return;
+ }
+ Object obj = null;
+ obj = map.get("product_id");
+ if (obj != null) {
+ this.productId = (obj instanceof String ? (String) obj : String.valueOf(obj));
+ }
+ obj = map.get("sku_id");
+ if (obj != null) {
+ this.skuId = (obj instanceof String ? (String) obj : String.valueOf(obj));
+ }
+
+ obj = map.get("remaining_stock_amount");
+ if (obj != null) {
+ if (obj instanceof Number) {
+ this.remainingStockAmount = ((Number) obj).longValue();
+ } else if (obj instanceof String) {
+ this.remainingStockAmount = Long.parseLong((String) obj);
+ }
+ }
+ obj = map.get("remaining_code_amount");
+ if (obj != null) {
+ if (obj instanceof Number) {
+ this.remainingCodeAmount = ((Number) obj).longValue();
+ } else if (obj instanceof String) {
+ this.remainingCodeAmount = Long.parseLong((String) obj);
+ }
+ }
+ }
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherInfo.java
new file mode 100644
index 0000000000..1b5a926205
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherInfo.java
@@ -0,0 +1,106 @@
+package me.chanjar.weixin.channel.bean.message.voucher;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class VoucherInfo implements Serializable {
+ private static final long serialVersionUID = 6007964849358969438L;
+
+ /** 券code */
+ @JsonProperty("code")
+ @JacksonXmlProperty(localName = "code")
+ private String code;
+
+ /** 劵码类型,1商户实时code 2户预存 3平台生成 */
+ @JsonProperty("code_type")
+ @JacksonXmlProperty(localName = "code_type")
+ private Integer codeType;
+
+ /** 券状态 */
+ @JsonProperty("status")
+ @JacksonXmlProperty(localName = "status")
+ private Integer status;
+
+ /** 发放时间,时间戳 */
+ @JsonProperty("send_time")
+ @JacksonXmlProperty(localName = "send_time")
+ private Long sendTime;
+
+ /** 最近更新时间,时间戳 */
+ @JsonProperty("update_time")
+ @JacksonXmlProperty(localName = "update_time")
+ private Long updateTime;
+
+ /** 核销生效时间,时间戳 */
+ @JsonProperty("start_time")
+ @JacksonXmlProperty(localName = "start_time")
+ private Long startTime;
+
+ /** 核销结束时间,时间戳 */
+ @JsonProperty("end_time")
+ @JacksonXmlProperty(localName = "end_time")
+ private Long endTime;
+
+ /** 核销时间,时间戳。次卡时不返回此字段 */
+ @JsonProperty("consume_time")
+ @JacksonXmlProperty(localName = "consume_time")
+ private Long consumeTime;
+
+ /** 退券时间,时间戳。次卡时不返回此字段 */
+ @JsonProperty("refund_time")
+ @JacksonXmlProperty(localName = "refund_time")
+ private Long refundTime;
+
+ /** 核销门店名称 */
+ @JsonProperty("consume_store_name")
+ @JacksonXmlProperty(localName = "consume_store_name")
+ private String consumeStoreName;
+
+ /** */
+ @JsonProperty("voucher_type")
+ @JacksonXmlProperty(localName = "voucher_type")
+ private Integer voucherType;
+
+ /** 券的售卖价格(分) */
+ @JsonProperty("voucher_buy_amount")
+ @JacksonXmlProperty(localName = "voucher_buy_amount")
+ private Integer voucherBuyAmount;
+
+ /** 券市场金额(分) */
+ @JsonProperty("voucher_actual_amount")
+ @JacksonXmlProperty(localName = "voucher_actual_amount")
+ private Integer voucherActualAmount;
+
+ /** 用户手机号 */
+ @JsonProperty("telphone_no")
+ @JacksonXmlProperty(localName = "telphone_no")
+ private String telPhoneNo;
+
+ /** 商品id */
+ @JsonProperty("product_id")
+ @JacksonXmlProperty(localName = "product_id")
+ private String productId;
+
+ /** 商品下的skuId */
+ @JsonProperty("sku_id")
+ @JacksonXmlProperty(localName = "sku_id")
+ private String skuId;
+
+ /** 购买券的订单id */
+ @JsonProperty("order_id")
+ @JacksonXmlProperty(localName = "order_id")
+ private String orderId;
+
+ /** 用户在商家品牌appid下的openid */
+ @JsonProperty("openid")
+ @JacksonXmlProperty(localName = "openid")
+ private String openId;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherMessage.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherMessage.java
new file mode 100644
index 0000000000..941828969d
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/message/voucher/VoucherMessage.java
@@ -0,0 +1,29 @@
+package me.chanjar.weixin.channel.bean.message.voucher;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.List;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.NoArgsConstructor;
+import me.chanjar.weixin.channel.message.WxChannelMessage;
+
+/**
+ * 发放团购优惠成功消息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@JacksonXmlRootElement(localName = "xml")
+public class VoucherMessage extends WxChannelMessage {
+
+ private static final long serialVersionUID = 975858675917036089L;
+
+ /** 发放团购优惠成功消息 */
+ @JsonProperty("voucher_list")
+ @JacksonXmlProperty(localName = "voucher_list")
+ private List voucherInfo;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderAgentInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderAgentInfo.java
new file mode 100644
index 0000000000..548e36dd49
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderAgentInfo.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.channel.bean.order;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 授权账号信息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class OrderAgentInfo implements Serializable {
+
+ private static final long serialVersionUID = 6396067079343033841L;
+
+ /**
+ * 授权视频号id
+ */
+ @JsonProperty("agent_finder_id")
+ private String agentFinderId;
+
+ /**
+ * 授权视频号昵称
+ */
+ @JsonProperty("agent_finder_nickname")
+ private String agentFinderNickname;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDetailInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDetailInfo.java
index 8a17140cc1..282f2f99f6 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDetailInfo.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderDetailInfo.java
@@ -56,4 +56,12 @@ public class OrderDetailInfo implements Serializable {
@JsonProperty("sku_sharer_infos")
private List skuSharerInfos;
+ /** 授权账号信息 */
+ @JsonProperty("agent_info")
+ private OrderAgentInfo agentInfo;
+
+ /** 订单来源信息 */
+ @JsonProperty("source_info")
+ private OrderSourceInfo sourceInfo;
+
}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSourceInfo.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSourceInfo.java
new file mode 100644
index 0000000000..fbdd663a5a
--- /dev/null
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/bean/order/OrderSourceInfo.java
@@ -0,0 +1,48 @@
+package me.chanjar.weixin.channel.bean.order;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.io.Serializable;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 订单带货来源信息
+ *
+ * @author Zeyes
+ */
+@Data
+@NoArgsConstructor
+public class OrderSourceInfo implements Serializable {
+
+ private static final long serialVersionUID = 3131907659419977296L;
+
+ /**
+ * sku_id
+ */
+ @JsonProperty("sku_id")
+ private String skuId;
+
+ /**
+ * 带货账户类型,1:视频号,2:公众号,3:小程序
+ */
+ @JsonProperty("account_type")
+ private Integer accountType;
+
+ /**
+ * 带货账户id,如果带货账户类型是视频号,此id为视频号id; 如果带货类型为 公众号/小程序, 此id 为对应 公众号/小程序 的appid
+ */
+ @JsonProperty("account_id")
+ private String accountId;
+
+ /**
+ * 销售渠道, 0:关联账号,1:合作账号,100:联盟达人带货
+ */
+ @JsonProperty("sale_channel")
+ private Integer saleChannel;
+
+ /**
+ * 带货账户昵称
+ */
+ @JsonProperty("account_nickname")
+ private String accountNickname;
+}
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
index 0a945b1f35..675b5d8a57 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/constant/MessageEventConstants.java
@@ -16,6 +16,8 @@ public interface MessageEventConstants {
String PRODUCT_SPU_UPDATE = "product_spu_update";
/** 类目审核结果 */
String PRODUCT_CATEGORY_AUDIT = "product_category_audit";
+ /** 库存不足 */
+ String PRODUCT_STOCK_NO_ENOUGH = "channels_ec_stock_no_enough";
/** 订单下单 */
String ORDER_NEW = "channels_ec_order_new";
/** 订单取消 */
@@ -57,6 +59,8 @@ public interface MessageEventConstants {
String USER_COUPON_UNUSE = "channels_ec_user_coupon_unuse";
/** 优惠券核销通知 */
String USER_COUPON_USE = "channels_ec_user_coupon_use";
+ /** 发放团购优惠成功回调 */
+ String VOUCHER_SEND_SUCC = "channels_ec_voucher_send_succ";
// 资金相关
/** 结算账户变更回调 */
String ACCOUNT_NOTIFY = "channels_ec_acct_notify";
diff --git a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
index 16fb0781cb..c35f75ac0b 100644
--- a/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
+++ b/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/message/WxChannelMessageRouter.java
@@ -121,6 +121,7 @@ public Object route(final WxChannelMessage message, final String content, final
final Map context, final WxChannelService service, final WxSessionManager sessionManager) {
// 如果是重复消息,那么就不做处理
if (isMsgDuplicated(message)) {
+ log.info("收到重复消息,{}", content);
return null;
}
@@ -211,10 +212,10 @@ protected String generateMessageId(WxChannelMessage wxMessage) {
*
* @param sessionManager session管理器
* @param message 消息
- * @param sync 是否同步 打印log用
+ * @param async 是否异步 打印log用
*/
- private void sessionEndAccess(WxSessionManager sessionManager, WxChannelMessage message, boolean sync) {
- log.debug("End session access: async={}, sessionId={}", sync, message.getFromUser());
+ private void sessionEndAccess(WxSessionManager sessionManager, WxChannelMessage message, boolean async) {
+ log.debug("End session access: async={}, sessionId={}", async, message.getFromUser());
InternalSession session = ((InternalSessionManager) sessionManager).findSession(message.getFromUser());
if (session != null) {
session.endAccess();
From 05c112309b00a5a1422753e52da3b569fc9e67e2 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Wed, 18 Dec 2024 23:19:15 +0800
Subject: [PATCH 015/276] =?UTF-8?q?:art:=20#3439=20=E3=80=90=E5=85=AC?=
=?UTF-8?q?=E4=BC=97=E5=8F=B7=E3=80=91=E6=A8=A1=E7=89=88=E6=B6=88=E6=81=AF?=
=?UTF-8?q?=E9=95=BF=E5=BA=A6=E9=99=90=E5=88=B6=E9=97=AE=E9=A2=98=E4=BC=98?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mp/bean/template/WxMpTemplateMessage.java | 41 ++++++++++++++-----
.../template/WxMpTemplateMessageTest.java | 26 +++++++++++-
2 files changed, 55 insertions(+), 12 deletions(-)
diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessage.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessage.java
index a04d8bb896..02211937f9 100644
--- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessage.java
+++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessage.java
@@ -1,20 +1,16 @@
package me.chanjar.weixin.mp.bean.template;
+import lombok.*;
+import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
+import org.apache.commons.lang3.StringUtils;
+
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Data;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
-
/**
* 模板消息.
- * 参考 http://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1433751277&token=&lang=zh_CN 发送模板消息接口部分
+ * 参考 发送模板消息接口部分
*
* @author Binary Wang
*/
@@ -67,10 +63,35 @@ public WxMpTemplateMessage addData(WxMpTemplateData datum) {
if (this.data == null) {
this.data = new ArrayList<>();
}
- this.data.add(datum);
+ this.data.add(resetValue(datum));
return this;
}
+ /**
+ * 处理微信模版消息字符串长度问题
+ *
+ * @link 模板消息
+ */
+ private WxMpTemplateData resetValue(WxMpTemplateData datum) {
+ String name = datum.getName();
+ String value = datum.getValue();
+
+ if (StringUtils.startsWith(name, "thing") && value.length() > 20) {
+ value = StringUtils.substring(value, 0, 17) + "...";
+ } else if (StringUtils.startsWith(name, "character_string") && value.length() > 32) {
+ value = StringUtils.substring(value, 0, 29) + "...";
+ } else if (StringUtils.startsWith(name, "phone_number") && value.length() > 17) {
+ value = StringUtils.substring(value, 0, 14) + "...";
+ } else if (StringUtils.startsWith(name, "car_number") && value.length() > 8) {
+ value = StringUtils.substring(value, 0, 5) + "...";
+ } else if (StringUtils.startsWith(name, "const") && value.length() > 20) {
+ value = StringUtils.substring(value, 0, 17) + "...";
+ }
+
+ datum.setValue(value);
+ return datum;
+ }
+
public String toJson() {
return WxMpGsonBuilder.create().toJson(this);
}
diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessageTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessageTest.java
index fa7cd92967..5012be59a8 100644
--- a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessageTest.java
+++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/bean/template/WxMpTemplateMessageTest.java
@@ -17,7 +17,7 @@ public void testToJson() {
WxMpTemplateMessage tm = WxMpTemplateMessage.builder()
.toUser("OPENID")
.templateId("ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY")
- .miniProgram(new WxMpTemplateMessage.MiniProgram("xiaochengxuappid12345", "index?foo=bar",true))
+ .miniProgram(new WxMpTemplateMessage.MiniProgram("xiaochengxuappid12345", "index?foo=bar", true))
.url("http://weixin.qq.com/download")
.clientMsgId("MSG_000001")
.build();
@@ -26,7 +26,29 @@ public void testToJson() {
new WxMpTemplateData("first", "haahah", "#FF00FF"));
tm.addData(
new WxMpTemplateData("remark", "heihei", "#FF00FF"));
- assertEquals(tm.toJson(), "{\"touser\":\"OPENID\",\"template_id\":\"ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY\",\"client_msg_id\":\"MSG_000001\",\"url\":\"http://weixin.qq.com/download\",\"miniprogram\":{\"appid\":\"xiaochengxuappid12345\",\"path\":\"index?foo=bar\"},\"data\":{\"first\":{\"value\":\"haahah\",\"color\":\"#FF00FF\"},\"remark\":{\"value\":\"heihei\",\"color\":\"#FF00FF\"}}}");
+
+ assertEquals("{\"touser\":\"OPENID\",\"template_id\":\"ngqIpbwh8bUfcSsECmogfXcV14J0tQlEpBO27izEYtY\",\"client_msg_id\":\"MSG_000001\",\"url\":\"http://weixin.qq.com/download\",\"miniprogram\":{\"appid\":\"xiaochengxuappid12345\",\"path\":\"index?foo=bar\"},\"data\":{\"first\":{\"value\":\"haahah\",\"color\":\"#FF00FF\"},\"remark\":{\"value\":\"heihei\",\"color\":\"#FF00FF\"}}}", tm.toJson());
}
+ @Test
+ public void testAddData() {
+ WxMpTemplateMessage tm = WxMpTemplateMessage.builder().build()
+ .addData(new WxMpTemplateData("thing01", "张三李四王麻子张三李四王麻子张三李四王麻子张三李四王麻子"))
+ .addData(new WxMpTemplateData("time01", "2019年10月1日 15:01"))
+ .addData(new WxMpTemplateData("character_string01", "1234567890123456789012345678901234567890"))
+ .addData(new WxMpTemplateData("amount01", "¥100.21"))
+ .addData(new WxMpTemplateData("phone_number01", "+86-0766-668888661111"))
+ .addData(new WxMpTemplateData("car_number01", "粤A8Z888挂9"))
+ .addData(new WxMpTemplateData("const01", "支付状态、排队状态、天气状态、物流状态、用药提醒、还款提醒"));
+
+ assertEquals(7, tm.getData().size());
+
+ assertEquals("张三李四王麻子张三李四王麻子张三李...", tm.getData().get(0).getValue());
+ assertEquals("2019年10月1日 15:01", tm.getData().get(1).getValue());
+ assertEquals("12345678901234567890123456789...", tm.getData().get(2).getValue());
+ assertEquals("¥100.21", tm.getData().get(3).getValue());
+ assertEquals("+86-0766-66888...", tm.getData().get(4).getValue());
+ assertEquals("粤A8Z8...", tm.getData().get(5).getValue());
+ assertEquals("支付状态、排队状态、天气状态、物流...", tm.getData().get(6).getValue());
+ }
}
From 29a76bcfae02445c01faba0261ded7dd91a428a3 Mon Sep 17 00:00:00 2001
From: GeXiangDong
Date: Fri, 20 Dec 2024 15:46:13 +0800
Subject: [PATCH 016/276] =?UTF-8?q?:art:=20#3453=20=E3=80=90=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E3=80=91=E4=BF=AE=E5=A4=8D=E5=90=8C=E5=9F=8E?=
=?UTF-8?q?=E9=85=8D=E9=80=81=E6=9F=A5=E8=AF=A2=E8=BF=90=E8=B4=B9=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3=E8=BF=94=E5=9B=9E=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wx/miniapp/api/WxMaIntracityService.java | 2 +-
.../api/impl/WxMaIntracityServiceImpl.java | 5 +-
.../intractiy/WxMaPreAddOrderResponse.java | 63 +++++++++++++++++++
.../impl/WxMaIntracityServiceImpleTest.java | 4 +-
4 files changed, 69 insertions(+), 5 deletions(-)
create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/intractiy/WxMaPreAddOrderResponse.java
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaIntracityService.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaIntracityService.java
index 80cd88b463..4359fc7b1c 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaIntracityService.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaIntracityService.java
@@ -57,7 +57,7 @@ WxMaStoreBalance balanceQuery(String wxStoreId, String serviceTransId, PayMode p
WxMaGetPayModeResponse getPayMode() throws WxErrorException;
/** 查询运费 */
- WxMaAddOrderResponse preAddOrder(WxMaPreAddOrderRequest request) throws WxErrorException;
+ WxMaPreAddOrderResponse preAddOrder(WxMaPreAddOrderRequest request) throws WxErrorException;
/** 创建配送单 */
WxMaAddOrderResponse addOrder(WxMaAddOrderRequest order) throws WxErrorException;
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpl.java
index 46a728eca9..3e21dab79f 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpl.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpl.java
@@ -205,9 +205,10 @@ public WxMaGetPayModeResponse getPayMode() throws WxErrorException {
}
@Override
- public WxMaAddOrderResponse preAddOrder(WxMaPreAddOrderRequest request) throws WxErrorException {
+ public WxMaPreAddOrderResponse preAddOrder(WxMaPreAddOrderRequest request)
+ throws WxErrorException {
String response = this.wxMaService.postWithSignature(Intracity.PRE_ADD_ORDER, request);
- return gson.fromJson(response, WxMaAddOrderResponse.class);
+ return gson.fromJson(response, WxMaPreAddOrderResponse.class);
}
@Override
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/intractiy/WxMaPreAddOrderResponse.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/intractiy/WxMaPreAddOrderResponse.java
new file mode 100644
index 0000000000..f198c81baa
--- /dev/null
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/intractiy/WxMaPreAddOrderResponse.java
@@ -0,0 +1,63 @@
+package cn.binarywang.wx.miniapp.bean.intractiy;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WxMaPreAddOrderResponse {
+ private static final Logger logger = LoggerFactory.getLogger(WxMaPreAddOrderResponse.class);
+
+ /** 运力公司ID */
+ private String serviceTransId;
+
+ /** 配送距离 */
+ private int distance;
+
+ /** 预估配送费 */
+ private int estFee;
+
+ /** 商品预计送达时间 */
+ private long expectedFinishedTime;
+
+ /** 配送时长(单位:分钟) */
+ private int promiseDeliveryTime;
+
+ public String getServiceTransId() {
+ return serviceTransId;
+ }
+
+ public void setServiceTransId(String serviceTransId) {
+ this.serviceTransId = serviceTransId;
+ }
+
+ public int getDistance() {
+ return distance;
+ }
+
+ public void setDistance(int distance) {
+ this.distance = distance;
+ }
+
+ public int getEstFee() {
+ return estFee;
+ }
+
+ public void setEstFee(int estFee) {
+ this.estFee = estFee;
+ }
+
+ public long getExpectedFinishedTime() {
+ return expectedFinishedTime;
+ }
+
+ public void setExpectedFinishedTime(long expectedFinishedTime) {
+ this.expectedFinishedTime = expectedFinishedTime;
+ }
+
+ public int getPromiseDeliveryTime() {
+ return promiseDeliveryTime;
+ }
+
+ public void setPromiseDeliveryTime(int promiseDeliveryTime) {
+ this.promiseDeliveryTime = promiseDeliveryTime;
+ }
+}
diff --git a/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpleTest.java b/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpleTest.java
index 9828542a46..e16fc424c7 100644
--- a/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpleTest.java
+++ b/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaIntracityServiceImpleTest.java
@@ -254,8 +254,8 @@ public void testOrderRelatived() throws Exception {
cargo.setCargoPrice(10000);
cargo.setCargoWeight(1000);
request.setCargo(cargo);
- WxMaAddOrderResponse response = wxService.getIntracityService().preAddOrder(request);
- logger.debug("查询运费返回 {}, 预估运费{}元", response, response.getFee() / 100.0);
+ WxMaPreAddOrderResponse response = wxService.getIntracityService().preAddOrder(request);
+ logger.debug("查询运费返回 {}, 预估运费{}元", response, response.getEstFee() / 100.0);
}
String wxOrderId = null;
{
From 5ece315b87619aa58762560868a16121737bd387 Mon Sep 17 00:00:00 2001
From: Molzx <31435895+Molzx@users.noreply.github.com>
Date: Sat, 21 Dec 2024 14:02:43 +0800
Subject: [PATCH 017/276] =?UTF-8?q?:new:=20#3455=20=E3=80=90=E5=BC=80?=
=?UTF-8?q?=E6=94=BE=E5=B9=B3=E5=8F=B0=E3=80=91=E5=A2=9E=E5=8A=A0=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=AE=A4=E8=AF=81=E5=8F=8A=E5=A4=87=E6=A1=88?=
=?UTF-8?q?=E7=9B=B8=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/open/api/WxOpenMaIcpService.java | 40 +++++++++
.../open/api/impl/WxOpenMaIcpServiceImpl.java | 44 +++++++++-
.../bean/icp/WxOpenApplyIcpFilingParam.java | 3 +-
.../WxOpenIcpCreateIcpVerifyTaskResult.java | 5 ++
.../bean/icp/WxOpenIcpVerifyTaskResult.java | 6 ++
.../bean/icp/WxOpenQueryAuthAndIcpResult.java | 85 +++++++++++++++++++
.../bean/icp/WxOpenSubmitAuthAndIcpParam.java | 29 +++++++
.../icp/WxOpenSubmitAuthAndIcpResult.java | 30 +++++++
.../open/bean/message/WxOpenXmlMessage.java | 19 +++++
9 files changed, 259 insertions(+), 2 deletions(-)
create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenQueryAuthAndIcpResult.java
create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpParam.java
create mode 100644 weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpResult.java
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaIcpService.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaIcpService.java
index ad59b246c7..9b936b1572 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaIcpService.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaIcpService.java
@@ -97,6 +97,19 @@ public interface WxOpenMaIcpService {
*/
String GET_ICP_MEDIA = "https://api.weixin.qq.com/wxa/icp/get_icp_media";
+ /**
+ * 申请小程序认证及备案
+ * https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/wxverifyicp/submitAuthAndIcp.html
+ */
+ String SUBMIT_AUTH_AND_ICP = "https://api.weixin.qq.com/wxa/sec/submit_auth_and_icp";
+
+ /**
+ * 查询小程序认证及备案进度
+ * https://developers.weixin.qq.com/doc/oplatform/openApi/OpenApiDoc/miniprogram-management/wxverifyicp/queryAuthAndIcp.html
+ */
+ String QUERY_AUTH_AND_ICP = "https://api.weixin.qq.com/wxa/sec/query_auth_and_icp";
+
+
/**
* 查询人脸核身任务状态
*
@@ -114,6 +127,15 @@ public interface WxOpenMaIcpService {
*/
WxOpenIcpCreateIcpVerifyTaskResult createIcpVerifyTask() throws WxErrorException;
+ /**
+ * 发起小程序管理员人脸核身
+ *
+ * @param alongWithAuth 小程序认证及备案二合一场景,填 true,否则为小程序备案场景。默认值为 false。
+ * @return 人脸核验任务结果
+ * @throws WxErrorException e
+ */
+ WxOpenIcpCreateIcpVerifyTaskResult createIcpVerifyTask(boolean alongWithAuth) throws WxErrorException;
+
/**
* 上传小程序备案媒体材料
*
@@ -204,4 +226,22 @@ public interface WxOpenMaIcpService {
* @throws WxErrorException e
*/
File getIcpMedia(String mediaId) throws WxErrorException;
+
+ /**
+ * 申请小程序认证及备案
+ *
+ * @param param 参数
+ * @return r
+ * @throws WxErrorException e
+ */
+ WxOpenSubmitAuthAndIcpResult submitAuthAndIcp(WxOpenSubmitAuthAndIcpParam param) throws WxErrorException;
+
+ /**
+ * 查询小程序认证及备案进度
+ * @param procedureId 小程序认证及备案任务流程id
+ * @return r
+ * @throws WxErrorException e
+ */
+ WxOpenQueryAuthAndIcpResult queryAuthAndIcp(String procedureId) throws WxErrorException;
+
}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaIcpServiceImpl.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaIcpServiceImpl.java
index dc78f22fe3..db9654f287 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaIcpServiceImpl.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaIcpServiceImpl.java
@@ -54,7 +54,21 @@ public WxOpenIcpVerifyTaskResult queryIcpVerifyTask(String taskId) throws WxErro
*/
@Override
public WxOpenIcpCreateIcpVerifyTaskResult createIcpVerifyTask() throws WxErrorException {
- String response = wxMaService.post(CREATE_ICP_VERIFY_TASK, "");
+ return createIcpVerifyTask(false);
+ }
+
+ /**
+ * 发起小程序管理员人脸核身
+ *
+ * @param alongWithAuth 小程序认证及备案二合一场景,填 true,否则为小程序备案场景。默认值为 false。
+ * @return 人脸核验任务结果
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxOpenIcpCreateIcpVerifyTaskResult createIcpVerifyTask(boolean alongWithAuth) throws WxErrorException {
+ JsonObject params = new JsonObject();
+ params.addProperty("along_with_auth", alongWithAuth);
+ String response = wxMaService.post(CREATE_ICP_VERIFY_TASK, params);
return WxMaGsonBuilder.create().fromJson(response, WxOpenIcpCreateIcpVerifyTaskResult.class);
}
@@ -212,4 +226,32 @@ public File getIcpMedia(String mediaId) throws WxErrorException {
throw new WxErrorException(WxError.builder().errorMsg(e.getMessage()).build(), e);
}
}
+
+ /**
+ * 申请小程序认证及备案
+ *
+ * @param param 参数
+ * @return r
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxOpenSubmitAuthAndIcpResult submitAuthAndIcp(WxOpenSubmitAuthAndIcpParam param) throws WxErrorException {
+ String response = wxMaService.post(SUBMIT_AUTH_AND_ICP, param);
+ return WxMaGsonBuilder.create().fromJson(response, WxOpenSubmitAuthAndIcpResult.class);
+ }
+
+ /**
+ * 查询小程序认证及备案进度
+ *
+ * @param procedureId 小程序认证及备案任务流程id
+ * @return r
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxOpenQueryAuthAndIcpResult queryAuthAndIcp(String procedureId) throws WxErrorException {
+ JsonObject params = new JsonObject();
+ params.addProperty("procedure_id", procedureId);
+ String response = wxMaService.post(QUERY_AUTH_AND_ICP, params);
+ return WxOpenGsonBuilder.create().fromJson(response, WxOpenQueryAuthAndIcpResult.class);
+ }
}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenApplyIcpFilingParam.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenApplyIcpFilingParam.java
index 37f84cf3d5..ef24a5360c 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenApplyIcpFilingParam.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenApplyIcpFilingParam.java
@@ -2,6 +2,7 @@
import com.google.gson.annotations.SerializedName;
import lombok.*;
+import lombok.experimental.SuperBuilder;
import java.io.Serializable;
import java.util.List;
@@ -12,7 +13,7 @@
* @createTime 2024/08/14 15:09
*/
@Data
-@Builder
+@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class WxOpenApplyIcpFilingParam implements Serializable {
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpCreateIcpVerifyTaskResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpCreateIcpVerifyTaskResult.java
index 8deb401335..967e81fa95 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpCreateIcpVerifyTaskResult.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpCreateIcpVerifyTaskResult.java
@@ -26,4 +26,9 @@ public class WxOpenIcpCreateIcpVerifyTaskResult extends WxOpenResult {
@SerializedName("task_id")
private String taskId;
+ /**
+ * 人脸核验任务url,along_with_auth 填 true 时返回。
+ */
+ @SerializedName("verify_url")
+ private String verifyUrl;
}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpVerifyTaskResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpVerifyTaskResult.java
index cb59fac1c0..5290748b2a 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpVerifyTaskResult.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenIcpVerifyTaskResult.java
@@ -30,4 +30,10 @@ public class WxOpenIcpVerifyTaskResult extends WxOpenResult {
*/
@SerializedName("face_status")
private Integer faceStatus;
+
+ /**
+ * 发起时 along_with_auth 填 true 时有效:9. 认证短信核验通过。
+ */
+ @SerializedName("along_with_auth_result")
+ private Integer alongWithAuthResult;
}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenQueryAuthAndIcpResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenQueryAuthAndIcpResult.java
new file mode 100644
index 0000000000..42a996d9b4
--- /dev/null
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenQueryAuthAndIcpResult.java
@@ -0,0 +1,85 @@
+package me.chanjar.weixin.open.bean.icp;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.*;
+import me.chanjar.weixin.open.bean.result.WxOpenResult;
+
+import java.util.List;
+
+/**
+ * @author xzh
+ * @Description
+ * @createTime 2024/12/19 16:56
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+public class WxOpenQueryAuthAndIcpResult extends WxOpenResult {
+ private static final long serialVersionUID = 1626895037788760364L;
+
+
+ /**
+ * 当前任务流程状态,见下方任务流程状态枚举
+ * 值 含义
+ * 15 等待支付认证审核费用
+ * 16 认证审核费用支付成功
+ * 17 认证审核中
+ * 18 认证审核驳回
+ * 19 认证审核通过
+ * 20 认证审核最终失败(不能再修改)
+ * 21 创建备案审核单失败
+ * 22 备案平台审核中
+ * 23 备案平台审核驳回
+ * 24 备案管局审核中
+ * 25 管局审核驳回
+ * 26 认证及备案完成
+ */
+ @SerializedName("procedure_status")
+ private Integer procedureStatus;
+
+ /**
+ * 小程序后台展示的认证订单号
+ */
+ @SerializedName("orderid")
+ private Long orderId;
+
+ /**
+ * 小程序认证审核单被驳回(procedure_status 为 18)时有效
+ */
+ @SerializedName("refill_reason")
+ private String refillReason;
+ /**
+ * 小程序认证审核最终失败的原因(procedure_status 为 20)时有效
+ */
+ @SerializedName("fail_reason")
+ private String failReason;
+
+ /**
+ * 小程序备案相关信息
+ */
+ @SerializedName("icp_audit")
+ private IcpAudit icpAudit;
+
+ @Data
+ public static class IcpAudit {
+
+ /**
+ * 错误提示,创建备案审核单失败时返回(procedure_status 为 21)
+ */
+ @SerializedName("hints")
+ private List hints;
+
+ /**
+ * 驳回原因,备案不通过时返回(procedure_status 为 23、25)
+ */
+ @SerializedName("audit_data")
+ private List auditData;
+
+ /**
+ * 管局短信核验状态,仅当任务流程状态为 24(备案管局审核中)的时候才有效。1:等待核验中,2:核验完成,3:核验超时。
+ */
+ @SerializedName("sms_verify_status")
+ private Integer smsVerifyStatus;
+ }
+
+}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpParam.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpParam.java
new file mode 100644
index 0000000000..31d4f158f8
--- /dev/null
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpParam.java
@@ -0,0 +1,29 @@
+package me.chanjar.weixin.open.bean.icp;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.SuperBuilder;
+import me.chanjar.weixin.open.bean.auth.MaAuthSubmitParamAuthData;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author xzh
+ * @Description
+ * @createTime 2024/12/19 16:42
+ */
+@Data
+@SuperBuilder
+@NoArgsConstructor
+@AllArgsConstructor
+public class WxOpenSubmitAuthAndIcpParam extends WxOpenApplyIcpFilingParam {
+ private static final long serialVersionUID = -1302523168779484802L;
+
+ /**
+ * 认证信息
+ */
+ @NotNull
+ @SerializedName("auth_data")
+ private MaAuthSubmitParamAuthData authData;
+}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpResult.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpResult.java
new file mode 100644
index 0000000000..53f04412f5
--- /dev/null
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/icp/WxOpenSubmitAuthAndIcpResult.java
@@ -0,0 +1,30 @@
+package me.chanjar.weixin.open.bean.icp;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * @author xzh
+ * @Description
+ * @createTime 2024/12/19 16:47
+ */
+@Getter
+@Setter
+@NoArgsConstructor
+public class WxOpenSubmitAuthAndIcpResult extends WxOpenApplyIcpFilingResult {
+ private static final long serialVersionUID = 2338143380820535842L;
+
+ /**
+ * 小程序认证及备案任务流程 id
+ */
+ @SerializedName("procedure_id")
+ private String procedureId;
+
+ /**
+ * 小程序认证认证审核费用付费链接,当 pay_type 为 2 时返回
+ */
+ @SerializedName("pay_url")
+ private String payUrl;
+}
diff --git a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenXmlMessage.java b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenXmlMessage.java
index dc6839c1a5..df782e6a0c 100644
--- a/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenXmlMessage.java
+++ b/weixin-java-open/src/main/java/me/chanjar/weixin/open/bean/message/WxOpenXmlMessage.java
@@ -140,6 +140,11 @@ public class WxOpenXmlMessage implements Serializable {
*/
@XStreamAlias("result")
private Integer result;
+ /**
+ * 发起时 along_with_auth 填 true 时有效:9. 认证短信核验通过。
+ */
+ @XStreamAlias("along_with_auth_result")
+ private Integer alongWithAuthResult;
//endregion
//region 当备案审核被驳回或通过时会推送该事件 推送的消息 infoType=notify_apply_icpfiling_result
@@ -155,6 +160,20 @@ public class WxOpenXmlMessage implements Serializable {
private Integer beianStatus;
//endregion
+ //region 认证及备案流程的主要节点均有事件推送到第三方平台的授权事件接收接口,包括支付完成、派单给审核机构、审核打回、审核通过、审核失败等。消息类型,固定为 notify_3rd_wxa_auth_and_icp
+
+ /**
+ * 小程序认证及备案任务流程 id
+ */
+ @XStreamAlias("procedure_id")
+ private String procedureId;
+ /**
+ * 当前任务流程状态,见“小程序认证及备案进度查询” API 文档中的任务流程状态枚举
+ */
+ @XStreamAlias("procedure_status")
+ private Integer procedureStatus;
+ //endregion
+
/**
* 快速创建的小程序appId,已弃用,未来将删除
*
From 16f2922fd5f9ff7ab13975fb33498a41219013f8 Mon Sep 17 00:00:00 2001
From: Molzx <31435895+Molzx@users.noreply.github.com>
Date: Tue, 24 Dec 2024 13:19:14 +0800
Subject: [PATCH 018/276] =?UTF-8?q?:new:=20=20#3457=E3=80=90=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E3=80=91=E5=A2=9E=E5=8A=A0=E5=8F=91=E8=B4=A7?=
=?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=AE=A1=E7=90=86=E9=87=8C=E7=9A=84=E7=89=B9?=
=?UTF-8?q?=E6=AE=8A=E5=8F=91=E8=B4=A7=E6=8A=A5=E5=A4=87=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E5=92=8C=E6=9F=A5=E8=AF=A2=E5=B0=8F=E7=A8=8B=E5=BA=8F=E6=98=AF?=
=?UTF-8?q?=E5=90=A6=E5=B7=B2=E5=AE=8C=E6=88=90=E4=BA=A4=E6=98=93=E7=BB=93?=
=?UTF-8?q?=E7=AE=97=E7=AE=A1=E7=90=86=E7=A1=AE=E8=AE=A4=E7=9A=84=E6=8E=A5?=
=?UTF-8?q?=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../miniapp/api/WxMaOrderShippingService.java | 26 +++++++++++---
.../impl/WxMaOrderShippingServiceImpl.java | 33 +++++++++++++++---
.../WxMaOrderShippingITMCCompletedResult.java | 34 +++++++++++++++++++
.../miniapp/constant/WxMaApiUrlConstants.java | 18 ++++++++++
4 files changed, 103 insertions(+), 8 deletions(-)
create mode 100644 weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaOrderShippingITMCCompletedResult.java
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderShippingService.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderShippingService.java
index 322d740d5b..8332ae7af4 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderShippingService.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaOrderShippingService.java
@@ -1,10 +1,7 @@
package cn.binarywang.wx.miniapp.api;
import cn.binarywang.wx.miniapp.bean.shop.request.shipping.*;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoBaseResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetListResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingIsTradeManagedResponse;
+import cn.binarywang.wx.miniapp.bean.shop.response.*;
import me.chanjar.weixin.common.error.WxErrorException;
/**
@@ -86,4 +83,25 @@ WxMaOrderShippingInfoBaseResponse notifyConfirmReceive(WxMaOrderShippingInfoNoti
*/
WxMaOrderShippingInfoBaseResponse setMsgJumpPath(String path)
throws WxErrorException;
+
+ /**
+ * 查询小程序是否已完成交易结算管理确认
+ *
+ * @param appId 待查询小程序的 appid,非服务商调用时仅能查询本账号
+ * @return WxMaOrderShippingITMCCompletedResult
+ * @throws WxErrorException e
+ */
+ WxMaOrderShippingITMCCompletedResult isTradeManagementConfirmationCompleted(String appId)
+ throws WxErrorException;
+
+ /**
+ * 特殊发货报备
+ * @param orderId 需要特殊发货报备的订单号,可传入微信支付单号或商户单号
+ * @param type 特殊发货报备类型,1为预售商品订单,2为测试订单
+ * @param delayTo 预计发货时间的unix时间戳,type为1时必填,type为2可省略
+ * @return WxMaOrderShippingInfoBaseResponse
+ * @throws WxErrorException e
+ */
+ WxMaOrderShippingInfoBaseResponse opSpecialOrder(String orderId, Integer type, Long delayTo)
+ throws WxErrorException;
}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderShippingServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderShippingServiceImpl.java
index 4aee53e15d..98135cb466 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderShippingServiceImpl.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOrderShippingServiceImpl.java
@@ -4,10 +4,7 @@
import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.shop.request.WxMaOrderShippingIsTradeManagedRequest;
import cn.binarywang.wx.miniapp.bean.shop.request.shipping.*;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoBaseResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetListResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingInfoGetResponse;
-import cn.binarywang.wx.miniapp.bean.shop.response.WxMaOrderShippingIsTradeManagedResponse;
+import cn.binarywang.wx.miniapp.bean.shop.response.*;
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import com.google.gson.JsonObject;
import lombok.RequiredArgsConstructor;
@@ -123,6 +120,34 @@ public WxMaOrderShippingInfoBaseResponse setMsgJumpPath(String path) throws WxEr
return request(SET_MSG_JUMP_PATH, jsonObject, WxMaOrderShippingInfoBaseResponse.class);
}
+ /**
+ * 查询小程序是否已完成交易结算管理确认
+ *
+ * @param appId 待查询小程序的 appid,非服务商调用时仅能查询本账号
+ * @return WxMaOrderShippingITMCCompletedResult
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxMaOrderShippingITMCCompletedResult isTradeManagementConfirmationCompleted(String appId) throws WxErrorException {
+ JsonObject jsonObject = GsonHelper.buildJsonObject("appid", appId);
+ return request(IS_TRADE_MANAGEMENT_CONFIRMATION_COMPLETED, jsonObject, WxMaOrderShippingITMCCompletedResult.class);
+ }
+
+ /**
+ * 特殊发货报备
+ *
+ * @param orderId 需要特殊发货报备的订单号,可传入微信支付单号或商户单号
+ * @param type 特殊发货报备类型,1为预售商品订单,2为测试订单
+ * @param delayTo 预计发货时间的unix时间戳,type为1时必填,type为2可省略
+ * @return WxMaOrderShippingInfoBaseResponse
+ * @throws WxErrorException e
+ */
+ @Override
+ public WxMaOrderShippingInfoBaseResponse opSpecialOrder(String orderId, Integer type, Long delayTo) throws WxErrorException {
+ JsonObject jsonObject = GsonHelper.buildJsonObject("order_id", orderId, "type", type, "delay_to", delayTo);
+ return request(OP_SPECIAL_ORDER, jsonObject, WxMaOrderShippingInfoBaseResponse.class);
+ }
+
private T request(String url, Object request, Class resultT) throws WxErrorException {
String responseContent = this.wxMaService.post(url, request);
JsonObject jsonObject = GsonParser.parse(responseContent);
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaOrderShippingITMCCompletedResult.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaOrderShippingITMCCompletedResult.java
new file mode 100644
index 0000000000..e2f352a543
--- /dev/null
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/shop/response/WxMaOrderShippingITMCCompletedResult.java
@@ -0,0 +1,34 @@
+package cn.binarywang.wx.miniapp.bean.shop.response;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author xzh
+ * @Description 小程序是否已完成交易结算管理确认结果
+ * @createTime 2024/12/21 15:01
+ */
+@Data
+public class WxMaOrderShippingITMCCompletedResult implements Serializable {
+
+ private static final long serialVersionUID = -5397007157487018762L;
+ /**
+ * 错误码
+ */
+ @SerializedName("errcode")
+ private Integer errCode;
+
+ /**
+ * 错误原因
+ */
+ @SerializedName("errmsg")
+ private String errMsg;
+
+ /**
+ * 是否已完成交易结算管理确认
+ */
+ @SerializedName("completed")
+ private Boolean completed;
+}
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 ab47d3e64d..5908385790 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
@@ -789,6 +789,24 @@ public interface OrderShipping {
*
*/
String SET_MSG_JUMP_PATH = "https://api.weixin.qq.com/wxa/sec/order/set_msg_jump_path";
+
+ /**
+ * 查询小程序是否已完成交易结算管理确认.
+ *
+ *
+ * 文档地址: https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html#%E5%85%AB%E3%80%81%E6%9F%A5%E8%AF%A2%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%98%AF%E5%90%A6%E5%B7%B2%E5%AE%8C%E6%88%90%E4%BA%A4%E6%98%93%E7%BB%93%E7%AE%97%E7%AE%A1%E7%90%86%E7%A1%AE%E8%AE%A4
+ *
+ */
+ String IS_TRADE_MANAGEMENT_CONFIRMATION_COMPLETED = "https://api.weixin.qq.com/wxa/sec/order/is_trade_management_confirmation_completed";
+ /**
+ * 特殊发货报备.
+ *
+ *
+ * 文档地址:https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/order-shipping/order-shipping.html#%E5%8D%81%E3%80%81%E7%89%B9%E6%AE%8A%E5%8F%91%E8%B4%A7%E6%8A%A5%E5%A4%87
+ *
+ */
+ String OP_SPECIAL_ORDER = "https://api.weixin.qq.com/wxa/sec/order/opspecialorder";
+
}
public interface Vod {
From 8fe1e6ea861fa3c532db705744ea2be0a926fe50 Mon Sep 17 00:00:00 2001
From: Jacky Tse
Date: Tue, 24 Dec 2024 13:21:00 +0800
Subject: [PATCH 019/276] =?UTF-8?q?:new:=20#3452=20=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E6=96=B0=E5=A2=9E=E6=B6=88?=
=?UTF-8?q?=E8=B4=B9=E8=80=85=E6=8A=95=E8=AF=892.0=E7=9A=84=E6=9B=B4?=
=?UTF-8?q?=E6=96=B0=E9=80=80=E6=AC=BE=E5=AE=A1=E6=89=B9=E7=BB=93=E6=9E=9C?=
=?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
---
.../UpdateRefundProgressRequest.java | 90 +++++++++++++++++++
.../wxpay/service/ComplaintService.java | 14 +++
.../service/impl/ComplaintServiceImpl.java | 8 ++
3 files changed, 112 insertions(+)
create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java
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
new file mode 100644
index 0000000000..f7715c522e
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/UpdateRefundProgressRequest.java
@@ -0,0 +1,90 @@
+package com.github.binarywang.wxpay.bean.complaint;
+
+import com.google.gson.annotations.Expose;
+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;
+
+/**
+ * 微信消费者投诉2.0
+ * 更新退款审批结果请求实体
+ *
+ * @author jackytse
+ * created on 2024-12-21
+ */
+@Data
+@Builder(builderMethodName = "newBuilder")
+@NoArgsConstructor
+@AllArgsConstructor
+public class UpdateRefundProgressRequest implements Serializable {
+ private static final long serialVersionUID = 6975811815225228118L;
+
+ /**
+ *
+ * 字段名:投诉单号
+ * 是否必填:是
+ * 描述:投诉单对应的投诉单号
+ *
+ */
+ @SerializedName("complaint_id")
+ @Expose
+ private String complaintId;
+
+ /**
+ *
+ * 字段名:审批动作
+ * 是否必填:是
+ * 描述:同意 或 拒绝
+ * 可选取值:
+ * REJECT: 拒绝退款
+ * APPROVE: 同意退款
+ *
+ */
+ @SerializedName("action")
+ private String action;
+
+ /**
+ *
+ * 字段名:预计发起退款时间
+ * 是否必填:否
+ * 描述:在同意退款时返回,预计将在多少个工作日内能发起退款, 0代表当天
+ *
+ */
+ @SerializedName("launch_refund_day")
+ private Integer launchRefundDay;
+
+ /**
+ *
+ * 字段名:拒绝退款原因
+ * 是否必填:否
+ * 描述:在拒绝退款时返回拒绝退款的原因
+ *
+ */
+ @SerializedName("reject_reason")
+ private String rejectReason;
+
+ /**
+ *
+ * 字段名:拒绝退款的举证图片列表
+ * 是否必填:否
+ * 描述:在拒绝退款时,如果有拒绝的图片举证,可以提供 最多上传4张图片, 传入调用“商户上传反馈图片”接口返回的media_id,最多上传4张图片凭证
+ *
+ */
+ @SerializedName("reject_media_list")
+ private List rejectMediaList;
+
+ /**
+ *
+ * 字段名:备注
+ * 是否必填:否
+ * 描述:任何需要向微信支付客服反馈的信息
+ *
+ */
+ @SerializedName("remark")
+ private String remark;
+}
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 8e86692cd6..66de1458a3 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
@@ -135,6 +135,20 @@ public interface ComplaintService {
*/
void complete(CompleteRequest request) throws WxPayException;
+ /**
+ *
+ * 更新退款审批结果API
+ * 针对“申请退款单”,需要商户明确返回是否可退款的审批结果。
+ * 若根据用户描述,核实可以退款,审批动作传入“APPROVE”,同意退款,并给出一个预计退款时间。传入“同意退款”后,需要额外调退款接口发起原路退款。退款到账后,投诉单的状态将自动扭转为“处理完成”。
+ * 若根据用户描述,核实不能退款,审批动作传入“REJECT”,拒绝退款,并说明拒绝退款原因。驳回退款后,投诉单的状态将自动扭转为“处理完成”。
+ * 文档详见: ...
+ *
+ *
+ * @param request {@link UpdateRefundProgressRequest} 请求数据
+ * @throws WxPayException the wx pay exception
+ */
+ void updateRefundProgress(UpdateRefundProgressRequest request) throws WxPayException;
+
/**
*
* 商户上传反馈图片API
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java
index 51d9609c41..32d57e081e 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java
@@ -112,6 +112,14 @@ public void complete(CompleteRequest request) throws WxPayException {
this.payService.postV3(url, GSON.toJson(request));
}
+ @Override
+ public void updateRefundProgress(UpdateRefundProgressRequest request) throws WxPayException {
+ String url = String.format("%s/v3/merchant-service/complaints-v2/%s/update-refund-progress", this.payService.getPayBaseUrl(), request.getComplaintId());
+ // 上面url已经含有complaintId,这里设置为空,避免在body中再次传递,否则微信会报错
+ request.setComplaintId(null);
+ this.payService.postV3(url, GSON.toJson(request));
+ }
+
@Override
public ImageUploadResult uploadResponseImage(File imageFile) throws WxPayException, IOException {
String url = String.format("%s/v3/merchant-service/images/upload", this.payService.getPayBaseUrl());
From a29e00f00f188c9948e89a492ca9ba7ff4e6b73e Mon Sep 17 00:00:00 2001
From: junbaor
Date: Fri, 3 Jan 2025 14:23:20 +0800
Subject: [PATCH 020/276] =?UTF-8?q?:art:=20#3461=E3=80=90=E5=B0=8F?=
=?UTF-8?q?=E7=A8=8B=E5=BA=8F=E3=80=91spring=20boot=20starter=20=E5=92=8C?=
=?UTF-8?q?=20solon=20plugin=20=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96?=
=?UTF-8?q?=E7=A8=B3=E5=AE=9A=E7=89=88=E6=8E=A5=E5=8F=A3=E8=B0=83=E7=94=A8?=
=?UTF-8?q?=E5=87=AD=E6=8D=AE=E7=9A=84=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../storage/AbstractWxMaConfigStorageConfiguration.java | 1 +
.../solon/wxjava/miniapp/properties/WxMaProperties.java | 5 +++++
.../wx-java-miniapp-spring-boot-starter/README.md | 3 ++-
.../storage/AbstractWxMaConfigStorageConfiguration.java | 1 +
.../starter/wxjava/miniapp/properties/WxMaProperties.java | 5 +++++
5 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java b/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
index 9cc4fe161b..acc147a705 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
@@ -15,6 +15,7 @@ protected WxMaDefaultConfigImpl config(WxMaDefaultConfigImpl config, WxMaPropert
config.setToken(StringUtils.trimToNull(properties.getToken()));
config.setAesKey(StringUtils.trimToNull(properties.getAesKey()));
config.setMsgDataFormat(StringUtils.trimToNull(properties.getMsgDataFormat()));
+ config.useStableAccessToken(properties.isUseStableAccessToken());
WxMaProperties.ConfigStorage configStorageProperties = properties.getConfigStorage();
config.setHttpProxyHost(configStorageProperties.getHttpProxyHost());
diff --git a/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaProperties.java b/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaProperties.java
index 5a993cf667..1c3e495f4e 100644
--- a/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaProperties.java
+++ b/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/properties/WxMaProperties.java
@@ -45,6 +45,11 @@ public class WxMaProperties {
*/
private String msgDataFormat;
+ /**
+ * 是否使用稳定版 Access Token
+ */
+ private boolean useStableAccessToken = false;
+
/**
* 存储策略
*/
diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md
index 82f6bdd8b1..cbf0b53925 100644
--- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md
+++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md
@@ -10,12 +10,13 @@
```
2. 添加配置(application.properties)
```properties
- # 公众号配置(必填)
+ # 小程序配置(必填)
wx.miniapp.appid = appId
wx.miniapp.secret = @secret
wx.miniapp.token = @token
wx.miniapp.aesKey = @aesKey
wx.miniapp.msgDataFormat = @msgDataFormat # 消息格式,XML或者JSON.
+ wx.miniapp.use-stable-access-token=@useStableAccessToken
# 存储配置redis(可选)
# 注意: 指定redis.host值后不会使用容器注入的redis连接(JedisPool)
wx.miniapp.config-storage.type = Jedis # 配置类型: Memory(默认), Jedis, RedisTemplate
diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
index 6f44ac27ee..fef0824767 100644
--- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
+++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/config/storage/AbstractWxMaConfigStorageConfiguration.java
@@ -15,6 +15,7 @@ protected WxMaDefaultConfigImpl config(WxMaDefaultConfigImpl config, WxMaPropert
config.setToken(StringUtils.trimToNull(properties.getToken()));
config.setAesKey(StringUtils.trimToNull(properties.getAesKey()));
config.setMsgDataFormat(StringUtils.trimToNull(properties.getMsgDataFormat()));
+ config.useStableAccessToken(properties.isUseStableAccessToken());
WxMaProperties.ConfigStorage configStorageProperties = properties.getConfigStorage();
config.setHttpProxyHost(configStorageProperties.getHttpProxyHost());
diff --git a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java
index b7ccb45374..b6384aabd2 100644
--- a/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java
+++ b/spring-boot-starters/wx-java-miniapp-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/miniapp/properties/WxMaProperties.java
@@ -44,6 +44,11 @@ public class WxMaProperties {
*/
private String msgDataFormat;
+ /**
+ * 是否使用稳定版 Access Token
+ */
+ private boolean useStableAccessToken = false;
+
/**
* 存储策略
*/
From 6decd2839b9a591043dea37c0e600490035ce8f9 Mon Sep 17 00:00:00 2001
From: Binary Wang
Date: Fri, 3 Jan 2025 20:34:55 +0800
Subject: [PATCH 021/276] =?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 ab645b7c4f..f55394ef60 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 022/276] =?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 8af0626b92..344418e318 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 023/276] =?UTF-8?q?:art:=E3=80=90=E4=BC=81=E4=B8=9A?=
=?UTF-8?q?=E5=BE=AE=E4=BF=A1=E3=80=91=E4=BC=9A=E8=AF=9D=E5=86=85=E5=AE=B9?=
=?UTF-8?q?=E5=AD=98=E6=A1=A3=20-=20=E8=A7=A3=E5=AF=86=E5=90=8E=E7=9A=84?=
=?UTF-8?q?=E4=BC=9A=E8=AF=9D=E5=86=85=E5=AE=B9=E5=AE=9E=E4=BD=93=E7=B1=BB?=
=?UTF-8?q?=E9=87=8C=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99=E7=9A=84=E5=AD=97?=
=?UTF-8?q?=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 d843cad6cf..8a9d2130d6 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 024/276] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.1?=
=?UTF-8?q?.B=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 730f6b5809..9f0362816d 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 bf956526c8..9e52bec0ca 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 aa9911e115..687ac3e998 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 dda371c780..bc8c46627b 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 d2218490b9..5787c42ee4 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 05598d6b9c..7c39166d1f 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 deca9a2ffa..7740ce99c4 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 5075140322..8654c698ed 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 67f9e2da37..1bb1960151 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 5dcea9ac93..f2925cd1a2 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 bd8c9e3e45..87d5c08c40 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 47153d8f13..bfc53597df 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 b5488655ec..e95b835109 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 75f2d94865..3f5839696c 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 b67cc1733e..e8dde09746 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 4a4567198c..6a63849e64 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 0128c7bf52..65419e065e 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 59c2f63f8a..73e70ce07a 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 c90f2b741d..74e5082e30 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 2eaa6f1c77..b2495d9d77 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 3ec7cf5163..48bf3c4837 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 4bc7037c22..4d0b88794a 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 cd6f25e892..6505cafac6 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 960556dad7..96c6e8b7ae 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 5fe49991e1..e735cb82d1 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 44c7c952fe..7f2eb89e43 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 0cb27642ab..c1fe4637d4 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 b775fab23b..7cfce1c1aa 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 85a37ba2f9..e3a64d0006 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 a9bb5f37dc..5b85813dcf 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 c8c3f298c8..ffb3eae284 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 0146f516ad..58ecb292d2 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 cba2ede006..1c64b458f2 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 31a0c21dc0..25718264fe 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 025/276] =?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 0000000000..80709a1022
--- /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 0000000000..230e564e4b
--- /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 0000000000..9f7aac7fbb
--- /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 ebf746214d..c02430a960 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 57c2937c62..19b4ed0a07 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 c9fc1e7bd2..7c2055cec3 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 e62dc9c053..23bf7b13ee 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 7f89bd4721..cd607dff03 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 026/276] =?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 b95061461c..d77522ecce 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 027/276] =?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 2a497d15fc..d10594a546 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 1a00baad0f..91ee8b7cde 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 0000000000..58daeb007c
--- /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 0000000000..939e6819a0
--- /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 0000000000..ac4681038c
--- /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 0000000000..9c99b2688e
--- /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 0000000000..4cd198409a
--- /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 0000000000..12969cdcdb
--- /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 0000000000..100c5bb137
--- /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 028/276] =?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 0000000000..d82cfd19cc
--- /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 9d55df3797..a5446361a3 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 344418e318..aa7b061fb1 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 0000000000..7fcf73f5a3
--- /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 0000000000..02c53a53f8
--- /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 0000000000..5a903b8980
--- /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 5908385790..d61ade73c3 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 029/276] =?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 e2b6d43fa1..7fd7939797 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 030/276] =?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 26cfe3a019..a92bfcc100 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 fac1689e08..58bf20873f 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 b53f7549d7..dfb38a5243 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 0000000000..da1cc25542
--- /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 031/276] =?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 293c52eac6..8cbf954ee2 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 032/276] =?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 19b4ed0a07..8ceac2b6ba 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 7c2055cec3..1fa2f8dc80 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 033/276] =?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 0000000000..9e59fecf73
--- /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 0000000000..2e24a4a3c6
--- /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 9f7aac7fbb..78e0aec6ab 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 819cdfe731..e8a6b6acb3 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 c02430a960..01113c9506 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 23bf7b13ee..f43c887c16 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 cd607dff03..10c2a5da66 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 034/276] =?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 d2695959e8..6820d103b8 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 078ad51570..684211659f 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 035/276] =?UTF-8?q?:art:=E3=80=90=E5=BE=AE=E4=BF=A1?=
=?UTF-8?q?=E6=94=AF=E4=BB=98=E3=80=91spring-boot-starter=E6=A8=A1?=
=?UTF-8?q?=E5=9D=97=E5=A2=9E=E5=8A=A0=E5=85=AC=E9=92=A5ID=E5=92=8C?=
=?UTF-8?q?=E8=AF=81=E4=B9=A6=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E7=AD=89?=
=?UTF-8?q?=E9=85=8D=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 9a9672de1a..e401a8cfba 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 232bd33c47..a1a8cc2297 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 036/276] =?UTF-8?q?:bookmark:=20=E5=8F=91=E5=B8=83=204.7.2?=
=?UTF-8?q?.B=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 9f0362816d..c7c40521b5 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 9e52bec0ca..9585e96179 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 687ac3e998..a9b794a965 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 bc8c46627b..4e0dc723a8 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 5787c42ee4..9cf2b31724 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 7c39166d1f..46266b8e80 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 7740ce99c4..1e5dab26b6 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 8654c698ed..805018b81d 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 1bb1960151..4ccc4fa7d7 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 f2925cd1a2..3aa2b9be41 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 87d5c08c40..355ef6f939 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 bfc53597df..6357cc908b 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 e95b835109..4ff6dba008 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 3f5839696c..c5cb2954d3 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 e8dde09746..dca311c015 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 6a63849e64..8f427c6d03 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 65419e065e..6ea0eb005f 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 73e70ce07a..fdbe3d1e54 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 74e5082e30..cedde81744 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 b2495d9d77..fba6da9e0a 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 48bf3c4837..867f570558 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 4d0b88794a..cddf39300b 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 6505cafac6..189ff94672 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 96c6e8b7ae..d4de4e77f8 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 e735cb82d1..e118aba652 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 7f2eb89e43..338a22a564 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 c1fe4637d4..8d34754cb3 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 7cfce1c1aa..e89234d17a 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 e3a64d0006..467ba98858 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 5b85813dcf..cfe52b9686 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 ffb3eae284..0aecd36da2 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 58ecb292d2..f7fac62e64 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 1c64b458f2..6eeb06624e 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 25718264fe..737af413d2 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 037/276] =?UTF-8?q?:new:=20#3488=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=E8=8E=B7?=
=?UTF-8?q?=E5=8F=96=E4=BC=81=E4=B8=9A=E5=B7=B2=E9=85=8D=E7=BD=AE=E7=9A=84?=
=?UTF-8?q?=E3=80=8C=E8=81=94=E7=B3=BB=E6=88=91=E3=80=8D=E5=88=97=E8=A1=A8?=
=?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
---
.../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 f55d2f7b93..c886fcab61 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 c2fbdfe6ef..8e3a8d7b95 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 0000000000..04918f64e4
--- /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 dfb38a5243..3aecf72120 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 c629165ca4..4bd80928bd 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 038/276] =?UTF-8?q?:art:=20#3490=E3=80=90=E5=BE=AE?=
=?UTF-8?q?=E4=BF=A1=E6=94=AF=E4=BB=98=E3=80=91=E6=B6=88=E8=B4=B9=E8=80=85?=
=?UTF-8?q?=E6=8A=95=E8=AF=89=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=E8=A1=A5?=
=?UTF-8?q?=E5=85=85=E6=9C=80=E6=96=B0=E5=A2=9E=E5=8A=A0=E7=9A=84=E4=B8=80?=
=?UTF-8?q?=E4=BA=9B=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 157e095bba..f8562dce39 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 2da216446d..7c8738fe29 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 6f582b9301..470f2bed11 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 f7715c522e..79668bd0ce 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 a5d18df6df..9464144c1d 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 66de1458a3..6fc1367cf4 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 {
/**
*