33333333333

This commit is contained in:
777
2025-01-19 19:30:21 +08:00
parent 0b76e4a123
commit e07f27f595
18 changed files with 123 additions and 73 deletions

View File

@@ -329,32 +329,70 @@ public class PayController {
}
}
@GetMapping(value = "/trd/notify/v8")
@RequestMapping(value = "/trd/notify/wx/{type}", method = {RequestMethod.POST, RequestMethod.GET})
@Operation(hidden = true)
@Log(title = "第三方支付回调V8", businessType = BusinessType.OTHER, isSaveDb = false)
@Log(title = "第三方微信支付回调", businessType = BusinessType.OTHER, isSaveDb = false)
@SaIgnore
public String trdNotifyUrlV8(HttpServletRequest request) {
public String trdWxNotifyUrl(HttpServletRequest request,@PathVariable("type") String type) {
try {
TrdPayTypeEnum trdPayTypeEnum = TrdPayTypeEnum.V8;
if(type == null){
log.error("收到第三方微信支付回调,支付类型为空");
return "failure";
}
TrdPayTypeEnum trdPayTypeEnum = TrdPayTypeEnum.getByCode(type.toUpperCase());
if(trdPayTypeEnum == null){
log.error("收到第三方微信支付回调,未找到支付类型 type={}",type);
return "failure";
}
Map<String, String> params = AliPayApi.toMap(request);
log.info("收到第三方支付回调 {}:{}",trdPayTypeEnum.name(), JSON.toJSONString(params));
log.info("收到第三方微信支付回调 {}:{}",trdPayTypeEnum.name(), JSON.toJSONString(params));
NotifyResp notifyResp = trdPayManager.getNotifyResp(params, trdPayTypeEnum);
if(!notifyResp.isSuccess()){
return "failure";
}
payManager.callBack(notifyResp.getOrderNo(),notifyResp.getTrdOrderNo(),params,notifyResp.getPayTypeEnum().name(), PayTypeEnum.TRD);
payManager.callBack(notifyResp.getOrderNo(),notifyResp.getTrdOrderNo(),params,notifyResp.getPayTypeEnum().name(), PayTypeEnum.WX);
return trdPayTypeEnum.getNotifyResp();
} catch (Exception e) {
log.error("第三方支付回调失败! V8", e);
log.error("第三方支付微信回调失败! type={}",type, e);
return "failure";
}
}
@RequestMapping(value = "/trd/notify/ali/{type}", method = {RequestMethod.POST, RequestMethod.GET})
@Operation(hidden = true)
@Log(title = "第三方支付支付宝回调", businessType = BusinessType.OTHER, isSaveDb = false)
@SaIgnore
public String trdAliNotifyUrl(HttpServletRequest request,@PathVariable("type") String type) {
try {
if(type == null){
log.error("收到第三方支付支付宝回调,支付类型为空");
return "failure";
}
TrdPayTypeEnum trdPayTypeEnum = TrdPayTypeEnum.getByCode(type.toUpperCase());
if(trdPayTypeEnum == null){
log.error("收到第三方支付支付宝回调,未找到支付类型 type={}",type);
return "failure";
}
Map<String, String> params = AliPayApi.toMap(request);
log.info("收到第三方支付支付宝回调 {}:{}",trdPayTypeEnum.name(), JSON.toJSONString(params));
NotifyResp notifyResp = trdPayManager.getNotifyResp(params, trdPayTypeEnum);
if(!notifyResp.isSuccess()){
return "failure";
}
payManager.callBack(notifyResp.getOrderNo(),notifyResp.getTrdOrderNo(),params,notifyResp.getPayTypeEnum().name(), PayTypeEnum.ALI);
return trdPayTypeEnum.getNotifyResp();
} catch (Exception e) {
log.error("第三方支付支付宝回调失败! type={}",type, e);
return "failure";
}
}
@PostMapping(value = "/trd/notify/{type}")
@RequestMapping(value = "/trd/notify/{type}", method = {RequestMethod.POST, RequestMethod.GET})
@Operation(hidden = true)
@Log(title = "第三方支付回调", businessType = BusinessType.OTHER, isSaveDb = false)
@SaIgnore
@Deprecated
public String trdNotifyUrl(HttpServletRequest request,@PathVariable("type") String type) {
try {
if(type == null){