#752 修复微信支付拉取支付评价的接口(limit不参与签名)

This commit is contained in:
Binary Wang
2018-09-09 12:10:15 +08:00
parent cc6dd65671
commit df8dcb003c
13 changed files with 236 additions and 128 deletions

View File

@@ -117,8 +117,8 @@ public class EntPayBankRequest extends BaseWxPayRequest {
}
@Override
protected boolean ignoreSignType() {
return true;
protected String[] getIgnoredParamsForSign() {
return new String[]{"sign_type"};
}
@Override

View File

@@ -54,7 +54,7 @@ public class EntPayQueryRequest extends BaseWxPayRequest {
}
@Override
protected boolean ignoreSignType() {
return true;
protected String[] getIgnoredParamsForSign() {
return new String[]{"sign_type"};
}
}

View File

@@ -198,7 +198,7 @@ public class EntPayRequest extends BaseWxPayRequest {
}
@Override
protected boolean ignoreSignType() {
return true;
protected String[] getIgnoredParamsForSign() {
return new String[]{"sign_type"};
}
}

View File

@@ -187,13 +187,6 @@ public abstract class BaseWxPayRequest implements Serializable {
return xstream.toXML(this);
}
/**
* 签名时是否忽略signType.
*/
protected boolean ignoreSignType() {
return false;
}
/**
* 签名时是否忽略appid.
*/
@@ -201,6 +194,13 @@ public abstract class BaseWxPayRequest implements Serializable {
return false;
}
/**
* 签名时,忽略的参数.
*/
protected String[] getIgnoredParamsForSign() {
return new String[0];
}
/**
* <pre>
* 检查参数,并设置签名.
@@ -248,7 +248,6 @@ public abstract class BaseWxPayRequest implements Serializable {
}
//设置签名字段的值
this.setSign(SignUtils.createSign(this, this.getSignType(), config.getMchKey(),
this.ignoreSignType()));
this.setSign(SignUtils.createSign(this, this.getSignType(), config.getMchKey(), this.getIgnoredParamsForSign()));
}
}

View File

@@ -16,4 +16,9 @@ public class WxPayDefaultRequest extends BaseWxPayRequest {
protected void checkConstraints() {
//do nothing
}
@Override
protected boolean ignoreAppid() {
return true;
}
}

View File

@@ -7,7 +7,7 @@ import me.chanjar.weixin.common.annotation.Required;
/**
* <pre>
* 拉取订单评价数据接口的请求参数封装类
* 拉取订单评价数据接口的请求参数封装类.
* Created by BinaryWang on 2017/9/2.
* </pre>
*
@@ -20,14 +20,11 @@ import me.chanjar.weixin.common.annotation.Required;
@AllArgsConstructor
@XStreamAlias("xml")
public class WxPayQueryCommentRequest extends BaseWxPayRequest {
@Override
protected boolean ignoreSignType() {
return true;
}
private static final long serialVersionUID = 2633600418272768186L;
/**
* <pre>
* 字段名:开始时间
* 字段名:开始时间.
* 变量名begin_time
* 是否必填:是
* 类型String(19)
@@ -41,7 +38,7 @@ public class WxPayQueryCommentRequest extends BaseWxPayRequest {
/**
* <pre>
* 字段名:结束时间
* 字段名:结束时间.
* 变量名end_time
* 是否必填:是
* 类型String(19)
@@ -55,7 +52,7 @@ public class WxPayQueryCommentRequest extends BaseWxPayRequest {
/**
* <pre>
* 字段名:位移
* 字段名:位移.
* 变量名offset
* 是否必填:是
* 类型uint(64)
@@ -69,7 +66,7 @@ public class WxPayQueryCommentRequest extends BaseWxPayRequest {
/**
* <pre>
* 字段名:条数
* 字段名:条数.
* 变量名limit
* 是否必填:否
* 类型uint(32)
@@ -81,11 +78,14 @@ public class WxPayQueryCommentRequest extends BaseWxPayRequest {
private Integer limit;
/**
* 检查约束情况
* 检查约束情况.
*/
@Override
protected void checkConstraints() throws WxPayException {
}
@Override
protected String[] getIgnoredParamsForSign() {
return new String[]{"limit","sign_type"};
}
}

View File

@@ -21,8 +21,8 @@ import lombok.NoArgsConstructor;
@XStreamAlias("xml")
public class WxPaySendRedpackRequest extends BaseWxPayRequest {
@Override
protected boolean ignoreSignType() {
return true;
protected String[] getIgnoredParamsForSign() {
return new String[]{"sign_type"};
}
/**