Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
shuaje committed Dec 23, 2017
1 parent e53b4dd commit c330375
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/main/java/top/ibase4j/core/util/AlipayUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ public static String getSign(String out_trade_no, String subject, String body, B
try {
AlipayTradeQueryResponse response = alipayClient.execute(request);
if (!response.isSuccess()) {
result.put("trade_status_desc", response.getSubMsg());
result.put("trade_status", "0");
result.put("trade_state_desc", response.getSubMsg());
result.put("trade_state", "0");
} else {
Map<?, ?> body = JSON.parseObject(response.getBody(), Map.class);
Map<?, ?> resultMap = JSON.parseObject(body.get("alipay_trade_query_response").toString());
Expand All @@ -97,16 +97,16 @@ public static String getSign(String out_trade_no, String subject, String body, B
Date date = DateUtil.stringToDate((String)resultMap.get("send_pay_date"));
result.put("time_end", date);
result.put("trade_no", resultMap.get("trade_no"));
result.put("trade_status", "1");
result.put("trade_state", "1");
} else {
result.put("trade_status_desc", resultMap.get("msg"));
result.put("trade_status", "2");
result.put("trade_state_desc", resultMap.get("msg"));
result.put("trade_state", "2");
}
}
} catch (AlipayApiException e) {
logger.error("", e);
result.put("trade_status_desc", e.getMessage());
result.put("trade_status", "0");
result.put("trade_state_desc", e.getMessage());
result.put("trade_state", "0");
}
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/top/ibase4j/core/util/WeChatUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public static Map<String, Object> queryOrder(String mch_id, String appId, String
if (WxPayment.codeIsOK(trade_state)) {
Date date = DateUtil.stringToDate(resultMap.get("time_end"));
result.put("time_end", date);
result.put("transaction_id", resultMap.get("transaction_id"));
result.put("trade_no", resultMap.get("transaction_id"));
result.put("trade_state", "1");
} else {
result.put("trade_state_desc", resultMap.get("trade_state_desc"));
Expand Down

0 comments on commit c330375

Please sign in to comment.