Skip to content

Commit 8fe1e6e

Browse files
jackytsebinarywang
authored andcommitted
🆕 #3452 【微信支付】新增消费者投诉2.0的更新退款审批结果的接口
1 parent 16f2922 commit 8fe1e6e

File tree

3 files changed

+112
-0
lines changed

3 files changed

+112
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
package com.github.binarywang.wxpay.bean.complaint;
2+
3+
import com.google.gson.annotations.Expose;
4+
import com.google.gson.annotations.SerializedName;
5+
import lombok.AllArgsConstructor;
6+
import lombok.Builder;
7+
import lombok.Data;
8+
import lombok.NoArgsConstructor;
9+
10+
import java.io.Serializable;
11+
import java.util.List;
12+
13+
/**
14+
* 微信消费者投诉2.0
15+
* 更新退款审批结果请求实体
16+
*
17+
* @author <a href="https://github.com/jackytse">jackytse</a>
18+
* created on 2024-12-21
19+
*/
20+
@Data
21+
@Builder(builderMethodName = "newBuilder")
22+
@NoArgsConstructor
23+
@AllArgsConstructor
24+
public class UpdateRefundProgressRequest implements Serializable {
25+
private static final long serialVersionUID = 6975811815225228118L;
26+
27+
/**
28+
* <pre>
29+
* 字段名:投诉单号
30+
* 是否必填:是
31+
* 描述:投诉单对应的投诉单号
32+
* </pre>
33+
*/
34+
@SerializedName("complaint_id")
35+
@Expose
36+
private String complaintId;
37+
38+
/**
39+
* <pre>
40+
* 字段名:审批动作
41+
* 是否必填:是
42+
* 描述:同意 或 拒绝
43+
* 可选取值:
44+
* REJECT: 拒绝退款
45+
* APPROVE: 同意退款
46+
* </pre>
47+
*/
48+
@SerializedName("action")
49+
private String action;
50+
51+
/**
52+
* <pre>
53+
* 字段名:预计发起退款时间
54+
* 是否必填:否
55+
* 描述:在同意退款时返回,预计将在多少个工作日内能发起退款, 0代表当天
56+
* </pre>
57+
*/
58+
@SerializedName("launch_refund_day")
59+
private Integer launchRefundDay;
60+
61+
/**
62+
* <pre>
63+
* 字段名:拒绝退款原因
64+
* 是否必填:否
65+
* 描述:在拒绝退款时返回拒绝退款的原因
66+
* </pre>
67+
*/
68+
@SerializedName("reject_reason")
69+
private String rejectReason;
70+
71+
/**
72+
* <pre>
73+
* 字段名:拒绝退款的举证图片列表
74+
* 是否必填:否
75+
* 描述:在拒绝退款时,如果有拒绝的图片举证,可以提供 最多上传4张图片, 传入调用“商户上传反馈图片”接口返回的media_id,最多上传4张图片凭证
76+
* </pre>
77+
*/
78+
@SerializedName("reject_media_list")
79+
private List<String> rejectMediaList;
80+
81+
/**
82+
* <pre>
83+
* 字段名:备注
84+
* 是否必填:否
85+
* 描述:任何需要向微信支付客服反馈的信息
86+
* </pre>
87+
*/
88+
@SerializedName("remark")
89+
private String remark;
90+
}

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/ComplaintService.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,20 @@ public interface ComplaintService {
135135
*/
136136
void complete(CompleteRequest request) throws WxPayException;
137137

138+
/**
139+
* <pre>
140+
* 更新退款审批结果API
141+
* 针对“申请退款单”,需要商户明确返回是否可退款的审批结果。
142+
* 若根据用户描述,核实可以退款,审批动作传入“APPROVE”,同意退款,并给出一个预计退款时间。传入“同意退款”后,需要额外调退款接口发起原路退款。退款到账后,投诉单的状态将自动扭转为“处理完成”。
143+
* 若根据用户描述,核实不能退款,审批动作传入“REJECT”,拒绝退款,并说明拒绝退款原因。驳回退款后,投诉单的状态将自动扭转为“处理完成”。
144+
* 文档详见: <a href="https://pay.wechatpay.cn/docs/merchant/apis/consumer-complaint/complaints/update-refund-progress.html">...</a>
145+
* </pre>
146+
*
147+
* @param request {@link UpdateRefundProgressRequest} 请求数据
148+
* @throws WxPayException the wx pay exception
149+
*/
150+
void updateRefundProgress(UpdateRefundProgressRequest request) throws WxPayException;
151+
138152
/**
139153
* <pre>
140154
* 商户上传反馈图片API

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/ComplaintServiceImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ public void complete(CompleteRequest request) throws WxPayException {
112112
this.payService.postV3(url, GSON.toJson(request));
113113
}
114114

115+
@Override
116+
public void updateRefundProgress(UpdateRefundProgressRequest request) throws WxPayException {
117+
String url = String.format("%s/v3/merchant-service/complaints-v2/%s/update-refund-progress", this.payService.getPayBaseUrl(), request.getComplaintId());
118+
// 上面url已经含有complaintId,这里设置为空,避免在body中再次传递,否则微信会报错
119+
request.setComplaintId(null);
120+
this.payService.postV3(url, GSON.toJson(request));
121+
}
122+
115123
@Override
116124
public ImageUploadResult uploadResponseImage(File imageFile) throws WxPayException, IOException {
117125
String url = String.format("%s/v3/merchant-service/images/upload", this.payService.getPayBaseUrl());

0 commit comments

Comments
 (0)