Explorar o código

new:修改结算账户、退款查询

曾浩 %!s(int64=4) %!d(string=hai) anos
pai
achega
7df0e7508d

+ 4 - 4
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/CombineTransactionsResult.java

@@ -69,7 +69,7 @@ public class CombineTransactionsResult implements Serializable {
    * </pre>
    */
   @SerializedName(value = "scene_info")
-  private CombineTransactionsResult.SceneInfo sceneInfo;
+  private SceneInfo sceneInfo;
 
   /**
    * <pre>
@@ -83,7 +83,7 @@ public class CombineTransactionsResult implements Serializable {
    * </pre>
    */
   @SerializedName(value = "sub_orders")
-  private List<CombineTransactionsResult.SubOrders> subOrders;
+  private List<SubOrders> subOrders;
 
   /**
    * <pre>
@@ -95,7 +95,7 @@ public class CombineTransactionsResult implements Serializable {
    * </pre>
    */
   @SerializedName(value = "combine_payer_info")
-  private CombineTransactionsResult.CombinePayerInfo combinePayerInfo;
+  private CombinePayerInfo combinePayerInfo;
 
   @Data
   @NoArgsConstructor
@@ -248,7 +248,7 @@ public class CombineTransactionsResult implements Serializable {
      * </pre>
      */
     @SerializedName(value = "amount")
-    private CombineTransactionsResult.Amount amount;
+    private Amount amount;
 
   }
 

+ 5 - 5
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/PartnerTransactionsResult.java

@@ -203,7 +203,7 @@ public class PartnerTransactionsResult implements Serializable {
    * </pre>
    */
   @SerializedName(value = "combine_payer_info")
-  private PartnerTransactionsResult.CombinePayerInfo combinePayerInfo;
+  private CombinePayerInfo combinePayerInfo;
 
   /**
    * <pre>
@@ -215,7 +215,7 @@ public class PartnerTransactionsResult implements Serializable {
    * </pre>
    */
   @SerializedName(value = "amount")
-  private PartnerTransactionsResult.Amount amount;
+  private Amount amount;
 
   /**
    * <pre>
@@ -227,7 +227,7 @@ public class PartnerTransactionsResult implements Serializable {
    * </pre>
    */
   @SerializedName(value = "scene_info")
-  private PartnerTransactionsResult.SceneInfo sceneInfo;
+  private SceneInfo sceneInfo;
 
   /**
    * <pre>
@@ -239,7 +239,7 @@ public class PartnerTransactionsResult implements Serializable {
    * </pre>
    */
   @SerializedName(value = "promotion_detail")
-  private List<PartnerTransactionsResult.PromotionDetail> promotionDetails;
+  private List<PromotionDetail> promotionDetails;
 
   @Data
   @NoArgsConstructor
@@ -507,7 +507,7 @@ public class PartnerTransactionsResult implements Serializable {
      * </pre>
      */
     @SerializedName(value = "goods_detail")
-    private List<PartnerTransactionsResult.GoodsDetail> goodsDetails;
+    private List<GoodsDetail> goodsDetails;
 
 
   }

+ 1 - 1
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundNotifyResult.java

@@ -218,7 +218,7 @@ public class RefundNotifyResult implements Serializable {
     /**
      * <pre>
      * 字段名:用户退款金额
-     * 变量名:payer_currency
+     * 变量名:payer_refund
      * 是否必填:是
      * 类型:int
      * 描述:

+ 325 - 0
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/RefundQueryResult.java

@@ -0,0 +1,325 @@
+package com.github.binarywang.wxpay.bean.ecommerce;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 查询退款结果
+ * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/refunds/chapter3_2.shtml
+ */
+@Data
+@NoArgsConstructor
+public class RefundQueryResult implements Serializable {
+
+  /**
+   * <pre>
+   * 字段名:微信退款单号
+   * 变量名:refund_id
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  微信退款单号
+   * 示例值: 1217752501201407033233368018
+   * </pre>
+   */
+  @SerializedName(value = "refund_id")
+  private String refundId;
+
+  /**
+   * <pre>
+   * 字段名:商户退款单号
+   * 变量名:out_refund_no
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  商户退款单号
+   * 示例值: 1217752501201407033233368018
+   * </pre>
+   */
+  @SerializedName(value = "out_refund_no")
+  private String outRefundNo;
+
+  /**
+   * <pre>
+   * 字段名:微信订单号
+   * 变量名:transaction_id
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  微信支付订单号
+   * 示例值: 1217752501201407033233368018
+   * </pre>
+   */
+  @SerializedName(value = "transaction_id")
+  private String transactionId;
+
+  /**
+   * <pre>
+   * 字段名:商户订单号
+   * 变量名:out_trade_no
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  返回的商户订单号
+   * 示例值: 1217752501201407033233368018
+   * </pre>
+   */
+  @SerializedName(value = "out_trade_no")
+  private String outTradeNo;
+
+  /**
+   * <pre>
+   * 字段名:退款渠道
+   * 变量名:channel
+   * 是否必填:否
+   * 类型:string(16)
+   * 描述:
+   *  ORIGINAL:原路退款
+   *  BALANCE:退回到余额
+   *  OTHER_BALANCE:原账户异常退到其他余额账户
+   *  OTHER_BANKCARD:原银行卡异常退到其他银行卡
+   * 示例值: ORIGINAL
+   * </pre>
+   */
+  @SerializedName(value = "channel")
+  private String channel;
+
+  /**
+   * <pre>
+   * 字段名:退款入账账户
+   * 变量名:user_received_account
+   * 是否必填:是
+   * 类型:string(64)
+   * 描述:
+   *  取当前退款单的退款入账方。
+   *    退回银行卡:{银行名称}{卡类型}{卡尾号}
+   *    退回支付用户零钱: 支付用户零钱
+   *    退还商户: 商户基本账户、商户结算银行账户
+   *    退回支付用户零钱通:支付用户零钱通
+   * 示例值:招商银行信用卡0403
+   * </pre>
+   */
+  @SerializedName(value = "user_received_account")
+  private String userReceivedAccount;
+
+  /**
+   * <pre>
+   * 字段名:退款成功时间
+   * 变量名:success_time
+   * 是否必填:否
+   * 类型:string(64)
+   * 描述:
+   *  1、退款成功时间,遵循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秒。
+   * 2、当退款状态为退款成功时返回此参数。
+   * 示例值:2018-06-08T10:34:56+08:00
+   * </pre>
+   */
+  @SerializedName(value = "success_time")
+  private String successTime;
+
+  /**
+   * <pre>
+   * 字段名:退款创建时间
+   * 变量名:create_time
+   * 是否必填:是
+   * 类型:string(64)
+   * 描述:
+   *  1、退款受理时间,遵循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秒。
+   * 2、当退款状态为退款成功时返回此字段。
+   * 示例值:2018-06-08T10:34:56+08:00
+   * </pre>
+   */
+  @SerializedName(value = "create_time")
+  private String createTime;
+
+  /**
+   * <pre>
+   * 字段名:退款状态
+   * 变量名:status
+   * 是否必填:是
+   * 类型:string(16)
+   * 描述:
+   *  退款状态,枚举值:
+   *    SUCCESS:退款成功
+   *    REFUNDCLOSE:退款关闭
+   *    PROCESSING:退款处理中
+   *    ABNORMAL:退款异常,退款到银行发现用户的卡作废或者冻结了,导致原路退款银行卡失败,可前往【服务商平台—>交易中心】,手动处理此笔退款
+   * 示例值:SUCCESS
+   * </pre>
+   */
+  @SerializedName(value = "status")
+  private String status;
+
+  /**
+   * <pre>
+   * 字段名:金额信息
+   * 变量名:amount
+   * 是否必填:是
+   * 类型:object
+   * 描述:
+   *  金额信息
+   * </pre>
+   */
+  @SerializedName(value = "amount")
+  private Amount amount;
+
+  /**
+   * <pre>
+   * 字段名:营销详情
+   * 变量名:promotion_detail
+   * 是否必填:否
+   * 类型:array
+   * 描述:
+   *  优惠退款信息
+   * </pre>
+   */
+  public List<PromotionDetail> promotionDetails;
+
+  @Data
+  @NoArgsConstructor
+  public static class Amount implements Serializable {
+
+    /**
+     * <pre>
+     * 字段名:退款金额
+     * 变量名:refund
+     * 是否必填:是
+     * 类型:int
+     * 描述:
+     *  退款金额,币种的最小单位,只能为整数,不能超过原订单支付金额。
+     * 示例值:888
+     * </pre>
+     */
+    @SerializedName(value = "refund")
+    private String refund;
+
+    /**
+     * <pre>
+     * 字段名:用户退款金额
+     * 变量名:payer_refund
+     * 是否必填:是
+     * 类型:int
+     * 描述:
+     *  退款给用户的金额,不包含所有优惠券金额。
+     * 示例值:888
+     * </pre>
+     */
+    @SerializedName(value = "payer_refund")
+    private String payerRefund;
+
+    /**
+     * <pre>
+     * 字段名:优惠退款金额
+     * 变量名:discount_refund
+     * 是否必填:否
+     * 类型:int
+     * 描述:
+     *  优惠券的退款金额,原支付单的优惠按比例退款。
+     * 示例值:888
+     * </pre>
+     */
+    @SerializedName(value = "discount_refund")
+    private Integer discountRefund;
+
+
+    /**
+     * <pre>
+     * 字段名:退款币种
+     * 变量名:currency
+     * 是否必填:否
+     * 类型:string(18)
+     * 描述:
+     *  符合ISO 4217标准的三位字母代码,目前只支持人民币:CNY 。
+     * 示例值: CNY
+     * </pre>
+     */
+    @SerializedName(value = "currency")
+    private String currency;
+
+  }
+
+  @Data
+  @NoArgsConstructor
+  public static class PromotionDetail implements Serializable {
+
+    /**
+     * <pre>
+     * 字段名:券ID
+     * 变量名:promotion_id
+     * 是否必填:是
+     * 类型:string(32)
+     * 描述:券或者立减优惠id 。
+     * 示例值:109519
+     * </pre>
+     */
+    @SerializedName(value = "promotion_id")
+    private String promotionId;
+
+    /**
+     * <pre>
+     * 字段名:优惠范围
+     * 变量名:scope
+     * 是否必填:是
+     * 类型:string(32)
+     * 描述: 优惠范围
+     * 枚举值:
+     *    GLOBAL:全场代金券
+     *    SINGLE:单品优惠
+     * 示例值:GLOBAL
+     * </pre>
+     */
+    @SerializedName(value = "scope")
+    private String scope;
+
+    /**
+     * <pre>
+     * 字段名:优惠类型
+     * 变量名:type
+     * 是否必填:是
+     * 类型:string(32)
+     * 描述:
+     *   枚举值:
+     *    COUPON:充值型代金券,商户需要预先充值营销经费
+     *    DISCOUNT:免充值型优惠券,商户不需要预先充值营销经费
+     * 示例值:DISCOUNT
+     * </pre>
+     */
+    @SerializedName(value = "type")
+    private String type;
+
+    /**
+     * <pre>
+     * 字段名:优惠券面额
+     * 变量名:amount
+     * 是否必填:是
+     * 类型:int
+     * 描述: 用户享受优惠的金额(优惠券面额=微信出资金额+商家出资金额+其他出资方金额 )。
+     * 示例值:5
+     * </pre>
+     */
+    @SerializedName(value = "amount")
+    private Integer amount;
+
+    /**
+     * <pre>
+     * 字段名:优惠退款金额
+     * 变量名:refund_amount
+     * 是否必填:是
+     * 类型:int
+     * 描述: 代金券退款金额<=退款金额,退款金额-代金券或立减优惠退款金额为现金,说明详见《代金券或立减优惠》。
+     * 示例值:100
+     * </pre>
+     */
+    @SerializedName(value = "refund_amount")
+    private Integer refundAmount;
+
+  }
+}

+ 114 - 0
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SettlementRequest.java

@@ -0,0 +1,114 @@
+package com.github.binarywang.wxpay.bean.ecommerce;
+
+import com.github.binarywang.wxpay.v3.SpecEncrypt;
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * <pre>
+ * 普通服务商(支付机构、银行不可用),可使用本接口修改其进件、已签约的特约商户-结算账户信息。
+ * 文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/applyments/chapter3_4.shtml
+ * </pre>
+ */
+@Data
+@NoArgsConstructor
+public class SettlementRequest implements Serializable {
+
+  /**
+   * <pre>
+   * 字段名:账户类型
+   * 变量名:account_type
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  根据特约商户号的主体类型,可选择的账户类型如下:
+   * 1、小微主体:经营者个人银行卡
+   * 2、个体工商户主体:经营者个人银行卡/ 对公银行账户
+   * 3、企业主体:对公银行账户
+   * 4、党政、机关及事业单位主体:对公银行账户
+   * 5、其他组织主体:对公银行账户
+   * 枚举值:
+   *    ACCOUNT_TYPE_BUSINESS:对公银行账户
+   *    ACCOUNT_TYPE_PRIVATE:经营者个人银行卡
+   * 示例值:ACCOUNT_TYPE_BUSINESS
+   * </pre>
+   */
+  @SerializedName(value = "account_type")
+  private String accountType;
+
+  /**
+   * <pre>
+   * 字段名:开户银行
+   * 变量名:account_bank
+   * 是否必填:是
+   * 类型:string(128)
+   * 描述:
+   *  请填写开户银行名称,详细参见《开户银行对照表》https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/applyments/chapter4_1.shtml。
+   * 示例值:工商银行
+   * </pre>
+   */
+  @SerializedName(value = "account_bank")
+  private String accountBank;
+
+  /**
+   * <pre>
+   * 字段名:开户银行省市编码
+   * 变量名:bank_address_code
+   * 是否必填:是
+   * 类型:string(128)
+   * 描述:
+   *  需至少精确到市,详细参见《省市区编号对照表》。
+   * 示例值:110000
+   * </pre>
+   */
+  @SerializedName(value = "bank_address_code")
+  private String bankAddressCode;
+
+  /**
+   * <pre>
+   * 字段名:开户银行全称(含支行)
+   * 变量名:bank_name
+   * 是否必填:否
+   * 类型:string(128)
+   * 描述:
+   *  若开户银行为“其他银行”,则需二选一填写“开户银行全称(含支行)”或“开户银行联行号”。
+   * 填写银行全称,如"深圳农村商业银行XXX支行" ,详细参见开户银行全称(含支行)对照表。
+   * 示例值:施秉县农村信用合作联社城关信用社
+   * </pre>
+   */
+  @SerializedName(value = "bank_name")
+  private String bankName;
+
+  /**
+   * <pre>
+   * 字段名:开户银行联行号
+   * 变量名:bank_branch_id
+   * 是否必填:否
+   * 类型:string(128)
+   * 描述:
+   *  若开户银行为“其他银行”,则需二选一填写“开户银行全称(含支行)”或“开户银行联行号”。
+   * 填写银行联行号,详细参见《开户银行全称(含支行)对照表》。
+   * 示例值:402713354941
+   * </pre>
+   */
+  @SerializedName(value = "bank_branch_id")
+  private String bankBranchId;
+
+  /**
+   * <pre>
+   * 字段名:银行账号
+   * 变量名:account_number
+   * 是否必填:是
+   * 类型:string(128)
+   * 描述:
+   *  1、数字,长度遵循系统支持的对公/对私卡号长度要求
+   * 2、该字段需进行加密处理,加密方法详见《敏感信息加密说明》。(提醒:必须在HTTP头中上送Wechatpay-Serial)
+   * </pre>
+   */
+  @SpecEncrypt
+  @SerializedName(value = "account_number")
+  private String accountNumber;
+}

+ 106 - 0
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SettlementResult.java

@@ -0,0 +1,106 @@
+package com.github.binarywang.wxpay.bean.ecommerce;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 查询结算账户结果
+ * <pre>
+ *   文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/applyments/chapter3_5.shtml
+ * </pre>
+ */
+@Data
+@NoArgsConstructor
+public class SettlementResult implements Serializable {
+  /**
+   * <pre>
+   * 字段名:账户类型
+   * 变量名:account_type
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   * 枚举值:
+   *    ACCOUNT_TYPE_BUSINESS:对公银行账户
+   *    ACCOUNT_TYPE_PRIVATE:经营者个人银行卡
+   * 示例值:ACCOUNT_TYPE_BUSINESS
+   * </pre>
+   */
+  @SerializedName(value = "account_type")
+  private String accountType;
+
+  /**
+   * <pre>
+   * 字段名:开户银行
+   * 变量名:account_bank
+   * 是否必填:是
+   * 类型:string(128)
+   * 描述:
+   *  返回特约商户的结算账户-开户银行全称。
+   * 示例值:工商银行
+   * </pre>
+   */
+  @SerializedName(value = "account_bank")
+  private String accountBank;
+
+  /**
+   * <pre>
+   * 字段名:开户银行全称(含支行)
+   * 变量名:bank_name
+   * 是否必填:是
+   * 类型:string(128)
+   * 描述:
+   *  返回特约商户的结算账户-开户银行全称(含支行)。
+   * 示例值:施秉县农村信用合作联社城关信用社
+   * </pre>
+   */
+  @SerializedName(value = "bank_name")
+  private String bankName;
+
+  /**
+   * <pre>
+   * 字段名:开户银行联行号
+   * 变量名:bank_branch_id
+   * 是否必填:是
+   * 类型:string(128)
+   * 描述:
+   *  返回特约商户的结算账户-联行号。
+   * 示例值:402713354941
+   * </pre>
+   */
+  @SerializedName(value = "bank_branch_id")
+  private String bankBranchId;
+
+  /**
+   * <pre>
+   * 字段名:银行账号
+   * 变量名:account_number
+   * 是否必填:是
+   * 类型:string(128)
+   * 描述:
+   *  返回特约商户的结算账户-银行账号,掩码显示。
+   * 示例值:62*************78
+   * </pre>
+   */
+  @SerializedName(value = "account_number")
+  private String accountNumber;
+
+  /**
+   * <pre>
+   * 字段名:汇款验证结果
+   * 变量名:verify_result
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  返回特约商户的结算账户-汇款验证结果。
+   *    VERIFYING:系统汇款验证中,商户可发起提现尝试。
+   *    VERIFY_SUCCESS:系统成功汇款,该账户可正常发起提现。
+   *    VERIFY_FAIL:系统汇款失败,该账户无法发起提现,请检查修改。
+   * 示例值:VERIFY_SUCCESS
+   * </pre>
+   */
+  @SerializedName(value = "verify_result")
+  private String verifyResult;
+}

+ 51 - 0
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java

@@ -275,6 +275,32 @@ public interface EcommerceService {
 
   /**
    * <pre>
+   * 查询退款API
+   * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/refunds/chapter3_2.shtml
+   * </pre>
+   *
+   * @param subMchid 二级商户号
+   * @param refundId 微信退款单号
+   * @return 返回数据 return refunds result
+   * @throws WxPayException the wx pay exception
+   */
+  RefundQueryResult queryRefundByRefundId(String subMchid, String refundId) throws WxPayException;
+
+  /**
+   * <pre>
+   * 查询退款API
+   * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/refunds/chapter3_2.shtml
+   * </pre>
+   *
+   * @param subMchid 二级商户号
+   * @param outRefundNo 商户退款单号
+   * @return 返回数据 return refunds result
+   * @throws WxPayException the wx pay exception
+   */
+  RefundQueryResult queryRefundByOutRefundNo(String subMchid, String outRefundNo) throws WxPayException;
+
+  /**
+   * <pre>
    * 退款通知回调数据处理
    * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/refunds/chapter3_3.shtml
    * </pre>
@@ -309,4 +335,29 @@ public interface EcommerceService {
    * @throws WxPayException the wx pay exception
    */
   SpWithdrawResult spWithdraw(SpWithdrawRequest request) throws WxPayException;
+
+  /**
+   * <pre>
+   * 修改结算帐号API
+   * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/applyments/chapter3_4.shtml
+   * </pre>
+   *
+   * @param subMchid 二级商户号。
+   * @param request 结算帐号
+   * @throws WxPayException the wx pay exception
+   */
+  void modifySettlement(String subMchid, SettlementRequest request) throws WxPayException;
+
+  /**
+   * <pre>
+   * 查询结算账户API
+   * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/applyments/chapter3_5.shtml
+   * </pre>
+   *
+   * @param subMchid 二级商户号。
+   * @return 返回数据 return settlement result
+   * @throws WxPayException the wx pay exception
+   */
+  SettlementResult querySettlement(String subMchid) throws WxPayException;
+
 }

+ 28 - 0
weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java

@@ -211,6 +211,20 @@ public class EcommerceServiceImpl implements EcommerceService {
   }
 
   @Override
+  public RefundQueryResult queryRefundByRefundId(String subMchid, String refundId) throws WxPayException {
+    String url = String.format("%s/v3/ecommerce/refunds/id/%s?sub_mchid=%s", this.payService.getPayBaseUrl(), refundId, subMchid);
+    String response = this.payService.getV3(URI.create(url));
+    return GSON.fromJson(response, RefundQueryResult.class);
+  }
+
+  @Override
+  public RefundQueryResult queryRefundByOutRefundNo(String subMchid, String outRefundNo) throws WxPayException {
+    String url = String.format("%s/v3/ecommerce/applyments/out-request-no/%s?sub_mchid=%s", this.payService.getPayBaseUrl(), outRefundNo, subMchid);
+    String response = this.payService.getV3(URI.create(url));
+    return GSON.fromJson(response, RefundQueryResult.class);
+  }
+
+  @Override
   public RefundNotifyResult parseRefundNotifyResult(String notifyData, SignatureHeader header) throws WxPayException {
     if(Objects.nonNull(header) && !this.verifyNotifySign(header, notifyData)){
       throw new WxPayException("非法请求,头部信息验证失败");
@@ -245,6 +259,20 @@ public class EcommerceServiceImpl implements EcommerceService {
     return GSON.fromJson(response, SpWithdrawResult.class);
   }
 
+  @Override
+  public void modifySettlement(String subMchid, SettlementRequest request) throws WxPayException {
+    String url = String.format("%s/v3/apply4sub/sub_merchants/%s/modify-settlement", this.payService.getPayBaseUrl(), subMchid);
+    RsaCryptoUtil.encryptFields(request, this.payService.getConfig().getVerifier().getValidCertificate());
+    this.payService.postV3WithWechatpaySerial(url, GSON.toJson(request));
+  }
+
+  @Override
+  public SettlementResult querySettlement(String subMchid) throws WxPayException {
+    String url = String.format("%s/v3/apply4sub/sub_merchants/%s/settlement", this.payService.getPayBaseUrl(), subMchid);
+    String response = this.payService.getV3(URI.create(url));
+    return GSON.fromJson(response, SettlementResult.class);
+  }
+
   /**
    * 校验通知签名
    * @param header 通知头信息