From 9a183994ffbdd7b490c7ba7dd1934b12980dc5dc Mon Sep 17 00:00:00 2001 From: dingzhiwei Date: Wed, 26 Jan 2022 12:08:15 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Jeepay=E8=B5=9E=E5=8A=A9?= =?UTF-8?q?=E5=B9=BF=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index d31f0beb0..26c4a188a 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,13 @@ + + + + 计全支付Jeepay,开源支付系统 + + + -- Gitee From 3c2a77ea928e61eec4c90b654184f1273a6d1011 Mon Sep 17 00:00:00 2001 From: dingzhiwei Date: Wed, 26 Jan 2022 14:09:55 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Jeepay=E8=B5=9E=E5=8A=A9?= =?UTF-8?q?=E5=B9=BF=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 26c4a188a..7d72b1491 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ - 计全支付Jeepay,开源支付系统 + 计全支付Jeepay,开源支付系统 -- Gitee From 94b9a0746545b8def07ec1caa7c5cb431b8421a1 Mon Sep 17 00:00:00 2001 From: dingzhiwei Date: Tue, 22 Mar 2022 14:20:52 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=B6=88=E8=B4=B9=E8=80=85=E6=8A=95=E8=AF=892.0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../complaint/ComplaintDetailRequest.java | 36 +++ .../bean/complaint/ComplaintDetailResult.java | 236 ++++++++++++++++++ .../complaint/ComplaintNotifyUrlRequest.java | 36 +++ .../complaint/ComplaintNotifyUrlResult.java | 44 ++++ .../bean/complaint/ComplaintRequest.java | 77 ++++++ .../wxpay/bean/complaint/ComplaintResult.java | 58 +++++ .../wxpay/bean/complaint/CompleteRequest.java | 48 ++++ .../complaint/NegotiationHistoryRequest.java | 57 +++++ .../complaint/NegotiationHistoryResult.java | 190 ++++++++++++++ .../wxpay/bean/complaint/ResponseRequest.java | 96 +++++++ .../bean/notify/ComplaintNotifyResult.java | 64 +++++ .../wxpay/service/ComplaintService.java | 132 ++++++++++ .../wxpay/service/WxPayService.java | 37 +++ .../service/impl/BaseWxPayServiceImpl.java | 30 +++ .../service/impl/ComplaintServiceImpl.java | 106 ++++++++ .../impl/WxPayServiceApacheHttpImpl.java | 18 ++ .../impl/WxPayServiceJoddHttpImpl.java | 10 + .../impl/ComplaintServiceImplTest.java | 155 ++++++++++++ 18 files changed, 1430 insertions(+) create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailRequest.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintNotifyUrlRequest.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintNotifyUrlResult.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintRequest.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintResult.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/CompleteRequest.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryRequest.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java create mode 100644 weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java create mode 100644 weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImplTest.java diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailRequest.java new file mode 100644 index 000000000..2e8f23db1 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailRequest.java @@ -0,0 +1,36 @@ +package com.github.binarywang.wxpay.bean.complaint; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 微信消费者投诉2.0 + * 查询投诉单详情请求实体 + * + * @author jmdhappy + * @date 2022-3-19 + */ +@Data +@Builder(builderMethodName = "newBuilder") +@NoArgsConstructor +@AllArgsConstructor +public class ComplaintDetailRequest implements Serializable { + + private static final long serialVersionUID = 3244929701614280801L; + + /** + *
+   * 字段名:投诉单号
+   * 是否必填:是
+   * 描述:投诉单对应的投诉单号
+   * 
+ */ + @SerializedName("complaint_id") + private String complaintId; + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java new file mode 100644 index 000000000..f62c9c1dd --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintDetailResult.java @@ -0,0 +1,236 @@ +package com.github.binarywang.wxpay.bean.complaint; + + +import com.github.binarywang.wxpay.v3.SpecEncrypt; +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 微信消费者投诉2.0 + * 查询投诉单列表返回的实体 + * + * @author jmdhappy + * @date 2022-3-19 + */ +@Data +public class ComplaintDetailResult implements Serializable { + + private static final long serialVersionUID = -6201692411535927503L; + + /** + *
+   * 字段名:投诉单号
+   * 是否必填:是
+   * 描述:投诉单对应的投诉单号
+   * 
+ */ + @SerializedName("complaint_id") + private String complaintId; + + /** + *
+   * 字段名:投诉时间
+   * 是否必填:是
+   * 描述:投诉时间,遵循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.120+08:00表示北京时间2015年05月20日13点29分35秒
+   * 示例值:2015-05-20T13:29:35.120+08:00
+   * 
+ */ + @SerializedName("complaint_time") + private String complaintTime; + + /** + *
+   * 字段名:投诉详情
+   * 是否必填:是
+   * 投诉的具体描述
+   * 
+ */ + @SerializedName("complaint_detail") + private String complaintDetail; + + /** + *
+   * 字段名:被诉商户号
+   * 是否必填:是
+   * 投诉单对应的被诉商户号。
+   * 
+ */ + @SerializedName("complainted_mchid") + private String complaintedMchid; + + /** + *
+   * 字段名:投诉单状态
+   * 是否必填:是
+   * 标识当前投诉单所处的处理阶段,具体状态如下所示:
+   * PENDING:待处理
+   * PROCESSING:处理中
+   * PROCESSED:已处理完成
+   * 
+ */ + @SerializedName("complaint_state") + private String complaintState; + + /** + *
+   * 字段名:投诉人联系方式
+   * 是否必填:否
+   * 投诉人联系方式。该字段已做加密处理,具体解密方法详见敏感信息加密说明。
+   * 
+ */ + @SerializedName("payer_phone") + @SpecEncrypt + private String payerPhone; + + /** + *
+   * 字段名:投诉人openid
+   * 是否必填:是
+   * 投诉人在商户appid下的唯一标识
+   * 
+ */ + @SerializedName("payer_openid") + private String payerOpenid; + + + /** + *
+   * 字段名:投诉资料列表
+   * 是否必填:是
+   * 用户上传的投诉相关资料,包括图片凭证等
+   * 
+ */ + @SerializedName("complaint_media_list") + private List complaintMediaList; + + @Data + public static class ComplaintMedia implements Serializable { + private static final long serialVersionUID = 4240983048700956803L; + + /** + *
+     * 字段名:媒体文件业务类型
+     * 是否必填:是
+     * 描述:
+     * 媒体文件对应的业务类型
+     * USER_COMPLAINT_IMAGE:用户投诉图片,用户提交投诉时上传的图片凭证
+     * OPERATION_IMAGE:操作流水图片,用户、商户、微信支付客服在协商解决投诉时,上传的图片凭证
+     * 注:用户上传的图片凭证会以白名单的形式提供给商户,若希望查看用户图片,联系微信支付客服
+     * 示例值:USER_COMPLAINT_IMAGE
+     * 
+ */ + @SerializedName("media_type") + private String mediaType; + + /** + *
+     * 字段名:媒体文件请求url
+     * 是否必填:是
+     * 描述:
+     * 微信返回的媒体文件请求url
+     * 
+ */ + @SerializedName("media_url") + private String mediaUrl; + + } + + /** + *
+   * 字段名:投诉单关联订单信息
+   * 是否必填:是
+   * 投诉单关联订单信息
+   * 注:投诉单和订单目前是一对一关系,array是预留未来一对多的扩展
+   * 
+ */ + @SerializedName("complaint_order_info") + private List complaintOrderInfo; + + @Data + public static class ComplaintOrder implements Serializable { + private static final long serialVersionUID = 4240983048700956804L; + + /** + *
+     * 字段名:微信订单号
+     * 是否必填:是
+     * 描述:
+     * 投诉单关联的微信订单号
+     * 
+ */ + @SerializedName("transaction_id") + private String transactionId; + + /** + *
+     * 字段名:商户订单号
+     * 是否必填:是
+     * 描述:
+     * 投诉单关联的商户订单号
+     * 
+ */ + @SerializedName("out_trade_no") + private String outTradeNo; + + /** + *
+     * 字段名:订单金额
+     * 是否必填:是
+     * 描述:
+     * 订单金额,单位(分)
+     * 
+ */ + @SerializedName("amount") + private Integer amount; + + } + + /** + *
+   * 字段名:投诉单是否已全额退款
+   * 是否必填:是
+   * 描述:
+   * 投诉单下所有订单是否已全部全额退款
+   * 
+ */ + @SerializedName("complaint_full_refunded") + private Boolean complaintFullRefunded; + + /** + *
+   * 字段名:是否有待回复的用户留言
+   * 是否必填:是
+   * 描述:
+   * 投诉单是否有待回复的用户留言
+   * 
+ */ + @SerializedName("incoming_user_response") + private Boolean incomingUserResponse; + + /** + *
+   * 字段名:问题描述
+   * 是否必填:是
+   * 描述:
+   * 用户发起投诉前选择的faq标题(2021年7月15日之后的投诉单均包含此信息)
+   * 
+ */ + @SerializedName("problem_description") + private String problemDescription; + + /** + *
+   * 字段名:用户投诉次数
+   * 是否必填:是
+   * 描述:
+   * 用户投诉次数。用户首次发起投诉记为1次,用户每有一次继续投诉就加1
+   * 
+ */ + @SerializedName("user_complaint_times") + private Integer userComplaintTimes; +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintNotifyUrlRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintNotifyUrlRequest.java new file mode 100644 index 000000000..28a51bd02 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintNotifyUrlRequest.java @@ -0,0 +1,36 @@ +package com.github.binarywang.wxpay.bean.complaint; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 微信消费者投诉2.0 + * 投诉通知请求实体 + * + * @author jmdhappy + * @date 2022-3-19 + */ +@Data +@Builder(builderMethodName = "newBuilder") +@NoArgsConstructor +@AllArgsConstructor +public class ComplaintNotifyUrlRequest implements Serializable { + + private static final long serialVersionUID = -1L; + + /** + *
+   * 字段名:通知地址
+   * 是否必填:是
+   * 描述:通知地址,仅支持https。
+   * 
+ */ + @SerializedName("url") + private String url; + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintNotifyUrlResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintNotifyUrlResult.java new file mode 100644 index 000000000..5254201e6 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintNotifyUrlResult.java @@ -0,0 +1,44 @@ +package com.github.binarywang.wxpay.bean.complaint; + + +import com.github.binarywang.wxpay.bean.media.MarketingImageUploadResult; +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import me.chanjar.weixin.common.util.json.WxGsonBuilder; + +import java.io.Serializable; +import java.util.List; + +/** + * 微信消费者投诉2.0 + * 投诉通知地址返回的实体 + * + * @author jmdhappy + * @date 2022-3-19 + */ +@Data +public class ComplaintNotifyUrlResult implements Serializable { + + private static final long serialVersionUID = -6201692411535927502L; + + /** + *
+   * 字段名:商户号
+   * 是否必填:是
+   * 描述:返回创建回调地址的商户号,由微信支付生成并下发。
+   * 
+ */ + @SerializedName("mchid") + private String mchid; + + /** + *
+   * 字段名:通知地址
+   * 是否必填:是
+   * 描述:通知地址,仅支持https。
+   * 
+ */ + @SerializedName("url") + private String url; + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintRequest.java new file mode 100644 index 000000000..b53a1b590 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintRequest.java @@ -0,0 +1,77 @@ +package com.github.binarywang.wxpay.bean.complaint; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 微信消费者投诉2.0 + * 查询投诉单列表请求实体 + * + * @author jmdhappy + * @date 2022-3-19 + */ +@Data +@Builder(builderMethodName = "newBuilder") +@NoArgsConstructor +@AllArgsConstructor +public class ComplaintRequest implements Serializable { + + private static final long serialVersionUID = 3244929701614280800L; + + /** + *
+   * 字段名:分页大小
+   * 是否必填:否
+   * 描述:设置该次请求返回的最大投诉条数,范围【1,50】,商户自定义字段,不传默认为10。
+   * 注:如遇到提示“当前查询结果数据量过大”,是回包触发微信支付下行数据包大小限制,请缩小入参limit并重试。
+   * 
+ */ + @SerializedName("limit") + private Integer limit = 10; + + /** + *
+   * 字段名:分页开始位置
+   * 是否必填:否
+   * 描述:该次请求的分页开始位置,从0开始计数,例如offset=10,表示从第11条记录开始返回,不传默认为0 。
+   * 
+ */ + @SerializedName("offset") + private Integer offset = 0; + + /** + *
+   * 字段名:开始日期
+   * 是否必填:是
+   * 描述:投诉发生的开始日期,格式为yyyy-MM-DD。注意,查询日期跨度不超过30天,当前查询为实时查询
+   * 
+ */ + @SerializedName("begin_date") + private String beginDate; + + /** + *
+   * 字段名:结束日期
+   * 是否必填:是
+   * 描述:投诉发生的结束日期,格式为yyyy-MM-DD。注意,查询日期跨度不超过30天,当前查询为实时查询
+   * 
+ */ + @SerializedName("end_date") + private String endDate; + + /** + *
+   * 字段名:被诉商户号
+   * 是否必填:否
+   * 描述:投诉单对应的被诉商户号。
+   * 
+ */ + @SerializedName("complainted_mchid") + private String complaintedMchid; + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintResult.java new file mode 100644 index 000000000..1ee346d53 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ComplaintResult.java @@ -0,0 +1,58 @@ +package com.github.binarywang.wxpay.bean.complaint; + + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 微信消费者投诉2.0 + * 查询投诉单列表返回的实体 + * + * @author jmdhappy + * @date 2022-3-19 + */ +@Data +public class ComplaintResult implements Serializable { + + private static final long serialVersionUID = -6201692411535927502L; + + /** + *
+   * 字段名:分页大小
+   * 是否必填:是
+   * 描述:设置该次请求返回的最大投诉条数,范围【1,50】
+   * 
+ */ + @SerializedName("limit") + private Integer limit; + + /** + *
+   * 字段名:分页开始位置
+   * 是否必填:是
+   * 描述:该次请求的分页开始位置,从0开始计数,例如offset=10,表示从第11条记录开始返回。
+   * 
+ */ + @SerializedName("offset") + private Integer offset; + + /** + *
+   * 字段名:投诉总条数
+   * 是否必填:否
+   * 描述:投诉总条数,当offset=0时返回
+   * 
+ */ + @SerializedName("total_count") + private Integer totalCount; + + /** + * 用户投诉信息详情 + */ + @SerializedName("data") + private List data; + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/CompleteRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/CompleteRequest.java new file mode 100644 index 000000000..a4d066df9 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/CompleteRequest.java @@ -0,0 +1,48 @@ +package com.github.binarywang.wxpay.bean.complaint; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 微信消费者投诉2.0 + * 反馈处理完成请求实体 + * + * @author jmdhappy + * @date 2022-3-19 + */ +@Data +@Builder(builderMethodName = "newBuilder") +@NoArgsConstructor +@AllArgsConstructor +public class CompleteRequest implements Serializable { + + private static final long serialVersionUID = 3243229701614220801L; + + /** + *
+   * 字段名:投诉单号
+   * 是否必填:是
+   * 描述:投诉单对应的投诉单号
+   * 
+ */ + @SerializedName("complaint_id") + @Expose + private String complaintId; + + /** + *
+   * 字段名:被诉商户号
+   * 是否必填:是
+   * 描述:投诉单对应的被诉商户号
+   * 
+ */ + @SerializedName("complainted_mchid") + private String complaintedMchid; + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryRequest.java new file mode 100644 index 000000000..3362e4a92 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryRequest.java @@ -0,0 +1,57 @@ +package com.github.binarywang.wxpay.bean.complaint; + +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 微信消费者投诉2.0 + * 查询投诉协商历史请求实体 + * + * @author jmdhappy + * @date 2022-3-19 + */ +@Data +@Builder(builderMethodName = "newBuilder") +@NoArgsConstructor +@AllArgsConstructor +public class NegotiationHistoryRequest implements Serializable { + + private static final long serialVersionUID = 3244929701614280806L; + + /** + *
+   * 字段名:投诉单号
+   * 是否必填:是
+   * 描述:投诉单对应的投诉单号
+   * 
+ */ + @SerializedName("complaint_id") + private String complaintId; + + /** + *
+   * 字段名:分页大小
+   * 是否必填:否
+   * 描述:设置该次请求返回的最大投诉条数,范围【1,50】,商户自定义字段,不传默认为10。
+   * 注:如遇到提示“当前查询结果数据量过大”,是回包触发微信支付下行数据包大小限制,请缩小入参limit并重试。
+   * 
+ */ + @SerializedName("limit") + private Integer limit = 10; + + /** + *
+   * 字段名:分页开始位置
+   * 是否必填:否
+   * 描述:该次请求的分页开始位置,从0开始计数,例如offset=10,表示从第11条记录开始返回,不传默认为0 。
+   * 
+ */ + @SerializedName("offset") + private Integer offset = 0; + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java new file mode 100644 index 000000000..4e5ab4197 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/NegotiationHistoryResult.java @@ -0,0 +1,190 @@ +package com.github.binarywang.wxpay.bean.complaint; + + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 微信消费者投诉2.0 + * 查询投诉单协商历史返回的实体 + * + * @author jmdhappy + * @date 2022-3-19 + */ +@Data +public class NegotiationHistoryResult implements Serializable { + + private static final long serialVersionUID = -6201692411535927502L; + + /** + *
+   * 字段名:分页大小
+   * 是否必填:是
+   * 描述:设置该次请求返回的最大投诉条数,范围【1,50】
+   * 
+ */ + @SerializedName("limit") + private Integer limit; + + /** + *
+   * 字段名:分页开始位置
+   * 是否必填:是
+   * 描述:该次请求的分页开始位置,从0开始计数,例如offset=10,表示从第11条记录开始返回。
+   * 
+ */ + @SerializedName("offset") + private Integer offset; + + /** + *
+   * 字段名:投诉协商历史总条数
+   * 是否必填:否
+   * 描述:投诉协商历史总条数,当offset=0时返回
+   * 
+ */ + @SerializedName("total_count") + private Integer totalCount; + + /** + * 投诉协商历史 + */ + @SerializedName("data") + private List data; + + @Data + public static class NegotiationHistory implements Serializable { + private static final long serialVersionUID = 4240983048700956824L; + + /** + *
+     * 字段名:投诉资料列表
+     * 是否必填:是
+     * 用户上传的投诉相关资料,包括图片凭证等
+     * 
+ */ + @SerializedName("complaint_media_list") + private List complaintMediaList; + + @Data + public static class ComplaintMedia implements Serializable { + private static final long serialVersionUID = 4240983048700956803L; + + /** + *
+       * 字段名:媒体文件业务类型
+       * 是否必填:是
+       * 描述:
+       * 媒体文件对应的业务类型
+       * USER_COMPLAINT_IMAGE:用户投诉图片,用户提交投诉时上传的图片凭证
+       * OPERATION_IMAGE:操作流水图片,用户、商户、微信支付客服在协商解决投诉时,上传的图片凭证
+       * 注:用户上传的图片凭证会以白名单的形式提供给商户,若希望查看用户图片,联系微信支付客服
+       * 示例值:USER_COMPLAINT_IMAGE
+       * 
+ */ + @SerializedName("media_type") + private String mediaType; + + /** + *
+       * 字段名:媒体文件请求url
+       * 是否必填:是
+       * 描述:
+       * 微信返回的媒体文件请求url
+       * 
+ */ + @SerializedName("media_url") + private String mediaUrl; + + } + + /** + *
+     * 字段名:操作流水号
+     * 是否必填:是
+     * 描述:
+     * 操作流水号
+     * 
+ */ + @SerializedName("log_id") + private String logId; + + /** + *
+     * 字段名:操作人
+     * 是否必填:是
+     * 描述:
+     * 当前投诉协商记录的操作人
+     * 
+ */ + @SerializedName("operator") + private String operator; + + /** + *
+     * 字段名:操作时间
+     * 是否必填:是
+     * 描述:
+     * 当前投诉协商记录的操作时间,遵循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.120+08:00表示北京时间2015年05月20日13点29分35秒。
+     * 示例值:2015-05-20T13:29:35.120+08:00
+     * 
+ */ + @SerializedName("operate_time") + private String operateTime; + + /** + *
+     * 字段名:操作类型
+     * 是否必填:是
+     * 描述:
+     * 当前投诉协商记录的操作类型,对应枚举:
+     * USER_CREATE_COMPLAINT:用户提交投诉
+     * USER_CONTINUE_COMPLAINT:用户继续投诉
+     * USER_RESPONSE:用户留言
+     * PLATFORM_RESPONSE:平台留言
+     * MERCHANT_RESPONSE:商户留言
+     * MERCHANT_CONFIRM_COMPLETE:商户申请结单
+     * COMPLAINT_FULL_REFUNDED:投诉单全额退款
+     * USER_CREATE_COMPLAINT_SYSTEM_MESSAGE:用户提交投诉系统通知
+     * COMPLAINT_FULL_REFUNDED_SYSTEM_MESSAGE:投诉单全额退款系统通知
+     * USER_CONTINUE_COMPLAINT_SYSTEM_MESSAGE:用户继续投诉系统通知
+     * MERCHANT_CONFIRM_COMPLETE_SYSTEM_MESSAGE:商户申请结单系统通知
+     * USER_REVOKE_COMPLAINT:用户主动撤诉(只存在于历史投诉单的协商历史中)
+     * PLATFORM_HELP_APPLICATION:平台问询
+     * USER_APPLY_PLATFORM_HELP:申请协助
+     * 
+ */ + @SerializedName("operate_type") + private String operateType; + + /** + *
+     * 字段名:操作内容
+     * 是否必填:否
+     * 描述:
+     * 当前投诉协商记录的具体内容
+     * 
+ */ + @SerializedName("operate_details") + private String operateDetails; + + /** + *
+     * 字段名:图片凭证
+     * 是否必填:是
+     * 描述:
+     * 当前投诉协商记录提交的图片凭证(url格式),最多返回4张图片,url有效时间为1小时。如未查询到协商历史图片凭证,则返回空数组。
+     * 注:本字段包含商户、微信支付客服在协商解决投诉时上传的图片凭证,若希望查看用户图片,请使用complaint_media_list字段并联系微信支付客服
+     * 
+ */ + @SerializedName("image_list") + private List imageList; + + } + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java new file mode 100644 index 000000000..24e287773 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/complaint/ResponseRequest.java @@ -0,0 +1,96 @@ +package com.github.binarywang.wxpay.bean.complaint; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 微信消费者投诉2.0 + * 提交回复请求实体 + * + * @author jmdhappy + * @date 2022-3-19 + */ +@Data +@Builder(builderMethodName = "newBuilder") +@NoArgsConstructor +@AllArgsConstructor +public class ResponseRequest implements Serializable { + + private static final long serialVersionUID = 3244929701614220801L; + + /** + *
+   * 字段名:投诉单号
+   * 是否必填:是
+   * 描述:投诉单对应的投诉单号
+   * 
+ */ + @SerializedName("complaint_id") + @Expose + private String complaintId; + + /** + *
+   * 字段名:被诉商户号
+   * 是否必填:是
+   * 描述:投诉单对应的被诉商户号
+   * 
+ */ + @SerializedName("complainted_mchid") + private String complaintedMchid; + + /** + *
+   * 字段名:回复内容
+   * 是否必填:是
+   * 描述:具体的投诉处理方案,限制200个字符以内。
+   * 
+ */ + @SerializedName("response_content") + private String responseContent; + + /** + *
+   * 字段名:回复图片
+   * 是否必填:否
+   * 描述:
+   * 传入调用商户上传反馈图片接口返回的media_id,最多上传4张图片凭证
+   * 示例值:file23578_21798531.jpg
+   * 
+ */ + @SerializedName("response_images") + private String responseImages; + + /** + *
+   * 字段名:跳转链接
+   * 是否必填:是
+   * 描述:
+   * 商户可在回复中附加跳转链接,引导用户跳转至商户客诉处理页面,链接需满足https格式
+   * 注:配置文字链属于灰度功能, 若有需要请使用超管邮箱,按照要求发送邮件申请。邮件要求详情见:
+   * 商户申请开通留言链接白名单指南。
+   * 示例值:https://www.xxx.com/notify
+   * 
+ */ + @SerializedName("jump_url") + private String jumpUrl; + + /** + *
+   * 字段名:跳转链接文案
+   * 是否必填:否
+   * 描述:
+   * 实际展示给用户的文案,附在回复内容之后。用户点击文案,即可进行跳转。
+   * 注:若传入跳转链接,则跳转链接文案为必传项,二者缺一不可。
+   * 
+ */ + @SerializedName("jump_url_text") + private String jumpUrlText; + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java new file mode 100644 index 000000000..a5d18df6d --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/notify/ComplaintNotifyResult.java @@ -0,0 +1,64 @@ +package com.github.binarywang.wxpay.bean.notify; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * 投诉通知. + * 文档见:https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_16.shtml + * + * @author jmdhappy + */ +@Data +@NoArgsConstructor +public class ComplaintNotifyResult implements Serializable { + 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(value = "complaint_id") + private String complaintId; + + /** + *
+     * 字段名:动作类型
+     * 是否必填:是
+     * 描述:
+     * 触发本次投诉通知回调的具体动作类型,枚举如下:
+     * CREATE_COMPLAINT:用户提交投诉
+     * CONTINUE_COMPLAINT:用户继续投诉
+     * USER_RESPONSE:用户新留言
+     * RESPONSE_BY_PLATFORM:平台新留言
+     * SELLER_REFUND:收款方全额退款
+     * MERCHANT_RESPONSE:商户新回复
+     * MERCHANT_CONFIRM_COMPLETE:商户反馈处理完成
+     * 
+ */ + @SerializedName(value = "action_type") + private String actionType; + + } + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java new file mode 100644 index 000000000..bd6a2e346 --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java @@ -0,0 +1,132 @@ +package com.github.binarywang.wxpay.service; + +import com.github.binarywang.wxpay.bean.complaint.*; +import com.github.binarywang.wxpay.exception.WxPayException; + +import javax.crypto.BadPaddingException; + +/** + *
+ * 微信支付 消费者投诉2.0 API.
+ * Created by jmdhappy on 2022/3/19.
+ * 
+ * + * @author jmdhappy + */ +public interface ComplaintService { + + /** + *
+   * 查询投诉单列表API
+   * 商户可通过调用此接口,查询指定时间段的所有用户投诉信息,以分页输出查询结果。
+   * 对于服务商、渠道商,可通过调用此接口,查询指定子商户号对应子商户的投诉信息,若不指定则查询所有子商户投诉信息。
+   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_11.shtml
+   * 
+ * + * @param request {@link ComplaintRequest} 查询投诉单列表请求数据 + * @return {@link ComplaintResult} 微信返回的投诉单列表 + * @throws WxPayException the wx pay exception + */ + ComplaintResult queryComplaints(ComplaintRequest request) throws WxPayException, BadPaddingException; + + /** + *
+   * 查询投诉单详情API
+   * 商户可通过调用此接口,查询指定投诉单的用户投诉详情,包含投诉内容、投诉关联订单、投诉人联系方式等信息,方便商户处理投诉。
+   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_13.shtml
+   * 
+ * + * @param request {@link ComplaintDetailRequest} 投诉单详情请求数据 + * @return {@link ComplaintDetailResult} 微信返回的投诉单详情 + * @throws WxPayException the wx pay exception + */ + ComplaintDetailResult getComplaint(ComplaintDetailRequest request) throws WxPayException, BadPaddingException; + + /** + *
+   * 查询投诉协商历史API
+   * 商户可通过调用此接口,查询指定投诉的用户商户协商历史,以分页输出查询结果,方便商户根据处理历史来制定后续处理方案。
+   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_12.shtml
+   * 
+ * + * @param request {@link NegotiationHistoryRequest} 请求数据 + * @return {@link NegotiationHistoryResult} 微信返回结果 + * @throws WxPayException the wx pay exception + */ + NegotiationHistoryResult queryNegotiationHistorys(NegotiationHistoryRequest request) throws WxPayException; + + /** + *
+   * 创建投诉通知回调地址API
+   * 商户通过调用此接口创建投诉通知回调URL,当用户产生新投诉且投诉状态已变更时,微信支付会通过回 调URL通知商户。对于服务商、渠道商,会收到所有子商户的投诉信息推送。
+   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_2.shtml
+   * 
+ * + * @param request {@link ComplaintDetailRequest} 请求数据 + * @return {@link ComplaintNotifyUrlResult} 微信返回结果 + * @throws WxPayException the wx pay exception + */ + ComplaintNotifyUrlResult addComplaintNotifyUrl(ComplaintNotifyUrlRequest request) throws WxPayException; + + /** + *
+   * 查询投诉通知回调地址API
+   * 商户通过调用此接口查询投诉通知的回调URL。
+   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_3.shtml
+   * 
+ * + * @return {@link ComplaintNotifyUrlResult} 微信返回结果 + * @throws WxPayException the wx pay exception + */ + ComplaintNotifyUrlResult getComplaintNotifyUrl() throws WxPayException; + + /** + *
+   * 更新投诉通知回调地址API
+   * 商户通过调用此接口更新投诉通知的回调URL。
+   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_4.shtml
+   * 
+ * + * @param request {@link ComplaintDetailRequest} 请求数据 + * @return {@link ComplaintNotifyUrlResult} 微信返回结果 + * @throws WxPayException the wx pay exception + */ + ComplaintNotifyUrlResult updateComplaintNotifyUrl(ComplaintNotifyUrlRequest request) throws WxPayException; + + /** + *
+   * 删除投诉通知回调地址API
+   * 当商户不再需要推送通知时,可通过调用此接口删除投诉通知的回调URL,取消通知回调。
+   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_5.shtml
+   * 
+ * + * @throws WxPayException the wx pay exception + */ + void deleteComplaintNotifyUrl() throws WxPayException; + + /** + *
+   * 提交回复API
+   * 商户可通过调用此接口,提交回复内容。其中上传图片凭证需首先调用商户上传反馈图片接口,得到图片id,再将id填入请求。
+   * 回复可配置文字链,传入跳转链接文案和跳转链接字段,用户点击即可跳转对应页面
+   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_14.shtml
+   * 
+ * + * @param request {@link ResponseRequest} 请求数据 + * @throws WxPayException the wx pay exception + */ + void submitResponse(ResponseRequest request) throws WxPayException; + + /** + *
+   * 反馈处理完成API
+   * 商户可通过调用此接口,反馈投诉单已处理完成。
+   * 文档详见: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_15.shtml
+   * 
+ * + * @param request {@link CompleteRequest} 请求数据 + * @throws WxPayException the wx pay exception + */ + void complete(CompleteRequest request) 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 2a567fa1d..3f98c3d2c 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 @@ -173,6 +173,25 @@ public interface WxPayService { */ InputStream downloadV3(String url) throws WxPayException; + /** + * 发送put V3请求,得到响应字符串. + * + * @param url 请求地址 + * @param url 请求数据 + * @return 返回请求结果字符串 string + * @throws WxPayException the wx pay exception + */ + String putV3(String url, String requestStr) throws WxPayException; + + /** + * 发送delete V3请求,得到响应字符串. + * + * @param url 请求地址 + * @return 返回请求结果字符串 string + * @throws WxPayException the wx pay exception + */ + String deleteV3(String url) throws WxPayException; + /** * 获取微信签约代扣服务类 * @return entrust service @@ -1296,4 +1315,22 @@ public interface WxPayService { * @throws WxPayException . */ WxPayQueryExchangeRateResult queryExchangeRate(String feeType, String date) throws WxPayException; + + /** + * 解析投诉通知 + * 详见https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_16.shtml + * + * @param notifyData 通知数据 + * @param header 通知头部数据,不传则表示不校验头 + * @return the wx pay refund notify result + * @throws WxPayException the wx pay exception + */ + ComplaintNotifyResult parseComplaintNotifyResult(String notifyData, SignatureHeader header) throws WxPayException; + + /** + * 获取消费者投诉服务类. + * + * @return the complaints service + */ + ComplaintService getComplaintsService(); } 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 437b61867..ae40210c8 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 @@ -77,6 +77,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService { private final WxEntrustPapService wxEntrustPapService = new WxEntrustPapServiceImpl(this); private final PartnerTransferService partnerTransferService = new PartnerTransferServiceImpl(this); private final PayrollService payrollService = new PayrollServiceImpl(this); + private final ComplaintService complaintsService = new ComplaintServiceImpl(this); protected Map configMap; @@ -1222,4 +1223,33 @@ public abstract class BaseWxPayServiceImpl implements WxPayService { result.checkResult(this, request.getSignType(), true); return result; } + + @Override + public ComplaintNotifyResult parseComplaintNotifyResult(String notifyData, SignatureHeader header) throws WxPayException { + if (Objects.nonNull(header) && !this.verifyNotifySign(header, notifyData)) { + throw new WxPayException("非法请求,头部信息验证失败"); + } + OriginNotifyResponse response = GSON.fromJson(notifyData, OriginNotifyResponse.class); + OriginNotifyResponse.Resource resource = response.getResource(); + String cipherText = resource.getCiphertext(); + String associatedData = resource.getAssociatedData(); + String nonce = resource.getNonce(); + String apiV3Key = this.getConfig().getApiV3Key(); + try { + String result = AesUtils.decryptToString(associatedData, nonce, cipherText, apiV3Key); + ComplaintNotifyResult.DecryptNotifyResult decryptNotifyResult = GSON.fromJson(result, ComplaintNotifyResult.DecryptNotifyResult.class); + ComplaintNotifyResult notifyResult = new ComplaintNotifyResult(); + notifyResult.setRawData(response); + notifyResult.setResult(decryptNotifyResult); + return notifyResult; + } catch (GeneralSecurityException | IOException e) { + throw new WxPayException("解析报文异常!", e); + } + } + + @Override + public ComplaintService getComplaintsService() { + return complaintsService; + } + } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java new file mode 100644 index 000000000..ee7c403fd --- /dev/null +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java @@ -0,0 +1,106 @@ +package com.github.binarywang.wxpay.service.impl; + +import com.github.binarywang.wxpay.bean.complaint.*; +import com.github.binarywang.wxpay.exception.WxPayException; +import com.github.binarywang.wxpay.service.ComplaintService; +import com.github.binarywang.wxpay.service.WxPayService; +import com.github.binarywang.wxpay.v3.util.RsaCryptoUtil; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import lombok.RequiredArgsConstructor; + +import javax.crypto.BadPaddingException; +import java.util.List; + +/** + *
+ * 消费者投诉2.0 实现.
+ * Created by jmdhappy on 2022/3/19.
+ * 
+ * + * @author jmdhappy + */ +@RequiredArgsConstructor +public class ComplaintServiceImpl implements ComplaintService { + private static final Gson GSON = new GsonBuilder().create(); + private final WxPayService payService; + + @Override + public ComplaintResult queryComplaints(ComplaintRequest request) throws WxPayException, BadPaddingException { + String url = String.format("%s/v3/merchant-service/complaints-v2?limit=%d&offset=%d&begin_date=%s&end_date=%s&complainted_mchid=%s", + this.payService.getPayBaseUrl(), request.getLimit(), request.getOffset(), request.getBeginDate(), request.getEndDate(), request.getComplaintedMchid()); + String response = this.payService.getV3(url); + ComplaintResult complaintResult = GSON.fromJson(response, ComplaintResult.class); + List data = complaintResult.getData(); + for (ComplaintDetailResult complaintDetailResult : data) { + // 对手机号进行解密操作 + String payerPhone = RsaCryptoUtil.decryptOAEP(complaintDetailResult.getPayerPhone(), this.payService.getConfig().getPrivateKey()); + complaintDetailResult.setPayerPhone(payerPhone); + } + return complaintResult; + } + + @Override + public ComplaintDetailResult getComplaint(ComplaintDetailRequest request) throws WxPayException, BadPaddingException { + String url = String.format("%s/v3/merchant-service/complaints-v2/%s", + this.payService.getPayBaseUrl(), request.getComplaintId()); + String response = this.payService.getV3(url); + ComplaintDetailResult result = GSON.fromJson(response, ComplaintDetailResult.class); + // 对手机号进行解密操作 + String payerPhone = RsaCryptoUtil.decryptOAEP(result.getPayerPhone(), this.payService.getConfig().getPrivateKey()); + result.setPayerPhone(payerPhone); + return result; + } + + @Override + public NegotiationHistoryResult queryNegotiationHistorys(NegotiationHistoryRequest request) throws WxPayException { + String url = String.format("%s/v3/merchant-service/complaints-v2/%s/negotiation-historys?limit=%d&offset=%d", + this.payService.getPayBaseUrl(), request.getComplaintId(), request.getLimit(), request.getOffset()); + String response = this.payService.getV3(url); + return GSON.fromJson(response, NegotiationHistoryResult.class); + } + + @Override + public ComplaintNotifyUrlResult addComplaintNotifyUrl(ComplaintNotifyUrlRequest request) throws WxPayException { + String url = String.format("%s/v3/merchant-service/complaint-notifications", this.payService.getPayBaseUrl()); + String response = this.payService.postV3(url, GSON.toJson(request)); + return GSON.fromJson(response, ComplaintNotifyUrlResult.class); + } + + @Override + public ComplaintNotifyUrlResult getComplaintNotifyUrl() throws WxPayException { + String url = String.format("%s/v3/merchant-service/complaint-notifications", this.payService.getPayBaseUrl()); + String response = this.payService.getV3(url); + return GSON.fromJson(response, ComplaintNotifyUrlResult.class); + } + + @Override + public ComplaintNotifyUrlResult updateComplaintNotifyUrl(ComplaintNotifyUrlRequest request) throws WxPayException { + String url = String.format("%s/v3/merchant-service/complaint-notifications", this.payService.getPayBaseUrl()); + String response = this.payService.putV3(url, GSON.toJson(request)); + return GSON.fromJson(response, ComplaintNotifyUrlResult.class); + } + + @Override + public void deleteComplaintNotifyUrl() throws WxPayException { + String url = String.format("%s/v3/merchant-service/complaint-notifications", this.payService.getPayBaseUrl()); + this.payService.deleteV3(url); + } + + @Override + public void submitResponse(ResponseRequest request) throws WxPayException { + String url = String.format("%s/v3/merchant-service/complaints-v2/%s/response", this.payService.getPayBaseUrl(), request.getComplaintId()); + // 上面url已经含有complaintId,这里设置为空,避免在body中再次传递,否则微信会报错 + request.setComplaintId(null); + this.payService.postV3(url, GSON.toJson(request)); + } + + @Override + public void complete(CompleteRequest request) throws WxPayException { + String url = String.format("%s/v3/merchant-service/complaints-v2/%s/complete", this.payService.getPayBaseUrl(), request.getComplaintId()); + // 上面url已经含有complaintId,这里设置为空,避免在body中再次传递,否则微信会报错 + request.setComplaintId(null); + this.payService.postV3(url, GSON.toJson(request)); + } + +} diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java index 87d5014ac..e70813fc3 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceApacheHttpImpl.java @@ -269,6 +269,24 @@ public class WxPayServiceApacheHttpImpl extends BaseWxPayServiceImpl { } } + @Override + public String putV3(String url, String requestStr) throws WxPayException { + HttpPut httpPut = new HttpPut(url); + StringEntity entity = this.createEntry(requestStr); + httpPut.setEntity(entity); + httpPut.addHeader("Accept", "application/json"); + httpPut.addHeader("Content-Type", "application/json"); + return requestV3(url, httpPut); + } + + @Override + public String deleteV3(String url) throws WxPayException { + HttpDelete httpDelete = new HttpDelete(url); + httpDelete.addHeader("Accept", "application/json"); + httpDelete.addHeader("Content-Type", "application/json"); + return requestV3(url, httpDelete); + } + private CloseableHttpClient createApiV3HttpClient() throws WxPayException { CloseableHttpClient apiV3HttpClient = this.getConfig().getApiV3HttpClient(); if (null == apiV3HttpClient) { diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java index 374528454..29521d493 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/WxPayServiceJoddHttpImpl.java @@ -96,6 +96,16 @@ public class WxPayServiceJoddHttpImpl extends BaseWxPayServiceImpl { return null; } + @Override + public String putV3(String url, String requestStr) throws WxPayException { + return null; + } + + @Override + public String deleteV3(String url) throws WxPayException { + return null; + } + private HttpRequest buildHttpRequest(String url, String requestStr, boolean useKey) throws WxPayException { HttpRequest request = HttpRequest .post(url) diff --git a/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImplTest.java b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImplTest.java new file mode 100644 index 000000000..6014924fd --- /dev/null +++ b/weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImplTest.java @@ -0,0 +1,155 @@ +package com.github.binarywang.wxpay.service.impl; + +import com.github.binarywang.wxpay.bean.complaint.*; +import com.github.binarywang.wxpay.bean.profitsharing.*; +import com.github.binarywang.wxpay.constant.WxPayConstants; +import com.github.binarywang.wxpay.exception.WxPayException; +import com.github.binarywang.wxpay.service.WxPayService; +import com.github.binarywang.wxpay.testbase.ApiTestModule; +import com.google.inject.Inject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.Guice; +import org.testng.annotations.Test; + +import javax.crypto.BadPaddingException; + +/** + *
+ *  消费者投诉2.0 测试类
+ * 
+ * + * @author jmdhappy + */ +@Test +@Guice(modules = ApiTestModule.class) +public class ComplaintServiceImplTest { + + private final Logger logger = LoggerFactory.getLogger(this.getClass()); + + @Inject + private WxPayService payService; + + private static final String complaintId = "200231020220320120496109901"; + + /** + * 查询投诉单列表API + * @throws WxPayException + */ + @Test + public void testQueryComplaints() throws WxPayException, BadPaddingException { + ComplaintRequest request = ComplaintRequest + .newBuilder() + .offset(0) + .limit(10) + .beginDate("2022-03-01") + .endDate("2022-03-20") + .complaintedMchid(this.payService.getConfig().getMchId()) + .build(); + this.logger.info(this.payService.getComplaintsService().queryComplaints(request).toString()); + } + + /** + * 查询投诉单详情API + * @throws WxPayException + */ + @Test + public void testGetComplaint() throws WxPayException, BadPaddingException { + ComplaintDetailRequest request = ComplaintDetailRequest + .newBuilder() + .complaintId(complaintId) + .build(); + this.logger.info(this.payService.getComplaintsService().getComplaint(request).toString()); + } + + /** + * 查询投诉协商历史API + * @throws WxPayException + */ + @Test + public void testQueryNegotiationHistorys() throws WxPayException { + NegotiationHistoryRequest request = NegotiationHistoryRequest + .newBuilder() + .complaintId(complaintId) + .offset(0) + .limit(20) + .build(); + this.logger.info(this.payService.getComplaintsService().queryNegotiationHistorys(request).toString()); + } + + /** + * 创建投诉通知回调地址API + * @throws WxPayException + */ + @Test + public void testAddComplaintNotifyUrl() throws WxPayException { + ComplaintNotifyUrlRequest request = ComplaintNotifyUrlRequest + .newBuilder() + .url("https://jeepay.natapp4.cc") + .build(); + this.logger.info(this.payService.getComplaintsService().addComplaintNotifyUrl(request).toString()); + } + + /** + * 查询投诉通知回调地址API + * @throws WxPayException + */ + @Test + public void testGetComplaintNotifyUrl() throws WxPayException { + this.logger.info(this.payService.getComplaintsService().getComplaintNotifyUrl().toString()); + } + + /** + * 更新投诉通知回调地址API + * @throws WxPayException + */ + @Test + public void testUpdateComplaintNotifyUrl() throws WxPayException { + ComplaintNotifyUrlRequest request = ComplaintNotifyUrlRequest + .newBuilder() + .url("https://jeepay1.natapp4.cc") + .build(); + this.logger.info(this.payService.getComplaintsService().updateComplaintNotifyUrl(request).toString()); + } + + /** + * 删除投诉通知回调地址API + * @throws WxPayException + */ + @Test + public void testDeleteComplaintNotifyUrl() throws WxPayException { + this.payService.getComplaintsService().deleteComplaintNotifyUrl(); + } + + /** + * 提交回复API + * @throws WxPayException + */ + @Test + public void testSubmitResponse() throws WxPayException { + ResponseRequest request = ResponseRequest + .newBuilder() + .complaintId(complaintId) + .complaintedMchid(this.payService.getConfig().getMchId()) + .responseContent("测试投诉接口1233,正在处理,不要炸鸡") + //.jumpUrl("https://www.baidu.com") + //.jumpUrlText("问题解决方案") + .build(); + this.payService.getComplaintsService().submitResponse(request); + } + + /** + * 反馈处理完成API + * @throws WxPayException + */ + @Test + public void testComplete() throws WxPayException { + CompleteRequest request = CompleteRequest + .newBuilder() + .complaintId(complaintId) + .complaintedMchid(this.payService.getConfig().getMchId()) + .build(); + this.payService.getComplaintsService().complete(request); + } + +} -- Gitee From dc5443686e6900fc05d7c7bebc87266ec750e018 Mon Sep 17 00:00:00 2001 From: dingzhiwei Date: Tue, 22 Mar 2022 18:53:21 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=9B=A0=E6=8A=95?= =?UTF-8?q?=E8=AF=89=E6=89=8B=E6=9C=BA=E5=8F=B7=E4=B8=BA=E7=A9=BA=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=A7=A3=E5=AF=86=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wxpay/service/impl/ComplaintServiceImpl.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java index ee7c403fd..d269a8f90 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java @@ -34,8 +34,10 @@ public class ComplaintServiceImpl implements ComplaintService { List data = complaintResult.getData(); for (ComplaintDetailResult complaintDetailResult : data) { // 对手机号进行解密操作 - String payerPhone = RsaCryptoUtil.decryptOAEP(complaintDetailResult.getPayerPhone(), this.payService.getConfig().getPrivateKey()); - complaintDetailResult.setPayerPhone(payerPhone); + if(complaintDetailResult.getPayerPhone() != null) { + String payerPhone = RsaCryptoUtil.decryptOAEP(complaintDetailResult.getPayerPhone(), this.payService.getConfig().getPrivateKey()); + complaintDetailResult.setPayerPhone(payerPhone); + } } return complaintResult; } @@ -47,8 +49,10 @@ public class ComplaintServiceImpl implements ComplaintService { String response = this.payService.getV3(url); ComplaintDetailResult result = GSON.fromJson(response, ComplaintDetailResult.class); // 对手机号进行解密操作 - String payerPhone = RsaCryptoUtil.decryptOAEP(result.getPayerPhone(), this.payService.getConfig().getPrivateKey()); - result.setPayerPhone(payerPhone); + if(result.getPayerPhone() != null) { + String payerPhone = RsaCryptoUtil.decryptOAEP(result.getPayerPhone(), this.payService.getConfig().getPrivateKey()); + result.setPayerPhone(payerPhone); + } return result; } -- Gitee From 608a4905dedda154d7198c35ef7ba0936c0fc23a Mon Sep 17 00:00:00 2001 From: dingzhiwei Date: Wed, 27 Apr 2022 17:17:20 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E7=94=B5=E5=95=86=E6=94=B6=E4=BB=98?= =?UTF-8?q?=E9=80=9A=E4=BA=8C=E7=BA=A7=E5=95=86=E6=88=B7=E8=BF=9B=E4=BB=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=93=E7=AE=97=E8=A7=84=E5=88=99=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bean/ecommerce/ApplymentsRequest.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ApplymentsRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ApplymentsRequest.java index ac17e18cd..87ce9b5b2 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ApplymentsRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/ecommerce/ApplymentsRequest.java @@ -200,6 +200,18 @@ public class ApplymentsRequest implements Serializable { @SerializedName(value = "sales_scene_info") private SalesSceneInfo salesSceneInfo; + /** + *
+   * 字段名:+结算规则
+   * 变量名:settlement_info
+   * 是否必填:否
+   * 类型:object
+   * 描述:请填写商家的结算费率规则、所属行业等信息。若电商平台未传入,系统将填写默认值
+   * 
+ */ + @SerializedName(value = "settlement_info") + private SettlementInfo settlementInfo; + /** *
    * 字段名:商户简称
@@ -822,4 +834,39 @@ public class ApplymentsRequest implements Serializable {
 
   }
 
+  @Data
+  @NoArgsConstructor
+  public static class SettlementInfo implements Serializable {
+    /**
+     * 
+     * 字段名:结算规则ID
+     * 变量名:settlement_id
+     * 是否必填:否
+     * 类型:int
+     * 描述:
+     *  1、选填,请选择二级商户的结算规则ID,需匹配电商平台开通工具箱选择的费率档位,详细参见电商二级商户结算规则对照表;https://kf.qq.com/faq/220228qEfuAz220228bMFji6.html
+     *  2、若电商平台未传入,将默认选择0.6%费率对应的结算规则id;
+     *  示例值:719
+     * 
+ */ + @SerializedName(value = "settlement_id") + private Integer settlementId; + + /** + *
+     * 字段名:所属行业
+     * 变量名:qualification_type
+     * 是否必填:二选一
+     * 类型:string[1, 200]
+     * 描述:
+     *  1、选填,请填写二级商户所属的行业名称,映射特殊资质要求,详细参见电商二级商户结算规则对照表;
+     *  2、若电商平台未传入,将默认填写无需特殊资质的行业名称;
+     *  示例值:零售批发/生活娱乐/其他
+     * 
+ */ + @SerializedName(value = "qualification_type") + private String qualificationType; + + } + } -- Gitee From 61b04b1803cedf674e50da11b6599be9136cc6af Mon Sep 17 00:00:00 2001 From: dingzhiwei Date: Mon, 4 Jul 2022 18:29:20 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E7=89=B9=E7=BA=A6=E5=95=86=E6=88=B7=E8=BF=9B=E4=BB=B6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../applyment/ModifySettlementRequest.java | 6 + .../WxPayApplyment4SubCreateRequest.java | 185 +++++++++++++++--- .../bean/applyment/enums/CertTypeEnum.java | 20 +- .../bean/applyment/enums/IdTypeEnum.java | 12 ++ 4 files changed, 187 insertions(+), 36 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/ModifySettlementRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/ModifySettlementRequest.java index 8623b5cd6..e374d952a 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/ModifySettlementRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/ModifySettlementRequest.java @@ -26,6 +26,12 @@ public class ModifySettlementRequest implements Serializable { */ @SerializedName("account_type") private AccountTypeEnum accountType; + /** + * 开户名称 + */ + @SpecEncrypt + @SerializedName("account_name") + private String accountName; /** * 开户银行 */ diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java index fe956af23..481ff1bb3 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java @@ -64,7 +64,7 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { private BankAccountInfo bankAccountInfo; /** - * 结算银行账户 + * 补充材料 */ @SerializedName("addition_info") private AdditionInfo additionInfo; @@ -80,6 +80,17 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { public static class ContactInfo implements Serializable { private static final long serialVersionUID = 1L; + /** + * 超级管理员类型 + * 1、主体为“个体工商户/企业/政府机关/事业单位/社会组织”,可选择:LEGAL:经营者/法人,SUPER:经办人 。(经办人:经商户授权办理微信支付业务的人员)。 + * 枚举值: + * LEGAL:经营者/法人 + * SUPER:经办人 + * 示例值:LEGAL + */ + @SerializedName("contact_type") + private String contactType; + /** * 超级管理员姓名 */ @@ -87,6 +98,22 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { @SpecEncrypt private String contactName; + /** + * 超级管理员证件类型 + * 当超级管理员类型是经办人时,请上传超级管理员证件类型。 + * IDENTIFICATION_TYPE_IDCARD:中国大陆居民-身份证 + * IDENTIFICATION_TYPE_OVERSEA_PASSPORT:其他国家或地区居民-护照 + * IDENTIFICATION_TYPE_HONGKONG_PASSPORT:中国香港居民-来往内地通行证 + * IDENTIFICATION_TYPE_MACAO_PASSPORT:中国澳门居民-来往内地通行证 + * IDENTIFICATION_TYPE_TAIWAN_PASSPORT:中国台湾居民-来往大陆通行证 + * IDENTIFICATION_TYPE_FOREIGN_RESIDENT:外国人居留证 + * IDENTIFICATION_TYPE_HONGKONG_MACAO_RESIDENT:港澳居民证 + * IDENTIFICATION_TYPE_TAIWAN_RESIDENT:台湾居民证 + * 示例值:IDENTIFICATION_TYPE_IDCARD + */ + @SerializedName("contact_id_doc_type") + private String contactIdDocType; + /** * 超级管理员身份证件号码 * 1、“超级管理员身份证号码”与“超级管理员微信openid”,二选一必填。 @@ -97,6 +124,58 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { @SpecEncrypt private String contactIdNumber; + /** + * 超级管理员证件正面照片 + * 1、当超级管理员类型是经办人时,请上传超级管理员证件的正面照片。 + * 2、若证件类型为身份证,请上传人像面照片。 + * 3、可上传1张图片,请填写通过图片上传API预先上传图片生成好的MediaID。 + * 4、请上传彩色照片or彩色扫描件or复印件(需加盖公章鲜章),可添加“微信支付”相关水印(如微信支付认证)。 + * 示例值:jTpGmxUXqRTvDujqhThn4ReFxikqJ5YW6zFQ + */ + @SerializedName("contact_id_doc_copy") + private String contactIdDocCopy; + + /** + * 超级管理员证件反面照片 + * 1、当超级管理员类型是经办人时,请上传超级管理员证件的反面照片。 + * 2、若证件类型为护照,无需上传反面照片。 + * 3、可上传1张图片,请填写通过图片上传API预先上传图片生成好的MediaID。 + * 4、请上传彩色照片or彩色扫描件or复印件(需加盖公章鲜章),可添加“微信支付”相关水印(如微信支付认证)。 + * 示例值:jTpGmxUX3FBWVQ5NJTZvvDujqhThn4ReFxikqJ5YW6zFQ + */ + @SerializedName("contact_id_doc_copy_back") + private String contactIdDocCopyBack; + + /** + * 超级管理员证件有效期开始时间 + * 1、当超级管理员类型是经办人时,请上传证件有效期开始时间。 + * 2、请按照示例值填写。 + * 3、结束时间大于开始时间。 + * 示例值:2019-06-06 + */ + @SerializedName("contact_period_begin") + private String contactPeriodBegin; + + /** + * 超级管理员证件有效期结束时间 + * 1、当超级管理员类型是经办人时,请上传证件有效期结束时间。 + * 2、请按照示例值填写,若证件有效期为长期,请填写:长期。 + * 3、结束时间大于开始时间。 + * 示例值:2026-06-06 + */ + @SerializedName("contact_period_end") + private String contactPeriodEnd; + + /** + * 业务办理授权函 + * 1、当超级管理员类型是经办人时,请上传业务办理授权函。 + * 2、请参照[示例图]打印业务办理授权函,全部信息需打印,不支持手写商户信息,并加盖公章。 + * 3、可上传1张图片,请填写通过图片上传API预先上传图片生成好的MediaID。 + * 示例值:47ZC6GC-vnrbEny_Ie_An5-tCpqxucuxi-vByf3Gjm7KEIUv0OF4wFNIO4kqg05InE4d2I6_H7I4 + */ + @SerializedName("business_authorization_letter") + private String businessAuthorizationLetter; + /** * 超级管理员微信openid * 1、“超级管理员身份证件号码”与“超级管理员微信openid”,二选一必填。 @@ -140,6 +219,12 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { @SerializedName("subject_type") private SubjectTypeEnum subjectType; + /** + * 是否是金融机构 + */ + @SerializedName("finance_institution") + private boolean financeInstitution; + /** * 营业执照 */ @@ -171,11 +256,11 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { private IdentityInfo identityInfo; /** - * 最终受益人信息(UBO] + * 最终受益人信息列表(UBO) */ - @SerializedName("ubo_info") + @SerializedName("ubo_info_list") @SpecEncrypt - private UboInfo uboInfo; + private List uboInfoList; /** * 小微辅助证明材料(subjectType为小微商户时必填) @@ -210,6 +295,21 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { */ @SerializedName("legal_person") private String legalPerson; + /** + * 注册地址 + */ + @SerializedName("license_address") + private String licenseAddress; + /** + * 有效期限开始日期 + */ + @SerializedName("period_begin") + private String periodBegin; + /** + * 有效期限结束日期 + */ + @SerializedName("period_end") + private String periodEnd; } @Data @@ -255,7 +355,7 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { /** - * 法人姓名 + * 法定代表人 */ @SerializedName("legal_person") private String legalPerson; @@ -314,12 +414,24 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { public static class IdentityInfo implements Serializable { private static final long serialVersionUID = 1683704338370383827L; + /** + * 证件持有人类型 + */ + @SerializedName("id_holder_type") + private IdTypeEnum idHolderType; + /** * 证件类型 */ @SerializedName("id_doc_type") private IdTypeEnum idDocType; + /** + * 法定代表人说明函 + */ + @SerializedName("authorize_letter_copy") + private IdTypeEnum authorizeLetterCopy; + /** * 身份证信息 */ @@ -357,7 +469,6 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { */ @SerializedName("id_card_national") private String idCardNational; - /** * 身份证姓名 */ @@ -370,6 +481,12 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { @SerializedName("id_card_number") @SpecEncrypt private String idCardNumber; + /** + * 身份证居住地址 + */ + @SerializedName("id_card_address") + @SpecEncrypt + private String idCardAddress; /** * 身份证有效期开始时间 */ @@ -391,10 +508,15 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { public static class IdDocInfo implements Serializable { private static final long serialVersionUID = 7335589815924447719L; /** - * 证件照片 + * 证件正面照片 */ @SerializedName("id_doc_copy") private String idDocCopy; + /** + * 证件反面照片 + */ + @SerializedName("id_doc_copy_back") + private String idDocCopyBack; /** * 证件姓名 @@ -409,6 +531,12 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { @SerializedName("id_doc_number") @SpecEncrypt private String idDocNumber; + /** + * 身份证居住地址 + */ + @SerializedName("id_card_address") + @SpecEncrypt + private String idCardAddress; /** * 证件有效期开始时间 */ @@ -432,45 +560,46 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { /** * 证件类型 */ - @SerializedName("id_type") - private IdTypeEnum idType; + @SerializedName("ubo_id_doc_type") + private IdTypeEnum uboIdDocType; /** - * 身份证人像面照片 + * 证件正面照片 */ - @SerializedName("id_card_copy") - private String idCardCopy; + @SerializedName("ubo_id_doc_copy") + private String uboIdDocCopy; /** - * 身份证国徽面照片 + * 证件反面照片 */ - @SerializedName("id_card_national") - private String idCardNational; + @SerializedName("ubo_id_doc_copy_back") + private String uboIdDocCopyBack; /** - * 证件照片 + * 证件姓名 */ - @SerializedName("id_doc_copy") - private String idDocCopy; + @SerializedName("ubo_id_doc_name") + @SpecEncrypt + private String uboIdDocName; /** - * 受益人姓名 + * 证件号码 */ - @SerializedName("name") + @SerializedName("ubo_id_doc_number") @SpecEncrypt - private String name; + private String uboIdDocNumber; /** - * 证件号码 + * 证件居住地址 */ - @SerializedName("id_number") + @SerializedName("ubo_id_doc_address") @SpecEncrypt - private String idNumber; + private String uboIdDocAddress; /** * 证件有效期开始时间 */ - @SerializedName("id_period_begin") - private String idPeriodBegin; + @SerializedName("ubo_period_begin") + private String uboPeriodBegin; /** * 证件有效期结束时间 */ - @SerializedName("id_period_end") - private String idPeriodEnd; + @SerializedName("ubo_period_end") + private String uboPeriodEnd; } @Data diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/CertTypeEnum.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/CertTypeEnum.java index f7415fdc3..91d0c5370 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/CertTypeEnum.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/CertTypeEnum.java @@ -40,14 +40,6 @@ public enum CertTypeEnum { * 基金会法人登记证书 */ CERTIFICATE_TYPE_2396, - /** - * 慈善组织公开募捐资格证书 - */ - CERTIFICATE_TYPE_2397, - /** - * 农民专业合作社法人营业执照 - */ - CERTIFICATE_TYPE_2398, /** * 宗教活动场所登记证 */ @@ -56,5 +48,17 @@ public enum CertTypeEnum { * 其他证书/批文/证明 */ CERTIFICATE_TYPE_2400, + /** + * 执业许可证/执业证 + */ + CERTIFICATE_TYPE_2520, + /** + * 基层群众性自治组织特别法人统一社会信用代码证 + */ + CERTIFICATE_TYPE_2521, + /** + * 农村集体经济组织登记证 + */ + CERTIFICATE_TYPE_2522, ; } diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/IdTypeEnum.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/IdTypeEnum.java index d65c502b8..a46cc8456 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/IdTypeEnum.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/enums/IdTypeEnum.java @@ -25,5 +25,17 @@ public enum IdTypeEnum { * 中国台湾居民-来往大陆通行证 */ IDENTIFICATION_TYPE_TAIWAN_PASSPORT, + /** + * 外国人居留证 + */ + IDENTIFICATION_TYPE_FOREIGN_RESIDENT, + /** + * 港澳居民证 + */ + IDENTIFICATION_TYPE_HONGKONG_MACAO_RESIDENT, + /** + * 台湾居民证 + */ + IDENTIFICATION_TYPE_TAIWAN_RESIDENT, ; } -- Gitee From 9d626a5f1645e8a1484632b56ab35e8a7ee1a022 Mon Sep 17 00:00:00 2001 From: dingzhiwei Date: Fri, 8 Jul 2022 14:52:28 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E7=89=B9=E7=BA=A6=E5=95=86=E6=88=B7=E8=BF=9B=E4=BB=B6=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java index 481ff1bb3..2bfd5be41 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/applyment/WxPayApplyment4SubCreateRequest.java @@ -223,7 +223,7 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { * 是否是金融机构 */ @SerializedName("finance_institution") - private boolean financeInstitution; + private Boolean financeInstitution; /** * 营业执照 @@ -450,7 +450,7 @@ public class WxPayApplyment4SubCreateRequest implements Serializable { * 经营者/法人是否为受益人 */ @SerializedName("owner") - private boolean owner; + private Boolean owner; @Data @Builder -- Gitee