|
|
@@ -7,7 +7,10 @@ import org.apache.commons.lang3.builder.ToStringBuilder; |
|
|
|
import org.apache.commons.lang3.builder.ToStringStyle; |
|
|
|
|
|
|
|
import com.github.binarywang.wxpay.bean.result.BaseWxPayResult; |
|
|
|
import com.github.binarywang.wxpay.constant.WxPayConstants; |
|
|
|
import com.github.binarywang.wxpay.converter.WxPayOrderNotifyResultConverter; |
|
|
|
import com.github.binarywang.wxpay.exception.WxPayException; |
|
|
|
import com.github.binarywang.wxpay.service.WxPayService; |
|
|
|
import com.github.binarywang.wxpay.util.SignUtils; |
|
|
|
import com.thoughtworks.xstream.XStream; |
|
|
|
import com.thoughtworks.xstream.annotations.XStreamAlias; |
|
|
@@ -285,18 +288,10 @@ public class WxPayOrderNotifyResult extends BaseWxPayResult { |
|
|
|
@XStreamAlias("version") |
|
|
|
private String version; |
|
|
|
|
|
|
|
/** |
|
|
|
* 校验返回结果签名. |
|
|
|
* |
|
|
|
* @param wxPayService the wx pay service |
|
|
|
* @param signType 签名类型 |
|
|
|
* @param checkSuccess 是否同时检查结果是否成功 |
|
|
|
* @throws WxPayException the wx pay exception |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void checkResult(WxPayService wxPayService, String signType, boolean checkSuccess) throws WxPayException { |
|
|
|
//防止伪造成功通知 |
|
|
|
if ("SUCCESS".equals(getReturnCode()) && getSign() == null) { |
|
|
|
if (WxPayConstants.ResultCode.SUCCESS.equals(getReturnCode()) && getSign() == null) { |
|
|
|
throw new WxPayException("伪造的通知!"); |
|
|
|
} |
|
|
|
|
|
|
|