杨杰 4 rokov pred
rodič
commit
db35f4be74

+ 6 - 1
src/main/java/com/llisoft/pay/service/WxPayService.java

@@ -156,7 +156,7 @@ public class WxPayService {
 	 * @author YangJie
 	 * @throws Exception 
 	 * @throws Throwable 
-	 * @createTime 2015年3月31日 下午5:36:27
+	 * https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_2
 	 */
 	public boolean dispose(Map<String, String> resultMap) throws Exception {
 		// 判断通信标识
@@ -174,6 +174,11 @@ public class WxPayService {
 			logger.error("微信支付处理: 交易状态异常: {}", resultMap.get("result_code"));
 			return false;
 		}
+		// 判断业务状态 
+		if (!"SUCCESS".equals(resultMap.get("trade_state"))) {
+			logger.error("微信支付处理: 业务状态异常: {}", resultMap.get("result_code"));
+			return false;
+		}
 		// 完成支付状态
 		String paynum = resultMap.get("out_trade_no"); // paynum
 		String tradenum = resultMap.get("transaction_id"); // 微信交易号