diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/SettlementApplicationResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/SettlementApplicationResult.java new file mode 100644 index 000000000..95b5f4d2c --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/SettlementApplicationResult.java @@ -0,0 +1,76 @@ +package com.github.binarywang.wxpay.bean.applyment; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 查询结算账户修改申请状态 + */ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@Accessors(chain = true) +public class SettlementApplicationResult implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 开户名称 + */ + @SerializedName("account_name") + private String accountName; + + /** + * 账户类型 + */ + @SerializedName("account_type") + private String accountType; + + /** + * 开户银行 + */ + @SerializedName("account_bank") + private String accountBank; + + /** + * 开户银行全称(含支行) + */ + @SerializedName("bank_name") + private String bankName; + + /** + * 开户银行联行号 + */ + @SerializedName("bank_branch_id") + private String bankBranchId; + + /** + * 银行账号 + */ + @SerializedName("account_number") + private String accountNumber; + + /** + * 审核状态 + */ + @SerializedName("verify_result") + private String verifyResult; + + /** + * 审核驳回原因 + */ + @SerializedName("verify_fail_reason") + private String verifyFailReason; + + /** + * 审核结果更新时间 + */ + @SerializedName("verify_finish_time") + private String verifyFinishTime; +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/Applyment4SubService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/Applyment4SubService.java index 8341cad1c..61412b75d 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/Applyment4SubService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/Applyment4SubService.java @@ -71,4 +71,15 @@ public interface Applyment4SubService { */ String modifySettlement(String subMchid, ModifySettlementRequest request) throws WxPayException; + /** + * 查询结算账户修改申请状态 + * 文档详见:https://pay.weixin.qq.com/docs/partner/apis/modify-settlement/sub-merchants/get-application.html + * 接口链接:https://api.mch.weixin.qq.com/v3/apply4sub/sub_merchants/{sub_mchid}/application/{application_no} + * + * @param subMchid + * @param applicationNo + * @return + * @throws WxPayException + */ + SettlementApplicationResult settlementApplication(String subMchid, String applicationNo) throws WxPayException; } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImpl.java index 8da4c4058..2ca5a1ba4 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImpl.java @@ -63,4 +63,11 @@ public class Applyment4SubServiceImpl implements Applyment4SubService { encryptFiled(request); return payService.postV3WithWechatpaySerial(url, GSON.toJson(request)); } + + @Override + public SettlementApplicationResult settlementApplication(String subMchid, String applicationNo) throws WxPayException { + String url = String.format("%s/v3/apply4sub/sub_merchants/%s/application/%s", this.payService.getPayBaseUrl(), subMchid, applicationNo); + String result = payService.getV3(url); + return GSON.fromJson(result, SettlementApplicationResult.class); + } } diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImplTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImplTest.java index da268ce9e..25c3ec09d 100644 --- a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImplTest.java +++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/Applyment4SubServiceImplTest.java @@ -79,8 +79,14 @@ public class Applyment4SubServiceImplTest { applyment4SubService.modifySettlement(subMchid,modifySettlementRequest); } + @Test + public void testSettlementApplication() throws WxPayException{ + Applyment4SubService applyment4SubService=new Applyment4SubServiceImpl(wxPayService); + String subMchid="subMchid"; + String applymentId="applymentId"; - + applyment4SubService.settlementApplication(subMchid, applymentId); + }