From 37a2a2bd7ddc9b3aefc86e58980613dddf48c7f0 Mon Sep 17 00:00:00 2001
From: zhangyl
+ * 该类是订阅通知的通用结构,每个字段代表的含义和订阅类型有关。请依据文档自行判断使用。
+ *
+ * 唯一标记本次管控动作的ID,可用来和“管控流水订阅通知”中的“业务单号”做关联
+ *
+ * 若商户被管控时会返回
+ *
+ * 被管控的原因,若商户被管控时会返回 + *
+ */ + @SerializedName("limitation_reason") + private String limitationReason; + /** + * 商户被管控原因描述 + *+ * 在该原因下,被管控的原因描述,若商户被管控时会返回 + *
+ */ + @SerializedName("limitation_reason_describe") + private String limitationReasonDescribe; + /** + * 商户被该原因管控的能力列表 + *+ * 在该原因下,若商户以下能力被管控时会返回 + *
+ * 在该原因下,若商户除了relate_limitations所罗列的被管控能力,还有其他被管控的能力时会返回(如有多项以英文逗号分隔) + *
+ */ + @SerializedName("other_relate_limitations") + private String otherRelateLimitations; + + /** + * 商户被该原因管控的解脱路径 + *+ * 在该原因下,若存在解脱路径时会返回 + *
+ * 若解脱路径recover_way为“填写尽调信息”、“补充受益所有人信息”,需通过提交尽调来解脱,此处会返回“尽调单号”;若解脱路径recover_way + * 为“提交相关信息申诉”,需通过提交资料来解脱,此处会返回“商户管理记录单号”;若解脱路径recover_way为“联系有权机关咨询”,此处会返回有权机关信息 + *
+ */ + @SerializedName("recover_way_param") + private String recoverWayParam; + + /** + * 商户被该原因管控的解脱帮助链接 + *+ * 在该原因下,若存在解脱帮助说明时会返回 + *
+ */ + @SerializedName("recover_help_url") + private String recoverHelpUrl; + + /** + * 处置方式 + *+ * 管控处置方式类型,默认是立即管控 + *
+ * 若商户被管控时会返回,延迟管控但是未到管控时间时不会返回 + *
+ */ + @SerializedName("limitation_date") + private String limitationDate; + + } +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/MerchantLimitationService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/MerchantLimitationService.java new file mode 100644 index 0000000000..bc3753cce5 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/MerchantLimitationService.java @@ -0,0 +1,28 @@ +package com.github.binarywang.wxpay.service; + +import com.github.binarywang.wxpay.bean.merchantlimitation.MerchantLimitationResult; +import com.github.binarywang.wxpay.exception.WxPayException; + +/** + * 商户被管控能力及原因查询 接口 + *+ * 产品介绍 + *
+ * + * @author zhangyl + */ +public interface MerchantLimitationService { + + /** + * 查询子商户管控情况 + *+ * 接口文档 + *
+ * + * @param subMchId 子商户号 + * @return 子商户管控情况 + * @throws WxPayException the wx pay exception + */ + MerchantLimitationResult fetchLimitations(String subMchId) 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 277613b804..a460d5f248 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 @@ -400,6 +400,13 @@ default WxPayService switchoverTo(String mchIdOrConfigKey) { */ void setEntPayService(EntPayService entPayService); + /** + * 获取商户被管控能力及原因查询接口 + * + * @return MerchantLimitationService + */ + MerchantLimitationService getMerchantLimitationService(); + /** *
* 查询订单.
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 6aff122c9e..6868cb644f 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
@@ -143,6 +143,9 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
@Getter
private final MiPayService miPayService = new MiPayServiceImpl(this);
+ @Getter
+ private final MerchantLimitationService merchantLimitationService = new MerchantLimitationServiceImpl(this);
+
protected Map configMap = new ConcurrentHashMap<>();
@Override
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/MerchantLimitationServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/MerchantLimitationServiceImpl.java
new file mode 100644
index 0000000000..d946336e31
--- /dev/null
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/MerchantLimitationServiceImpl.java
@@ -0,0 +1,28 @@
+package com.github.binarywang.wxpay.service.impl;
+
+import com.github.binarywang.wxpay.bean.merchantlimitation.MerchantLimitationResult;
+import com.github.binarywang.wxpay.exception.WxPayException;
+import com.github.binarywang.wxpay.service.MerchantLimitationService;
+import com.github.binarywang.wxpay.service.WxPayService;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * 商户被管控能力及原因查询 接口实现
+ *
+ * @author zhangyl
+ */
+@RequiredArgsConstructor
+public class MerchantLimitationServiceImpl implements MerchantLimitationService {
+ private final WxPayService payService;
+ private static final Gson GSON = new GsonBuilder().create();
+
+ @Override
+ public MerchantLimitationResult fetchLimitations(String subMchId) throws WxPayException {
+ String url = String.format("%s/v3/mch-operation-manage/merchant-limitations/sub-mchid/%s",
+ this.payService.getPayBaseUrl(), subMchId);
+ String result = this.payService.getV3(url);
+ return GSON.fromJson(result, MerchantLimitationResult.class);
+ }
+}
From 9815c06a989d161c7a53e282bfd0106fb185f6cf Mon Sep 17 00:00:00 2001
From: zhangyl
Date: Mon, 11 May 2026 20:10:02 +0800
Subject: [PATCH 3/3] =?UTF-8?q?style:=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../MerchantLimitationResult.java | 296 +++++++++---------
1 file changed, 148 insertions(+), 148 deletions(-)
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/merchantlimitation/MerchantLimitationResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/merchantlimitation/MerchantLimitationResult.java
index 34f5867be5..6c0f31d41c 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/merchantlimitation/MerchantLimitationResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/merchantlimitation/MerchantLimitationResult.java
@@ -14,170 +14,170 @@
*/
@Data
public class MerchantLimitationResult implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 商户ID
+ */
+ @SerializedName("mchid")
+ private String mchId;
+ /**
+ * 商户被管控能力列表
+ */
+ @SerializedName("limited_functions")
+ private List limitedFunctions;
+ /**
+ * 商户其他被管控能力描述
+ */
+ @SerializedName("other_limited_functions")
+ private String otherLimitedFunctions;
+ /**
+ * 被管控原因及解脱路径列表
+ */
+ @SerializedName("recovery_specifications")
+ private List recoverySpecifications;
+
+ @Data
+ @NoArgsConstructor
+ public static class RecoverySpecification implements Serializable {
private static final long serialVersionUID = 1L;
/**
- * 商户ID
+ * 商户被该原因管控的单据号
+ *
+ * 唯一标记本次管控动作的ID,可用来和“管控流水订阅通知”中的“业务单号”做关联
+ *
*/
- @SerializedName("mchid")
- private String mchId;
+ @SerializedName("limitation_case_id")
+ private String limitationCaseId;
/**
- * 商户被管控能力列表
+ * 商户被管控原因类型
+ *
+ * 若商户被管控时会返回
+ *
LICENSE_ABNORMAL:经营证照异常
+ * NO_TRADE:无交易
+ * SETTLE_ACCOUNT_ABNORMAL:结算信息异常
+ * RISK_ABNORMAL:风险异常
+ * OTHER:其他
+ * INSPECT_ABNORMAL:巡检异常
+ * INVALID_REPRESENTATIVE_INFORMATION:法定代表人/负责人资料异常
+ * INVALID_BUSINESS_STATUS:经营状态异常
+ * INVALID_BUSINESS_LICENSE:经营证照资料异常
+ * INVALID_BENEFICIARY_INFORMATION:受益所有人资料异常
+ *
*/
- @SerializedName("limited_functions")
- private List limitedFunctions;
+ @SerializedName("limitation_reason_type")
+ private String limitationReasonType;
/**
- * 商户其他被管控能力描述
+ * 商户被管控原因
+ *
+ * 被管控的原因,若商户被管控时会返回
+ *
*/
- @SerializedName("other_limited_functions")
- private String otherLimitedFunctions;
+ @SerializedName("limitation_reason")
+ private String limitationReason;
/**
- * 被管控原因及解脱路径列表
+ * 商户被管控原因描述
+ *
+ * 在该原因下,被管控的原因描述,若商户被管控时会返回
+ *
*/
- @SerializedName("recovery_specifications")
- private List recoverySpecifications;
-
- @Data
- @NoArgsConstructor
- public static class RecoverySpecification implements Serializable {
- private static final long serialVersionUID = 1L;
-
- /**
- * 商户被该原因管控的单据号
- *
- * 唯一标记本次管控动作的ID,可用来和“管控流水订阅通知”中的“业务单号”做关联
- *
- */
- @SerializedName("limitation_case_id")
- private String limitationCaseId;
- /**
- * 商户被管控原因类型
- *
- * 若商户被管控时会返回
- *
LICENSE_ABNORMAL:经营证照异常
- * NO_TRADE:无交易
- * SETTLE_ACCOUNT_ABNORMAL:结算信息异常
- * RISK_ABNORMAL:风险异常
- * OTHER:其他
- * INSPECT_ABNORMAL:巡检异常
- * INVALID_REPRESENTATIVE_INFORMATION:法定代表人/负责人资料异常
- * INVALID_BUSINESS_STATUS:经营状态异常
- * INVALID_BUSINESS_LICENSE:经营证照资料异常
- * INVALID_BENEFICIARY_INFORMATION:受益所有人资料异常
- *
- */
- @SerializedName("limitation_reason_type")
- private String limitationReasonType;
- /**
- * 商户被管控原因
- *
- * 被管控的原因,若商户被管控时会返回
- *
- */
- @SerializedName("limitation_reason")
- private String limitationReason;
- /**
- * 商户被管控原因描述
- *
- * 在该原因下,被管控的原因描述,若商户被管控时会返回
- *
- */
- @SerializedName("limitation_reason_describe")
- private String limitationReasonDescribe;
- /**
- * 商户被该原因管控的能力列表
- *
- * 在该原因下,若商户以下能力被管控时会返回
- *
NO_TRANSACTION_AND_RECHARGE:关闭收单和充值
- * NO_PAYMENT:关闭付款
- * NO_WITHDRAWAL:关闭提现
- * NO_REFUND:关闭退款
- * NO_TRANSACTION:关闭收单
- * NO_PROFIT_SHARING:关闭分账分出
- * NO_PAYMENT_POINT_COMPLETE_ORDER:关闭支付分服务结单
- *
- */
- @SerializedName("relate_limitations")
- private List relateLimitations;
+ @SerializedName("limitation_reason_describe")
+ private String limitationReasonDescribe;
+ /**
+ * 商户被该原因管控的能力列表
+ *
+ * 在该原因下,若商户以下能力被管控时会返回
+ *
NO_TRANSACTION_AND_RECHARGE:关闭收单和充值
+ * NO_PAYMENT:关闭付款
+ * NO_WITHDRAWAL:关闭提现
+ * NO_REFUND:关闭退款
+ * NO_TRANSACTION:关闭收单
+ * NO_PROFIT_SHARING:关闭分账分出
+ * NO_PAYMENT_POINT_COMPLETE_ORDER:关闭支付分服务结单
+ *
+ */
+ @SerializedName("relate_limitations")
+ private List relateLimitations;
- /**
- * 商户被该原因管控的其他能力描述
- *
- * 在该原因下,若商户除了relate_limitations所罗列的被管控能力,还有其他被管控的能力时会返回(如有多项以英文逗号分隔)
- *
- */
- @SerializedName("other_relate_limitations")
- private String otherRelateLimitations;
+ /**
+ * 商户被该原因管控的其他能力描述
+ *
+ * 在该原因下,若商户除了relate_limitations所罗列的被管控能力,还有其他被管控的能力时会返回(如有多项以英文逗号分隔)
+ *
+ */
+ @SerializedName("other_relate_limitations")
+ private String otherRelateLimitations;
- /**
- * 商户被该原因管控的解脱路径
- *
- * 在该原因下,若存在解脱路径时会返回
- *
IRRECOVERABLE:不可恢复
- * MODIFY_SUBJECT_INFORMATION:修改主体资料
- * MODIFY_SETTLE_ACCOUNT_INFORMATION:修改结算银行账户
- * VERIFY_INACTIVE_MERCHANT_IDENTITY:核实商户身份
- * SUBMIT_OFFLINE_BUSINESS_SCENARIO_INFORMATION:提交线下经营场景信息
- * SUBMIT_INFORMATION_FOR_APPEAL:提交相关信息申诉
- * RESOLVE_TRANSACTION_DISPUTES:解决交易纠纷
- * MODIFY_ADMINISTRATOR_INFORMATION:修改超级管理员
- * CALL_CUSTOMER_SERVICE_AT_95017:拨打微信支付客服电话95017
- * UPDATE_BUSINESS_SCENARIO_INFORMATION:更新经营场景信息
- * SUBMIT_CDD_INFORMATION:填写尽调信息
- * WAITING_FOR_PLATFORM_REVIEW:等待平台审核
- * SUBMIT_UBO_INFORMATION:补充受益所有人信息
- * SIGN_ANTI_FRAUD_PLEDGE_AND_VERIFY_FACE:签署反诈承诺书并刷脸核实身份
- * CONTACT_APPROPRIATE_AUTHORITY_FOR_CONSULTATION:联系有权机关咨询
- * MODIFY_ABBREVIATION_INFORMATION:修改商户简称
- *
- */
- @SerializedName("recover_way")
- private String recoverWay;
+ /**
+ * 商户被该原因管控的解脱路径
+ *
+ * 在该原因下,若存在解脱路径时会返回
+ *
IRRECOVERABLE:不可恢复
+ * MODIFY_SUBJECT_INFORMATION:修改主体资料
+ * MODIFY_SETTLE_ACCOUNT_INFORMATION:修改结算银行账户
+ * VERIFY_INACTIVE_MERCHANT_IDENTITY:核实商户身份
+ * SUBMIT_OFFLINE_BUSINESS_SCENARIO_INFORMATION:提交线下经营场景信息
+ * SUBMIT_INFORMATION_FOR_APPEAL:提交相关信息申诉
+ * RESOLVE_TRANSACTION_DISPUTES:解决交易纠纷
+ * MODIFY_ADMINISTRATOR_INFORMATION:修改超级管理员
+ * CALL_CUSTOMER_SERVICE_AT_95017:拨打微信支付客服电话95017
+ * UPDATE_BUSINESS_SCENARIO_INFORMATION:更新经营场景信息
+ * SUBMIT_CDD_INFORMATION:填写尽调信息
+ * WAITING_FOR_PLATFORM_REVIEW:等待平台审核
+ * SUBMIT_UBO_INFORMATION:补充受益所有人信息
+ * SIGN_ANTI_FRAUD_PLEDGE_AND_VERIFY_FACE:签署反诈承诺书并刷脸核实身份
+ * CONTACT_APPROPRIATE_AUTHORITY_FOR_CONSULTATION:联系有权机关咨询
+ * MODIFY_ABBREVIATION_INFORMATION:修改商户简称
+ *
+ */
+ @SerializedName("recover_way")
+ private String recoverWay;
- /**
- * 商户被该原因管控的解脱路径参数
- *
- * 若解脱路径recover_way为“填写尽调信息”、“补充受益所有人信息”,需通过提交尽调来解脱,此处会返回“尽调单号”;若解脱路径recover_way
- * 为“提交相关信息申诉”,需通过提交资料来解脱,此处会返回“商户管理记录单号”;若解脱路径recover_way为“联系有权机关咨询”,此处会返回有权机关信息
- *
- */
- @SerializedName("recover_way_param")
- private String recoverWayParam;
+ /**
+ * 商户被该原因管控的解脱路径参数
+ *
+ * 若解脱路径recover_way为“填写尽调信息”、“补充受益所有人信息”,需通过提交尽调来解脱,此处会返回“尽调单号”;若解脱路径recover_way
+ * 为“提交相关信息申诉”,需通过提交资料来解脱,此处会返回“商户管理记录单号”;若解脱路径recover_way为“联系有权机关咨询”,此处会返回有权机关信息
+ *
+ */
+ @SerializedName("recover_way_param")
+ private String recoverWayParam;
- /**
- * 商户被该原因管控的解脱帮助链接
- *
- * 在该原因下,若存在解脱帮助说明时会返回
- *
- */
- @SerializedName("recover_help_url")
- private String recoverHelpUrl;
+ /**
+ * 商户被该原因管控的解脱帮助链接
+ *
+ * 在该原因下,若存在解脱帮助说明时会返回
+ *
+ */
+ @SerializedName("recover_help_url")
+ private String recoverHelpUrl;
- /**
- * 处置方式
- *
- * 管控处置方式类型,默认是立即管控
- *
LIMIT_ACTION_TYPE_IMMEDIATE_CONTROL:立即管控
- * LIMIT_ACTION_TYPE_DELAY_CONTROL:延迟管控
- *
- */
- @SerializedName("limitation_action_type")
- private String limitationActionType;
+ /**
+ * 处置方式
+ *
+ * 管控处置方式类型,默认是立即管控
+ *
LIMIT_ACTION_TYPE_IMMEDIATE_CONTROL:立即管控
+ * LIMIT_ACTION_TYPE_DELAY_CONTROL:延迟管控
+ *
+ */
+ @SerializedName("limitation_action_type")
+ private String limitationActionType;
- /**
- * 预计管控开始时间
- */
- @SerializedName("limitation_start_date")
- private String limitationStartDate;
+ /**
+ * 预计管控开始时间
+ */
+ @SerializedName("limitation_start_date")
+ private String limitationStartDate;
- /**
- * 商户被该原因管控的时间
- *
- * 若商户被管控时会返回,延迟管控但是未到管控时间时不会返回
- *
- */
- @SerializedName("limitation_date")
- private String limitationDate;
+ /**
+ * 商户被该原因管控的时间
+ *
+ * 若商户被管控时会返回,延迟管控但是未到管控时间时不会返回
+ *
+ */
+ @SerializedName("limitation_date")
+ private String limitationDate;
- }
+ }
}