🎨 修复接口参数命名错误问题

This commit is contained in:
Binary Wang
2021-09-19 12:59:03 +08:00
parent cabee0f70c
commit 2019efffa3
4 changed files with 14 additions and 16 deletions

View File

@ -19,16 +19,14 @@ public class WxPayRefundQueryV3Request implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* <pre> * <pre>
* 字段名:商户单号 * 字段名:商户退款单号
* 变量名out_trade_no * 变量名out_refund_no
* 是否必填:是 * 是否必填:是
* 类型string[1,32] * 类型string[1, 64]
* 描述: * 描述:商户系统内部的退款单号商户系统内部唯一只能是数字、大小写字母_-|*@ ,同一退款单号多次请求只退一笔。
* 商户系统内部订单号只能是数字、大小写字母_-*且在同一个商户号下唯一。
* 特殊规则最小字符长度为6
* 示例值1217752501201407033233368018 * 示例值1217752501201407033233368018
* </pre> * </pre>
*/ */
@SerializedName(value = "out_trade_no") @SerializedName(value = "out_refund_no")
private String outTradeNo; private String outRefundNo;
} }

View File

@ -697,11 +697,11 @@ public interface WxPayService {
* 接口链接https://api.mch.weixin.qq.com/v3/refund/domestic/refunds/{out_refund_no} * 接口链接https://api.mch.weixin.qq.com/v3/refund/domestic/refunds/{out_refund_no}
* </pre> * </pre>
* *
* @param outTradeNo 商户单号 * @param outRefundNo 商户退款单号
* @return 退款信息 wx pay refund query result * @return 退款信息 wx pay refund query result
* @throws WxPayException the wx pay exception * @throws WxPayException the wx pay exception
*/ */
WxPayRefundQueryV3Result refundQueryV3(String outTradeNo) throws WxPayException; WxPayRefundQueryV3Result refundQueryV3(String outRefundNo) throws WxPayException;
/** /**
* <pre> * <pre>

View File

@ -305,15 +305,15 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
} }
@Override @Override
public WxPayRefundQueryV3Result refundQueryV3(String outTradeNo) throws WxPayException { public WxPayRefundQueryV3Result refundQueryV3(String outRefundNo) throws WxPayException {
String url = String.format("%s/v3/refund/domestic/refunds/%s", this.getPayBaseUrl(), outTradeNo); String url = String.format("%s/v3/refund/domestic/refunds/%s", this.getPayBaseUrl(), outRefundNo);
String response = this.getV3(url); String response = this.getV3(url);
return GSON.fromJson(response, WxPayRefundQueryV3Result.class); return GSON.fromJson(response, WxPayRefundQueryV3Result.class);
} }
@Override @Override
public WxPayRefundQueryV3Result refundQueryV3(WxPayRefundQueryV3Request request) throws WxPayException { public WxPayRefundQueryV3Result refundQueryV3(WxPayRefundQueryV3Request request) throws WxPayException {
String url = String.format("%s/v3/refund/domestic/refunds/%s", this.getPayBaseUrl(), request.getOutTradeNo()); String url = String.format("%s/v3/refund/domestic/refunds/%s", this.getPayBaseUrl(), request.getOutRefundNo());
String response = this.getV3(url); String response = this.getV3(url);
return GSON.fromJson(response, WxPayRefundQueryV3Result.class); return GSON.fromJson(response, WxPayRefundQueryV3Result.class);
} }

View File

@ -769,8 +769,8 @@ public class BaseWxPayServiceImplTest {
@Test @Test
public void testRefundQueryV3() throws WxPayException { public void testRefundQueryV3() throws WxPayException {
WxPayRefundQueryV3Request request = new WxPayRefundQueryV3Request(); WxPayRefundQueryV3Request request = new WxPayRefundQueryV3Request();
// request.setOutTradeNo("n1ZvYqjAg3D7LUBa"); // request.setOutRefundNo("n1ZvYqjAg3D7LUBa");
request.setOutTradeNo("123456789011"); request.setOutRefundNo("123456789011");
WxPayRefundQueryV3Result result = this.payService.refundQueryV3(request); WxPayRefundQueryV3Result result = this.payService.refundQueryV3(request);
System.out.println(GSON.toJson(result)); System.out.println(GSON.toJson(result));
} }