From 58671ad3f945a7f53f87b6041abe12fec5ef16c9 Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Sun, 25 Oct 2020 15:36:49 +0800 Subject: [PATCH 1/5] =?UTF-8?q?:art:=20=E9=87=8D=E6=9E=84=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=8C=85=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../weixin/common/{api => service}/WxImgProcService.java | 2 +- .../me/chanjar/weixin/common/service}/WxOAuth2Service.java | 2 +- .../chanjar/weixin/common/{api => service}/WxOcrService.java | 2 +- .../main/java/cn/binarywang/wx/miniapp/api/WxMaService.java | 4 ++-- .../binarywang/wx/miniapp/api/impl/BaseWxMaServiceImpl.java | 4 ++-- .../wx/miniapp/api/impl/WxMaImgProcServiceImpl.java | 2 +- .../binarywang/wx/miniapp/api/impl/WxMaOcrServiceImpl.java | 2 +- .../src/main/java/me/chanjar/weixin/mp/api/WxMpService.java | 5 +++-- .../me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java | 5 +++-- .../chanjar/weixin/mp/api/impl/WxMpImgProcServiceImpl.java | 2 +- .../me/chanjar/weixin/mp/api/impl/WxMpOAuth2ServiceImpl.java | 2 +- .../me/chanjar/weixin/mp/api/impl/WxMpOcrServiceImpl.java | 2 +- .../weixin/mp/api/impl/WxMpImgProcServiceImplTest.java | 2 +- 13 files changed, 19 insertions(+), 17 deletions(-) rename weixin-java-common/src/main/java/me/chanjar/weixin/common/{api => service}/WxImgProcService.java (99%) rename {weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api => weixin-java-common/src/main/java/me/chanjar/weixin/common/service}/WxOAuth2Service.java (98%) rename weixin-java-common/src/main/java/me/chanjar/weixin/common/{api => service}/WxOcrService.java (98%) diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxImgProcService.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxImgProcService.java similarity index 99% rename from weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxImgProcService.java rename to weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxImgProcService.java index c7d1bcfc14..a9ef694ad5 100644 --- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxImgProcService.java +++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxImgProcService.java @@ -1,4 +1,4 @@ -package me.chanjar.weixin.common.api; +package me.chanjar.weixin.common.service; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.bean.imgproc.WxImgProcAiCropResult; diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxOAuth2Service.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxOAuth2Service.java similarity index 98% rename from weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxOAuth2Service.java rename to weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxOAuth2Service.java index 0c7cc5764c..97a74d2c68 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxOAuth2Service.java +++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxOAuth2Service.java @@ -1,4 +1,4 @@ -package me.chanjar.weixin.mp.api; +package me.chanjar.weixin.common.service; import me.chanjar.weixin.common.bean.WxOAuth2UserInfo; import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken; diff --git a/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxOcrService.java b/weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxOcrService.java similarity index 98% rename from weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxOcrService.java rename to weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxOcrService.java index 480ed3e95b..7b4fe337e5 100644 --- a/weixin-java-common/src/main/java/me/chanjar/weixin/common/api/WxOcrService.java +++ b/weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxOcrService.java @@ -1,4 +1,4 @@ -package me.chanjar.weixin.common.api; +package me.chanjar.weixin.common.service; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.bean.ocr.WxOcrBankCardResult; 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 13862b12fd..e79e3cad36 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 @@ -2,8 +2,8 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import cn.binarywang.wx.miniapp.config.WxMaConfig; -import me.chanjar.weixin.common.api.WxImgProcService; -import me.chanjar.weixin.common.api.WxOcrService; +import me.chanjar.weixin.common.service.WxImgProcService; +import me.chanjar.weixin.common.service.WxOcrService; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.service.WxService; import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor; 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 492f8a9e12..bb189ce471 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 @@ -11,8 +11,8 @@ import com.google.gson.JsonObject; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.api.WxConsts; -import me.chanjar.weixin.common.api.WxImgProcService; -import me.chanjar.weixin.common.api.WxOcrService; +import me.chanjar.weixin.common.service.WxImgProcService; +import me.chanjar.weixin.common.service.WxOcrService; import me.chanjar.weixin.common.bean.ToJson; import me.chanjar.weixin.common.bean.WxAccessToken; import me.chanjar.weixin.common.enums.WxType; diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImgProcServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImgProcServiceImpl.java index 0499b7c7e0..4bdb061675 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImgProcServiceImpl.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaImgProcServiceImpl.java @@ -2,7 +2,7 @@ import cn.binarywang.wx.miniapp.api.WxMaService; import lombok.RequiredArgsConstructor; -import me.chanjar.weixin.common.api.WxImgProcService; +import me.chanjar.weixin.common.service.WxImgProcService; import me.chanjar.weixin.common.bean.imgproc.WxImgProcAiCropResult; import me.chanjar.weixin.common.bean.imgproc.WxImgProcQrCodeResult; import me.chanjar.weixin.common.bean.imgproc.WxImgProcSuperResolutionResult; diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOcrServiceImpl.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOcrServiceImpl.java index edc5a363c1..3e7eb8c38a 100644 --- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOcrServiceImpl.java +++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaOcrServiceImpl.java @@ -2,7 +2,7 @@ import cn.binarywang.wx.miniapp.api.WxMaService; import lombok.RequiredArgsConstructor; -import me.chanjar.weixin.common.api.WxOcrService; +import me.chanjar.weixin.common.service.WxOcrService; import me.chanjar.weixin.common.bean.ocr.*; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.requestexecuter.ocr.OcrDiscernRequestExecutor; diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpService.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpService.java index 50c6e48ba8..fe8d2abf38 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpService.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpService.java @@ -1,12 +1,13 @@ package me.chanjar.weixin.mp.api; import com.google.gson.JsonObject; -import me.chanjar.weixin.common.api.WxImgProcService; -import me.chanjar.weixin.common.api.WxOcrService; +import me.chanjar.weixin.common.service.WxImgProcService; +import me.chanjar.weixin.common.service.WxOcrService; import me.chanjar.weixin.common.bean.WxJsapiSignature; import me.chanjar.weixin.common.bean.WxNetCheckResult; import me.chanjar.weixin.common.enums.TicketType; import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.common.service.WxOAuth2Service; import me.chanjar.weixin.common.service.WxService; import me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor; import me.chanjar.weixin.common.util.http.RequestExecutor; diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java index c2ecc475f3..0047535517 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/BaseWxMpServiceImpl.java @@ -8,8 +8,8 @@ import lombok.Setter; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.api.WxConsts; -import me.chanjar.weixin.common.api.WxImgProcService; -import me.chanjar.weixin.common.api.WxOcrService; +import me.chanjar.weixin.common.service.WxImgProcService; +import me.chanjar.weixin.common.service.WxOcrService; import me.chanjar.weixin.common.bean.ToJson; import me.chanjar.weixin.common.bean.WxAccessToken; import me.chanjar.weixin.common.bean.WxJsapiSignature; @@ -19,6 +19,7 @@ import me.chanjar.weixin.common.error.WxError; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.error.WxRuntimeException; +import me.chanjar.weixin.common.service.WxOAuth2Service; import me.chanjar.weixin.common.session.StandardSessionManager; import me.chanjar.weixin.common.session.WxSessionManager; import me.chanjar.weixin.common.util.DataUtils; diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpImgProcServiceImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpImgProcServiceImpl.java index 24c699657d..ea1785f233 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpImgProcServiceImpl.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpImgProcServiceImpl.java @@ -2,7 +2,7 @@ import lombok.RequiredArgsConstructor; import me.chanjar.weixin.common.error.WxErrorException; -import me.chanjar.weixin.common.api.WxImgProcService; +import me.chanjar.weixin.common.service.WxImgProcService; import me.chanjar.weixin.mp.api.WxMpService; import me.chanjar.weixin.common.bean.imgproc.WxImgProcAiCropResult; import me.chanjar.weixin.common.bean.imgproc.WxImgProcQrCodeResult; diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpOAuth2ServiceImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpOAuth2ServiceImpl.java index 8d8187daa1..f77da7c855 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpOAuth2ServiceImpl.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpOAuth2ServiceImpl.java @@ -11,7 +11,7 @@ import me.chanjar.weixin.common.util.http.SimpleGetRequestExecutor; import me.chanjar.weixin.common.util.http.URIUtil; import me.chanjar.weixin.mp.api.WxMpService; -import me.chanjar.weixin.mp.api.WxOAuth2Service; +import me.chanjar.weixin.common.service.WxOAuth2Service; import me.chanjar.weixin.mp.config.WxMpConfigStorage; import org.apache.commons.lang3.StringUtils; diff --git a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpOcrServiceImpl.java b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpOcrServiceImpl.java index d4286b6177..7f6a2e3cff 100644 --- a/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpOcrServiceImpl.java +++ b/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpOcrServiceImpl.java @@ -1,7 +1,7 @@ package me.chanjar.weixin.mp.api.impl; import lombok.RequiredArgsConstructor; -import me.chanjar.weixin.common.api.WxOcrService; +import me.chanjar.weixin.common.service.WxOcrService; import me.chanjar.weixin.common.bean.ocr.*; import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.requestexecuter.ocr.OcrDiscernRequestExecutor; diff --git a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpImgProcServiceImplTest.java b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpImgProcServiceImplTest.java index 4d2c21bce9..21ca3236f5 100644 --- a/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpImgProcServiceImplTest.java +++ b/weixin-java-mp/src/test/java/me/chanjar/weixin/mp/api/impl/WxMpImgProcServiceImplTest.java @@ -2,7 +2,7 @@ import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.common.util.fs.FileUtils; -import me.chanjar.weixin.common.api.WxImgProcService; +import me.chanjar.weixin.common.service.WxImgProcService; import me.chanjar.weixin.mp.api.WxMpService; import me.chanjar.weixin.mp.api.test.ApiTestModule; import me.chanjar.weixin.mp.api.test.TestConstants; From d265065d36d88a06fcbf5ca7cfe0774e70fcae65 Mon Sep 17 00:00:00 2001 From: hrq Date: Tue, 27 Oct 2020 11:19:51 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=94=B6=E4=BB=98=E9=80=9A=E6=9F=A5=E8=AF=A2=E6=8F=90=E7=8E=B0?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ecommerce/SpWithdrawStatusResult.java | 192 ++++++++++++++++++ .../ecommerce/SubWithdrawStatusResult.java | 190 +++++++++++++++++ .../wxpay/service/EcommerceService.java | 25 +++ .../service/impl/EcommerceServiceImpl.java | 14 ++ 4 files changed, 421 insertions(+) create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SpWithdrawStatusResult.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SubWithdrawStatusResult.java diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SpWithdrawStatusResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SpWithdrawStatusResult.java new file mode 100644 index 0000000000..b3daef3946 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SpWithdrawStatusResult.java @@ -0,0 +1,192 @@ +package com.github.binarywang.wxpay.bean.ecommerce; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 电商平台查询提现状态 + *
+ *   文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/fund/chapter3_6.shtml
+ * 
+ * @author: f00lish + * @date: 2020/10/27 + */ +@Data +@NoArgsConstructor +public class SpWithdrawStatusResult { + + + /** + *
+   * 字段名:提现单状态
+   * 变量名:status
+   * 是否必填:是
+   * 类型:string(16)
+   * 描述:
+   *  枚举值:
+   *  CREATE_SUCCESS:受理成功
+   *  SUCCESS:提现成功
+   *  FAIL:提现失败
+   *  REFUND:提现退票
+   *  CLOSE:关单
+   *  INIT:业务单已创建
+   * 示例值:CREATE_SUCCESS
+   * 
+ */ + @SerializedName(value = "status") + private String status; + + + /** + *
+   * 字段名:微信支付提现单号
+   * 变量名:withdraw_id
+   * 是否必填:是
+   * 类型:string(128)
+   * 描述:
+   *  电商平台提交二级商户提现申请后,由微信支付返回的申请单号,作为查询申请状态的唯一标识。
+   * 示例值: 12321937198237912739132791732912793127931279317929791239112123
+   * 
+ */ + @SerializedName(value = "withdraw_id") + private String withdrawId; + + /** + *
+   * 字段名:商户提现单号
+   * 变量名:out_request_no
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  商户提现单号,由商户自定义生成。
+   * 示例值: 20190611222222222200000000012122
+   * 
+ */ + @SerializedName(value = "out_request_no") + private String outRequestNo; + + /** + *
+   * 字段名:提现金额
+   * 变量名:amount
+   * 是否必填:是
+   * 类型:int)
+   * 描述:
+   *  单位:分
+   * 示例值:1
+   * 
+ */ + @SerializedName(value = "amount") + private Integer amount; + + + /** + *
+   * 字段名:发起提现时间
+   * 变量名:create_time
+   * 是否必填:是
+   * 类型:string(29)
+   * 描述:
+   *  遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss:sss+TIMEZONE,
+   *  YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss:sss表示时分秒毫秒,
+   *  TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
+   *  例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日13点29分35秒。
+   * 示例值:2015-05-20T13:29:35.120+08:00
+   * 
+ */ + @SerializedName(value = "create_time") + private String createTime; + + + /** + *
+   * 字段名:提现状态更新时间
+   * 变量名:update_time
+   * 是否必填:是
+   * 类型:string(29)
+   * 描述:
+   *  遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss:sss+TIMEZONE,
+   *  YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss:sss表示时分秒毫秒,
+   *  TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
+   *  例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日13点29分35秒。
+   * 示例值:2015-05-20T13:29:35.120+08:00
+   * 
+ */ + @SerializedName(value = "update_time") + private String updateTime; + + + /** + *
+   * 字段名:失败原因
+   * 变量名:reason
+   * 是否必填:是
+   * 类型:string(255)
+   * 描述:
+   *  仅在提现失败、退票、关单时有值
+   * 示例值:卡号错误
+   * 
+ */ + @SerializedName(value = "reason") + private String reason; + + /** + *
+   * 字段名:提现备注
+   * 变量名:remark
+   * 是否必填:是
+   * 类型:string(56)
+   * 描述:
+   *  商户对提现单的备注,若发起提现时未传入相应值或输入不合法,则该值为空
+   * 示例值:交易提现
+   * 
+ */ + @SerializedName(value = "remark") + private String remark; + + /** + *
+   * 字段名:银行附言
+   * 变量名:bank_memo
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  展示在收款银行系统中的附言,由数字、字母、汉字组成(能否成功展示依赖银行系统支持)。若发起提现时未传入相应值或输入不合法,则该值为空
+   * 示例值:微信提现
+   * 
+ */ + @SerializedName(value = "bank_memo") + private String bankMemo; + + /** + *
+   * 字段名:出款账户类型
+   * 变量名:account_type
+   * 是否必填:是
+   * 类型:string(16)
+   * 描述:
+   *  BASIC:基本户
+   *  OPERATION:运营账户
+   *  FEES:手续费账户
+   * 示例值:BASIC
+   * 
+ */ + @SerializedName(value = "account_type") + private String account_type; + + /** + *
+   * 字段名:提现失败解决方案
+   * 变量名:solution
+   * 是否必填:是
+   * 类型:string(255)
+   * 描述:
+   *  仅在提现失败、退票、关单时有值
+   * 示例值:请修改结算银行卡信息
+   * 
+ */ + @SerializedName(value = "solution") + private String solution; + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SubWithdrawStatusResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SubWithdrawStatusResult.java new file mode 100644 index 0000000000..eead7475b9 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SubWithdrawStatusResult.java @@ -0,0 +1,190 @@ +package com.github.binarywang.wxpay.bean.ecommerce; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 二级商户查询提现状态 + *
+ *   文档地址:https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/fund/chapter3_3.shtml
+ * 
+ * @author: f00lish + * @date: 2020/10/27 + */ +@Data +@NoArgsConstructor +public class SubWithdrawStatusResult { + + /** + *
+   * 字段名:二级商户号
+   * 变量名:sub_mchid
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  电商平台二级商户号,由微信支付生成并下发。
+   * 示例值:1900000109
+   * 
+ */ + @SerializedName(value = "sub_mchid") + private String subMchid; + + /** + *
+   * 字段名:电商平台商户号
+   * 变量名:sp_mchid
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  电商平台商户号
+   * 示例值:1800000123
+   * 
+ */ + @SerializedName(value = "sp_mchid") + private String spMchid; + + + /** + *
+   * 字段名:提现单状态
+   * 变量名:status
+   * 是否必填:是
+   * 类型:string(16)
+   * 描述:
+   *  枚举值:
+   *  CREATE_SUCCESS:受理成功
+   *  SUCCESS:提现成功
+   *  FAIL:提现失败
+   *  REFUND:提现退票
+   *  CLOSE:关单
+   *  INIT:业务单已创建
+   * 示例值:CREATE_SUCCESS
+   * 
+ */ + @SerializedName(value = "status") + private String status; + + + /** + *
+   * 字段名:微信支付提现单号
+   * 变量名:withdraw_id
+   * 是否必填:是
+   * 类型:string(128)
+   * 描述:
+   *  电商平台提交二级商户提现申请后,由微信支付返回的申请单号,作为查询申请状态的唯一标识。
+   * 示例值: 12321937198237912739132791732912793127931279317929791239112123
+   * 
+ */ + @SerializedName(value = "withdraw_id") + private String withdrawId; + + /** + *
+   * 字段名:商户提现单号
+   * 变量名:out_request_no
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  商户提现单号,由商户自定义生成。
+   * 示例值: 20190611222222222200000000012122
+   * 
+ */ + @SerializedName(value = "out_request_no") + private String outRequestNo; + + /** + *
+   * 字段名:提现金额
+   * 变量名:amount
+   * 是否必填:是
+   * 类型:int)
+   * 描述:
+   *  单位:分
+   * 示例值:1
+   * 
+ */ + @SerializedName(value = "amount") + private Integer amount; + + + /** + *
+   * 字段名:发起提现时间
+   * 变量名:create_time
+   * 是否必填:是
+   * 类型:string(29)
+   * 描述:
+   *  遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss:sss+TIMEZONE,
+   *  YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss:sss表示时分秒毫秒,
+   *  TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
+   *  例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日13点29分35秒。
+   * 示例值:2015-05-20T13:29:35.120+08:00
+   * 
+ */ + @SerializedName(value = "create_time") + private String createTime; + + + /** + *
+   * 字段名:提现状态更新时间
+   * 变量名:update_time
+   * 是否必填:是
+   * 类型:string(29)
+   * 描述:
+   *  遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss:sss+TIMEZONE,
+   *  YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss:sss表示时分秒毫秒,
+   *  TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。
+   *  例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日13点29分35秒。
+   * 示例值:2015-05-20T13:29:35.120+08:00
+   * 
+ */ + @SerializedName(value = "update_time") + private String updateTime; + + + /** + *
+   * 字段名:失败原因
+   * 变量名:reason
+   * 是否必填:是
+   * 类型:string(255)
+   * 描述:
+   *  仅在提现失败、退票、关单时有值
+   * 示例值:卡号错误
+   * 
+ */ + @SerializedName(value = "reason") + private String reason; + + /** + *
+   * 字段名:提现备注
+   * 变量名:remark
+   * 是否必填:是
+   * 类型:string(56)
+   * 描述:
+   *  商户对提现单的备注,若发起提现时未传入相应值或输入不合法,则该值为空
+   * 示例值:交易提现
+   * 
+ */ + @SerializedName(value = "remark") + private String remark; + + /** + *
+   * 字段名:银行附言
+   * 变量名:bank_memo
+   * 是否必填:是
+   * 类型:string(32)
+   * 描述:
+   *  展示在收款银行系统中的附言,由数字、字母、汉字组成(能否成功展示依赖银行系统支持)。若发起提现时未传入相应值或输入不合法,则该值为空
+   * 示例值:微信提现
+   * 
+ */ + @SerializedName(value = "bank_memo") + private String bankMemo; + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java index 6e536bb39c..367f2e8e1e 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/EcommerceService.java @@ -339,6 +339,31 @@ public interface EcommerceService { */ SpWithdrawResult spWithdraw(SpWithdrawRequest request) throws WxPayException; + /** + *
+   * 二级商户查询提现状态API
+   * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/fund/chapter3_3.shtml
+   * 
+ * + * @param subMchid 二级商户号 + * @param outRequestNo 商户提现单号 + * @return 返回数据 return sub withdraw status result + * @throws WxPayException the wx pay exception + */ + SubWithdrawStatusResult querySubWithdrawByOutRequestNo(String subMchid, String outRequestNo) throws WxPayException; + + /** + *
+   * 电商平台查询提现状态API
+   * 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/fund/chapter3_6.shtml
+   * 
+ * + * @param outRequestNo 商户提现单号 + * @return 返回数据 return sp withdraw status result + * @throws WxPayException the wx pay exception + */ + SpWithdrawStatusResult querySpWithdrawByOutRequestNo(String outRequestNo) throws WxPayException; + /** *
    * 修改结算帐号API
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
index 193d6a20ec..5c2856fbbf 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
@@ -266,6 +266,20 @@ public SpWithdrawResult spWithdraw(SpWithdrawRequest request) throws WxPayExcept
     return GSON.fromJson(response, SpWithdrawResult.class);
   }
 
+  @Override
+  public SubWithdrawStatusResult querySubWithdrawByOutRequestNo(String subMchid, String outRequestNo) throws WxPayException {
+    String url = String.format("%s/v3/ecommerce/fund/withdraw/out-request-no/%s?sub_mcid=%s", this.payService.getPayBaseUrl(), subMchid, outRequestNo);
+    String response = this.payService.getV3(URI.create(url));
+    return GSON.fromJson(response, SubWithdrawStatusResult.class);
+  }
+
+  @Override
+  public SpWithdrawStatusResult querySpWithdrawByOutRequestNo(String outRequestNo) throws WxPayException {
+    String url = String.format("%s/v3/merchant/fund/withdraw/out-request-no%s", this.payService.getPayBaseUrl(), outRequestNo);
+    String response = this.payService.getV3(URI.create(url));
+    return GSON.fromJson(response, SpWithdrawStatusResult.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);

From 5fdb8eb783a94d457885349aab61fc357a1f275d Mon Sep 17 00:00:00 2001
From: hrq 
Date: Tue, 27 Oct 2020 14:33:55 +0800
Subject: [PATCH 3/5] =?UTF-8?q?fix=20=E6=9F=A5=E8=AF=A2=E6=8F=90=E7=8E=B0?=
 =?UTF-8?q?=E7=BB=93=E6=9E=9C=E7=B1=BB=E7=9A=84=E5=BA=8F=E5=88=97=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../wxpay/bean/ecommerce/SpWithdrawStatusResult.java         | 5 ++++-
 .../wxpay/bean/ecommerce/SubWithdrawStatusResult.java        | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SpWithdrawStatusResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SpWithdrawStatusResult.java
index b3daef3946..d4c02443aa 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SpWithdrawStatusResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SpWithdrawStatusResult.java
@@ -4,6 +4,8 @@
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
+import java.io.Serializable;
+
 /**
  * 电商平台查询提现状态
  * 
@@ -14,9 +16,10 @@
  */
 @Data
 @NoArgsConstructor
-public class SpWithdrawStatusResult {
+public class SpWithdrawStatusResult implements Serializable {
 
 
+  private static final long serialVersionUID = -6013827963506201478L;
   /**
    * 
    * 字段名:提现单状态
diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SubWithdrawStatusResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SubWithdrawStatusResult.java
index eead7475b9..27d624872b 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SubWithdrawStatusResult.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/SubWithdrawStatusResult.java
@@ -4,6 +4,8 @@
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
+import java.io.Serializable;
+
 /**
  * 二级商户查询提现状态
  * 
@@ -14,8 +16,9 @@
  */
 @Data
 @NoArgsConstructor
-public class SubWithdrawStatusResult {
+public class SubWithdrawStatusResult implements Serializable {
 
+  private static final long serialVersionUID = 4692602703819018325L;
   /**
    * 
    * 字段名:二级商户号

From ed1c7c4757058efd8927758cfa23878482b283ab Mon Sep 17 00:00:00 2001
From: hrq 
Date: Fri, 30 Oct 2020 15:15:57 +0800
Subject: [PATCH 4/5] =?UTF-8?q?fix=20=E6=94=B6=E4=BB=98=E9=80=9A=E6=8F=90?=
 =?UTF-8?q?=E7=8E=B0=E7=8A=B6=E6=80=81=E6=9F=A5=E8=AF=A2=E6=97=B6=E6=8E=A5?=
 =?UTF-8?q?=E5=8F=A3=E5=9C=B0=E5=9D=80=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../binarywang/wxpay/service/impl/EcommerceServiceImpl.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
index 5c2856fbbf..a41ee81b06 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
@@ -268,14 +268,14 @@ public SpWithdrawResult spWithdraw(SpWithdrawRequest request) throws WxPayExcept
 
   @Override
   public SubWithdrawStatusResult querySubWithdrawByOutRequestNo(String subMchid, String outRequestNo) throws WxPayException {
-    String url = String.format("%s/v3/ecommerce/fund/withdraw/out-request-no/%s?sub_mcid=%s", this.payService.getPayBaseUrl(), subMchid, outRequestNo);
+    String url = String.format("%s/v3/ecommerce/fund/withdraw/out-request-no/%s?sub_mchid=%s", this.payService.getPayBaseUrl(), outRequestNo, subMchid);
     String response = this.payService.getV3(URI.create(url));
     return GSON.fromJson(response, SubWithdrawStatusResult.class);
   }
 
   @Override
   public SpWithdrawStatusResult querySpWithdrawByOutRequestNo(String outRequestNo) throws WxPayException {
-    String url = String.format("%s/v3/merchant/fund/withdraw/out-request-no%s", this.payService.getPayBaseUrl(), outRequestNo);
+    String url = String.format("%s/v3/merchant/fund/withdraw/out-request-no/%s", this.payService.getPayBaseUrl(), outRequestNo);
     String response = this.payService.getV3(URI.create(url));
     return GSON.fromJson(response, SpWithdrawStatusResult.class);
   }

From a2dd7f68936bcf1a2b223cacccf5ff7da82a71df Mon Sep 17 00:00:00 2001
From: hrq 
Date: Thu, 5 Nov 2020 18:32:44 +0800
Subject: [PATCH 5/5] =?UTF-8?q?fix=20=E5=BE=AE=E4=BF=A1=E6=94=B6=E4=BB=98?=
 =?UTF-8?q?=E9=80=9A=E6=9F=A5=E8=AF=A2=E9=80=80=E6=AC=BE=E7=8A=B6=E6=80=81?=
 =?UTF-8?q?=E5=9C=B0=E5=9D=80=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../binarywang/wxpay/service/impl/EcommerceServiceImpl.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
index a41ee81b06..67976caf31 100644
--- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
+++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/EcommerceServiceImpl.java
@@ -226,7 +226,7 @@ public RefundQueryResult queryRefundByRefundId(String subMchid, String refundId)
 
   @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 url = String.format("%s/v3/ecommerce/refunds/out-refund-no/%s?sub_mchid=%s", this.payService.getPayBaseUrl(), outRefundNo, subMchid);
     String response = this.payService.getV3(URI.create(url));
     return GSON.fromJson(response, RefundQueryResult.class);
   }