-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
新增合作伙伴订阅通知解析,商户被管控能力及原因查询接口 #3996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
183 changes: 183 additions & 0 deletions
183
...in/java/com/github/binarywang/wxpay/bean/merchantlimitation/MerchantLimitationResult.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,183 @@ | ||
| package com.github.binarywang.wxpay.bean.merchantlimitation; | ||
|
|
||
| import com.google.gson.annotations.SerializedName; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| import java.io.Serializable; | ||
| import java.util.List; | ||
|
|
||
| /** | ||
| * 子商户管控情况 | ||
| * | ||
| * @author zhangyl | ||
| */ | ||
| @Data | ||
| public class MerchantLimitationResult implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** | ||
| * 商户ID | ||
| */ | ||
| @SerializedName("mchid") | ||
| private String mchId; | ||
| /** | ||
| * 商户被管控能力列表 | ||
| */ | ||
| @SerializedName("limited_functions") | ||
| private List<String> limitedFunctions; | ||
| /** | ||
| * 商户其他被管控能力描述 | ||
| */ | ||
| @SerializedName("other_limited_functions") | ||
| private String otherLimitedFunctions; | ||
| /** | ||
| * 被管控原因及解脱路径列表 | ||
| */ | ||
| @SerializedName("recovery_specifications") | ||
| private List<RecoverySpecification> recoverySpecifications; | ||
|
|
||
| @Data | ||
| @NoArgsConstructor | ||
| public static class RecoverySpecification implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| /** | ||
| * 商户被该原因管控的单据号 | ||
| * <p> | ||
| * 唯一标记本次管控动作的ID,可用来和“管控流水订阅通知”中的“业务单号”做关联 | ||
| * </p> | ||
| */ | ||
| @SerializedName("limitation_case_id") | ||
| private String limitationCaseId; | ||
| /** | ||
| * 商户被管控原因类型 | ||
| * <p> | ||
| * 若商户被管控时会返回 | ||
| * <li> LICENSE_ABNORMAL:经营证照异常</li> | ||
| * <li> NO_TRADE:无交易</li> | ||
| * <li> SETTLE_ACCOUNT_ABNORMAL:结算信息异常</li> | ||
| * <li> RISK_ABNORMAL:风险异常</li> | ||
| * <li> OTHER:其他</li> | ||
| * <li> INSPECT_ABNORMAL:巡检异常</li> | ||
| * <li> INVALID_REPRESENTATIVE_INFORMATION:法定代表人/负责人资料异常</li> | ||
| * <li> INVALID_BUSINESS_STATUS:经营状态异常</li> | ||
| * <li> INVALID_BUSINESS_LICENSE:经营证照资料异常</li> | ||
| * <li> INVALID_BENEFICIARY_INFORMATION:受益所有人资料异常</li> | ||
| * </p> | ||
| */ | ||
| @SerializedName("limitation_reason_type") | ||
| private String limitationReasonType; | ||
| /** | ||
| * 商户被管控原因 | ||
| * <p> | ||
| * 被管控的原因,若商户被管控时会返回 | ||
| * </p> | ||
| */ | ||
| @SerializedName("limitation_reason") | ||
| private String limitationReason; | ||
| /** | ||
| * 商户被管控原因描述 | ||
| * <p> | ||
| * 在该原因下,被管控的原因描述,若商户被管控时会返回 | ||
| * </p> | ||
| */ | ||
| @SerializedName("limitation_reason_describe") | ||
| private String limitationReasonDescribe; | ||
| /** | ||
| * 商户被该原因管控的能力列表 | ||
| * <p> | ||
| * 在该原因下,若商户以下能力被管控时会返回 | ||
| * <li> NO_TRANSACTION_AND_RECHARGE:关闭收单和充值</li> | ||
| * <li> NO_PAYMENT:关闭付款</li> | ||
| * <li> NO_WITHDRAWAL:关闭提现</li> | ||
| * <li> NO_REFUND:关闭退款</li> | ||
| * <li> NO_TRANSACTION:关闭收单</li> | ||
| * <li> NO_PROFIT_SHARING:关闭分账分出</li> | ||
| * <li> NO_PAYMENT_POINT_COMPLETE_ORDER:关闭支付分服务结单</li> | ||
| * </p> | ||
| */ | ||
| @SerializedName("relate_limitations") | ||
| private List<String> relateLimitations; | ||
|
|
||
| /** | ||
| * 商户被该原因管控的其他能力描述 | ||
| * <p> | ||
| * 在该原因下,若商户除了relate_limitations所罗列的被管控能力,还有其他被管控的能力时会返回(如有多项以英文逗号分隔) | ||
| * </p> | ||
| */ | ||
| @SerializedName("other_relate_limitations") | ||
| private String otherRelateLimitations; | ||
|
|
||
| /** | ||
| * 商户被该原因管控的解脱路径 | ||
| * <p> | ||
| * 在该原因下,若存在解脱路径时会返回 | ||
| * <li> IRRECOVERABLE:不可恢复</li> | ||
| * <li> MODIFY_SUBJECT_INFORMATION:修改主体资料</li> | ||
| * <li> MODIFY_SETTLE_ACCOUNT_INFORMATION:修改结算银行账户</li> | ||
| * <li> VERIFY_INACTIVE_MERCHANT_IDENTITY:核实商户身份</li> | ||
| * <li> SUBMIT_OFFLINE_BUSINESS_SCENARIO_INFORMATION:提交线下经营场景信息</li> | ||
| * <li> SUBMIT_INFORMATION_FOR_APPEAL:提交相关信息申诉</li> | ||
| * <li> RESOLVE_TRANSACTION_DISPUTES:解决交易纠纷</li> | ||
| * <li> MODIFY_ADMINISTRATOR_INFORMATION:修改超级管理员</li> | ||
| * <li> CALL_CUSTOMER_SERVICE_AT_95017:拨打微信支付客服电话95017</li> | ||
| * <li> UPDATE_BUSINESS_SCENARIO_INFORMATION:更新经营场景信息</li> | ||
| * <li> SUBMIT_CDD_INFORMATION:填写尽调信息</li> | ||
| * <li> WAITING_FOR_PLATFORM_REVIEW:等待平台审核</li> | ||
| * <li> SUBMIT_UBO_INFORMATION:补充受益所有人信息</li> | ||
| * <li> SIGN_ANTI_FRAUD_PLEDGE_AND_VERIFY_FACE:签署反诈承诺书并刷脸核实身份</li> | ||
| * <li> CONTACT_APPROPRIATE_AUTHORITY_FOR_CONSULTATION:联系有权机关咨询</li> | ||
| * <li> MODIFY_ABBREVIATION_INFORMATION:修改商户简称</li> | ||
| * </p> | ||
| */ | ||
| @SerializedName("recover_way") | ||
| private String recoverWay; | ||
|
|
||
| /** | ||
| * 商户被该原因管控的解脱路径参数 | ||
| * <p> | ||
| * 若解脱路径recover_way为“填写尽调信息”、“补充受益所有人信息”,需通过提交尽调来解脱,此处会返回“尽调单号”;若解脱路径recover_way | ||
| * 为“提交相关信息申诉”,需通过提交资料来解脱,此处会返回“商户管理记录单号”;若解脱路径recover_way为“联系有权机关咨询”,此处会返回有权机关信息 | ||
| * </p> | ||
| */ | ||
| @SerializedName("recover_way_param") | ||
| private String recoverWayParam; | ||
|
|
||
| /** | ||
| * 商户被该原因管控的解脱帮助链接 | ||
| * <p> | ||
| * 在该原因下,若存在解脱帮助说明时会返回 | ||
| * </p> | ||
| */ | ||
| @SerializedName("recover_help_url") | ||
| private String recoverHelpUrl; | ||
|
|
||
| /** | ||
| * 处置方式 | ||
| * <p> | ||
| * 管控处置方式类型,默认是立即管控 | ||
| * <li>LIMIT_ACTION_TYPE_IMMEDIATE_CONTROL:立即管控</li> | ||
| * <li>LIMIT_ACTION_TYPE_DELAY_CONTROL:延迟管控</li> | ||
| * </p> | ||
| */ | ||
| @SerializedName("limitation_action_type") | ||
| private String limitationActionType; | ||
|
|
||
| /** | ||
| * 预计管控开始时间 | ||
| */ | ||
| @SerializedName("limitation_start_date") | ||
| private String limitationStartDate; | ||
|
|
||
| /** | ||
| * 商户被该原因管控的时间 | ||
| * <p> | ||
| * 若商户被管控时会返回,延迟管控但是未到管控时间时不会返回 | ||
| * </p> | ||
| */ | ||
| @SerializedName("limitation_date") | ||
| private String limitationDate; | ||
|
|
||
| } | ||
| } | ||
66 changes: 66 additions & 0 deletions
66
...y/src/main/java/com/github/binarywang/wxpay/bean/notify/PartnerSubscribeNotifyResult.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| package com.github.binarywang.wxpay.bean.notify; | ||
|
|
||
| import com.google.gson.annotations.SerializedName; | ||
| import lombok.Data; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| import java.io.Serializable; | ||
|
|
||
| /** | ||
| * 合作伙伴订阅通知 <a href="https://pay.weixin.qq.com/doc/v3/partner/4016022264">产品介绍</a> | ||
| * <p> | ||
| * 该类是订阅通知的通用结构,每个字段代表的含义和订阅类型有关。请依据文档自行判断使用。 | ||
| * </p> | ||
| * | ||
| * @author zhangyl | ||
| */ | ||
| @Data | ||
| @NoArgsConstructor | ||
| public class PartnerSubscribeNotifyResult implements Serializable, | ||
| WxPayBaseNotifyV3Result<PartnerSubscribeNotifyResult.DecryptNotifyResult> { | ||
| private static final long serialVersionUID = 1L; | ||
| /** | ||
| * 源数据 | ||
| */ | ||
| private OriginNotifyResponse rawData; | ||
| /** | ||
| * 解密后的数据 | ||
| */ | ||
| private DecryptNotifyResult result; | ||
|
|
||
| @Data | ||
| @NoArgsConstructor | ||
| public static class DecryptNotifyResult implements Serializable { | ||
| private static final long serialVersionUID = 1L; | ||
| /** | ||
| * 商户号 | ||
| */ | ||
| @SerializedName("merchant_code") | ||
| private String merchantCode; | ||
| /** | ||
| * 商户全称 | ||
| */ | ||
| @SerializedName("merchant_company_name") | ||
| private String merchantCompanyName; | ||
| /** | ||
| * 业务发生时间 | ||
| */ | ||
| @SerializedName("business_time") | ||
| private String businessTime; | ||
| /** | ||
| * 业务单据 | ||
| */ | ||
| @SerializedName("business_code") | ||
| private String businessCode; | ||
| /** | ||
| * 业务状态 | ||
| */ | ||
| @SerializedName("business_state") | ||
| private String businessState; | ||
| /** | ||
| * 备注 | ||
| */ | ||
| @SerializedName("remark") | ||
| private String remark; | ||
| } | ||
| } |
28 changes: 28 additions & 0 deletions
28
...java-pay/src/main/java/com/github/binarywang/wxpay/service/MerchantLimitationService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
|
|
||
| /** | ||
| * 商户被管控能力及原因查询 接口 | ||
| * <p> | ||
| * <a href="https://pay.weixin.qq.com/doc/v3/partner/4012165270">产品介绍</a> | ||
| * </p> | ||
| * | ||
| * @author zhangyl | ||
| */ | ||
| public interface MerchantLimitationService { | ||
|
|
||
| /** | ||
| * 查询子商户管控情况 | ||
| * <p> | ||
| * <a href="https://pay.weixin.qq.com/doc/v3/partner/4012803072">接口文档</a> | ||
| * </p> | ||
| * | ||
| * @param subMchId 子商户号 | ||
| * @return 子商户管控情况 | ||
| * @throws WxPayException the wx pay exception | ||
| */ | ||
| MerchantLimitationResult fetchLimitations(String subMchId) throws WxPayException; | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...src/main/java/com/github/binarywang/wxpay/service/impl/MerchantLimitationServiceImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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); | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.