fix: 去除打印日志
This commit is contained in:
parent
baac3fa842
commit
06fb0de039
|
|
@ -12,7 +12,6 @@ import com.ruoyi.common.utils.ip.IpUtils;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
|
@ -23,7 +22,6 @@ import java.util.Map;
|
||||||
@RequestMapping("/api/pay")
|
@RequestMapping("/api/pay")
|
||||||
@Api(tags = "支付接口")
|
@Api(tags = "支付接口")
|
||||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||||
@Slf4j
|
|
||||||
public class PayController {
|
public class PayController {
|
||||||
private final IJinShaService jinShaService;
|
private final IJinShaService jinShaService;
|
||||||
private final IKaDaService kaDaService;
|
private final IKaDaService kaDaService;
|
||||||
|
|
@ -96,51 +94,12 @@ public class PayController {
|
||||||
@PostMapping("/vm-pay")
|
@PostMapping("/vm-pay")
|
||||||
@ApiOperation("VM请求支付")
|
@ApiOperation("VM请求支付")
|
||||||
public AjaxResult vmPay(@RequestBody VmPayReq req, HttpServletRequest request) throws Exception {
|
public AjaxResult vmPay(@RequestBody VmPayReq req, HttpServletRequest request) throws Exception {
|
||||||
// 打印入参
|
|
||||||
log.info("VM支付请求入参 - gearId: {}", req.getGearId());
|
|
||||||
if (req.getVmCardInfo() != null) {
|
|
||||||
VmCardInfo cardInfo = req.getVmCardInfo();
|
|
||||||
log.info("VM支付请求入参 - vmCardInfo: number={}, cvc={}, expYear={}, expMonth={}, email={}, firstName={}, lastName={}, country={}",
|
|
||||||
maskCardNumber(cardInfo.getNumber()),
|
|
||||||
maskCvc(cardInfo.getCvc()),
|
|
||||||
cardInfo.getExpYear(),
|
|
||||||
cardInfo.getExpMonth(),
|
|
||||||
cardInfo.getEmail(),
|
|
||||||
cardInfo.getFirstName(),
|
|
||||||
cardInfo.getLastName(),
|
|
||||||
cardInfo.getCountry());
|
|
||||||
} else {
|
|
||||||
log.info("VM支付请求入参 - vmCardInfo: null");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取用户真实IP地址
|
// 获取用户真实IP地址
|
||||||
String clientIp = IpUtils.getIpAddr(request);
|
String clientIp = IpUtils.getIpAddr(request);
|
||||||
log.info("VM支付请求入参 - clientIp: {}", clientIp);
|
|
||||||
|
|
||||||
PayResVO payResVO = vmService.vmPay(req.getGearId(), req.getVmCardInfo(), clientIp);
|
PayResVO payResVO = vmService.vmPay(req.getGearId(), req.getVmCardInfo(), clientIp);
|
||||||
return AjaxResult.success(payResVO);
|
return AjaxResult.success(payResVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 脱敏卡号(只显示前4位和后4位)
|
|
||||||
*/
|
|
||||||
private String maskCardNumber(String cardNumber) {
|
|
||||||
if (cardNumber == null || cardNumber.length() < 8) {
|
|
||||||
return cardNumber;
|
|
||||||
}
|
|
||||||
return cardNumber.substring(0, 4) + "****" + cardNumber.substring(cardNumber.length() - 4);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 脱敏CVC(全部隐藏)
|
|
||||||
*/
|
|
||||||
private String maskCvc(String cvc) {
|
|
||||||
if (cvc == null || cvc.isEmpty()) {
|
|
||||||
return cvc;
|
|
||||||
}
|
|
||||||
return "***";
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/vm-callBack")
|
@PostMapping("/vm-callBack")
|
||||||
@ApiOperation("VM支付回调")
|
@ApiOperation("VM支付回调")
|
||||||
@Anonymous
|
@Anonymous
|
||||||
|
|
@ -159,6 +118,7 @@ public class PayController {
|
||||||
String paramValue = request.getParameter(paramName);
|
String paramValue = request.getParameter(paramName);
|
||||||
allParams.put(paramName, paramValue);
|
allParams.put(paramName, paramValue);
|
||||||
}
|
}
|
||||||
|
org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(PayController.class);
|
||||||
log.info("VM支付回调请求参数: {}, Content-Type: {}", allParams, contentType);
|
log.info("VM支付回调请求参数: {}, Content-Type: {}", allParams, contentType);
|
||||||
|
|
||||||
req.setMchNo(request.getParameter("mchNo"));
|
req.setMchNo(request.getParameter("mchNo"));
|
||||||
|
|
@ -227,29 +187,8 @@ public class PayController {
|
||||||
req.setSign(request.getParameter("sign"));
|
req.setSign(request.getParameter("sign"));
|
||||||
req.setSignType(request.getParameter("signType"));
|
req.setSignType(request.getParameter("signType"));
|
||||||
|
|
||||||
// 打印解析后的完整对象
|
log.info("VM支付回调解析后的对象: mchOrderNo={}, state={}, sign={}",
|
||||||
log.info("VM支付回调解析后的完整对象: mchNo={}, appId={}, mchOrderNo={}, payOrderId={}, ifCode={}, wayCode={}, amount={}, currency={}, state={}, subject={}, body={}, clientIp={}, channelOrderNo={}, errCode={}, errMsg={}, extParam={}, createdAt={}, successTime={}, reqTime={}, sign={}, signType={}",
|
req.getMchOrderNo(), req.getState(), req.getSign());
|
||||||
req.getMchNo(),
|
|
||||||
req.getAppId(),
|
|
||||||
req.getMchOrderNo(),
|
|
||||||
req.getPayOrderId(),
|
|
||||||
req.getIfCode(),
|
|
||||||
req.getWayCode(),
|
|
||||||
req.getAmount(),
|
|
||||||
req.getCurrency(),
|
|
||||||
req.getState(),
|
|
||||||
req.getSubject(),
|
|
||||||
req.getBody(),
|
|
||||||
req.getClientIp(),
|
|
||||||
req.getChannelOrderNo(),
|
|
||||||
req.getErrCode(),
|
|
||||||
req.getErrMsg(),
|
|
||||||
req.getExtParam(),
|
|
||||||
req.getCreatedAt(),
|
|
||||||
req.getSuccessTime(),
|
|
||||||
req.getReqTime(),
|
|
||||||
req.getSign(),
|
|
||||||
req.getSignType());
|
|
||||||
|
|
||||||
return vmService.vmCallBack(req);
|
return vmService.vmCallBack(req);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue