支付 回调 处理 以及 订单状态 修改

This commit is contained in:
2025-02-15 15:12:57 +08:00
parent faa6f448c0
commit 5fd691f71b
15 changed files with 285 additions and 67 deletions

View File

@@ -3,7 +3,9 @@ package com.czg.controller;
import com.alibaba.fastjson2.JSONObject;
import com.czg.CzgPayUtils;
import com.czg.entity.CzgBaseRespParams;
import com.czg.entity.notify.CzgPayNotifyDTO;
import com.czg.order.service.OrderInfoService;
import com.czg.utils.AssertUtil;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -17,14 +19,16 @@ import org.springframework.web.bind.annotation.RequestMapping;
public class NotifyController {
private static final String SUCCESS = "SUCCESS";
// @Resource
// private PayService payService;
@Resource
private OrderInfoService orderInfoService;
@PostMapping("payCallBack")
public String notifyfstCallBack(CzgBaseRespParams respParams) {
CzgPayNotifyDTO czg = CzgPayUtils.getCzg(respParams, CzgPayNotifyDTO.class);
log.info("支付回调数据为"+ JSONObject.toJSONString(czg));
public String notifyCZGCallBack(CzgBaseRespParams respParams) {
JSONObject czg = CzgPayUtils.getCzg(respParams);
AssertUtil.isNull(czg, "回调数据为");
log.info("支付回调数据为:{}", czg);
orderInfoService.payCallBackOrder(czg.getString("mchOrderNo"), czg);
return SUCCESS;
}