mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-10-31 10:38:42 +08:00 
			
		
		
		
	#828 优化支付结果通知类的checkResult方法
该方法重写了基类中的同名方法。 return_code为SUCCESS时,如果sign为空,则该通知请求是非微信通知请求,因此抛出异常。 否则,调用基类同名方法。
This commit is contained in:
		 SunshineTech Zhang
					SunshineTech Zhang
				
			
				
					committed by
					
						 Binary Wang
						Binary Wang
					
				
			
			
				
	
			
			
			 Binary Wang
						Binary Wang
					
				
			
						parent
						
							64446f35e4
						
					
				
				
					commit
					f379769c1e
				
			| @ -285,6 +285,24 @@ public class WxPayOrderNotifyResult extends BaseWxPayResult { | |||||||
|   @XStreamAlias("version") |   @XStreamAlias("version") | ||||||
|   private String 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) { | ||||||
|  |       throw new WxPayException("伪造的通知!"); | ||||||
|  |     } | ||||||
|  |      | ||||||
|  |     super.checkResult(wxPayService, signType, checkSuccess); | ||||||
|  |   } | ||||||
|  |    | ||||||
|   /** |   /** | ||||||
|    * From xml wx pay order notify result. |    * From xml wx pay order notify result. | ||||||
|    * |    * | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user