You've already forked FrameTour-BE
StringUtils替换
This commit is contained in:
@@ -12,9 +12,9 @@ import com.ycwl.basic.pay.entity.RefundOrderRequest;
|
||||
import com.ycwl.basic.pay.entity.RefundOrderResponse;
|
||||
import com.ycwl.basic.pay.entity.RefundResponse;
|
||||
import com.ycwl.basic.pay.exceptions.PayException;
|
||||
import jakarta.servlet.ServletInputStream;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Strings;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
@@ -81,7 +81,7 @@ public class CongMingPayAdapter implements IPayAdapter {
|
||||
String response = HttpUtil.post(url, JacksonUtil.toJSONString(params));
|
||||
Map<String, Object> json = JacksonUtil.parseObject(response, Map.class);
|
||||
System.out.println(json);
|
||||
if (StringUtils.equals((String) json.get("result_code"), "fail")) {
|
||||
if (Strings.CS.equals((String) json.get("result_code"), "fail")) {
|
||||
throw new PayException("查询异常!异常提示:" + json.get("error_msg"));
|
||||
}
|
||||
resp.setSkipPay(false);
|
||||
@@ -115,7 +115,7 @@ public class CongMingPayAdapter implements IPayAdapter {
|
||||
PayResponse resp = new PayResponse();
|
||||
resp.setPayPriceInYuan(new BigDecimal(moneyStr));
|
||||
resp.setOrderNo(orderId);
|
||||
if (StringUtils.equalsIgnoreCase("success", resultCode)) {
|
||||
if (Strings.CI.equals("success", resultCode)) {
|
||||
resp.setState(PayResponse.PAY_STATE.SUCCESS);
|
||||
} else {
|
||||
resp.setState(PayResponse.PAY_STATE.FAIL);
|
||||
@@ -136,7 +136,7 @@ public class CongMingPayAdapter implements IPayAdapter {
|
||||
String response = HttpUtil.post(url, JacksonUtil.toJSONString(params));
|
||||
Map<String, Object> json = JacksonUtil.parseObject(response, Map.class);
|
||||
System.out.println(json);
|
||||
if (StringUtils.equals((String) json.get("result_code"), "fail")) {
|
||||
if (Strings.CS.equals((String) json.get("result_code"), "fail")) {
|
||||
throw new PayException("查询异常!异常提示:" + json.get("error_msg"));
|
||||
}
|
||||
resp.setOriginalResponse(json);
|
||||
@@ -180,7 +180,7 @@ public class CongMingPayAdapter implements IPayAdapter {
|
||||
String response = HttpUtil.post(url, JacksonUtil.toJSONString(params));
|
||||
Map<String, Object> json = JacksonUtil.parseObject(response, Map.class);
|
||||
System.out.println(json);
|
||||
if (StringUtils.equalsIgnoreCase((String) json.get("result_code"), "fail")) {
|
||||
if (Strings.CI.equals((String) json.get("result_code"), "fail")) {
|
||||
throw new PayException("退款异常!异常提示:" + json.get("error_msg"));
|
||||
}
|
||||
return resp;
|
||||
@@ -195,7 +195,7 @@ public class CongMingPayAdapter implements IPayAdapter {
|
||||
resp.setValid(true);
|
||||
resp.setRefundPriceInYuan(new BigDecimal(moneyStr));
|
||||
resp.setOrderNo(orderId);
|
||||
if (StringUtils.equals("success", resultCode)) {
|
||||
if (Strings.CS.equals("success", resultCode)) {
|
||||
resp.setSuccess();
|
||||
} else {
|
||||
resp.setFail();
|
||||
@@ -220,7 +220,7 @@ public class CongMingPayAdapter implements IPayAdapter {
|
||||
params.put("sign", parseSign(params, config.getApiKey()));
|
||||
String response = HttpUtil.post(url, JacksonUtil.toJSONString(params));
|
||||
Map<String, Object> json = JacksonUtil.parseObject(response, Map.class);
|
||||
if (StringUtils.equals((String) json.get("result_code"), "fail")) {
|
||||
if (Strings.CS.equals((String) json.get("result_code"), "fail")) {
|
||||
throw new PayException("取消订单异常!异常提示:" + json.get("error_msg"));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user