支付调整

This commit is contained in:
2026-01-14 17:09:57 +08:00
parent c446d576be
commit 1b975c2164

View File

@@ -3,12 +3,12 @@ package com.czg.controller;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.IoUtil; import cn.hutool.core.io.IoUtil;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.czg.CzgPayUtils;
import com.czg.PayCst; import com.czg.PayCst;
import com.czg.PolyPayUtils;
import com.czg.constants.PayTypeConstants; import com.czg.constants.PayTypeConstants;
import com.czg.dto.req.WechatNotifyReqDto; import com.czg.dto.req.WechatNotifyReqDto;
import com.czg.dto.req.WechatPayNotifyDataDto; import com.czg.dto.req.WechatPayNotifyDataDto;
import com.czg.entity.CzgBaseRespParams; import com.czg.entity.PolyBaseResp;
import com.czg.exception.CzgException; import com.czg.exception.CzgException;
import com.czg.market.entity.MkShopConsumeDiscountRecord; import com.czg.market.entity.MkShopConsumeDiscountRecord;
import com.czg.market.service.MkDistributionUserService; import com.czg.market.service.MkDistributionUserService;
@@ -105,8 +105,8 @@ public class NotifyController {
@RequestMapping("/payCallBack") @RequestMapping("/payCallBack")
public String notifyCallBack(@RequestBody CzgBaseRespParams respParams) { public String notifyCallBack(@RequestBody PolyBaseResp respParams) {
JSONObject czg = CzgPayUtils.getCzg(respParams); JSONObject czg = PolyPayUtils.getCzg(respParams);
AssertUtil.isNull(czg, "支付回调数据为空"); AssertUtil.isNull(czg, "支付回调数据为空");
log.info("支付回调数据为:{}", czg); log.info("支付回调数据为:{}", czg);
orderInfoCustomService.payCallBackOrder(czg.getString("mchOrderNo"), czg, 0); orderInfoCustomService.payCallBackOrder(czg.getString("mchOrderNo"), czg, 0);
@@ -131,12 +131,15 @@ public class NotifyController {
} }
/**
*
*/
@RequestMapping("/native/wx/pay/distributionRecharge") @RequestMapping("/native/wx/pay/distributionRecharge")
public String nativeNotify(HttpServletRequest request) throws IOException { public String nativeNotify(HttpServletRequest request) throws IOException {
String timestamp = request.getHeader("Wechatpay-Timestamp"); // String timestamp = request.getHeader("Wechatpay-Timestamp");
String nonce = request.getHeader("Wechatpay-Nonce"); // String nonce = request.getHeader("Wechatpay-Nonce");
String serialNo = request.getHeader("Wechatpay-Serial"); // String serialNo = request.getHeader("Wechatpay-Serial");
String signature = request.getHeader("Wechatpay-Signature"); // String signature = request.getHeader("Wechatpay-Signature");
String result = IoUtil.readUtf8(request.getInputStream()); String result = IoUtil.readUtf8(request.getInputStream());
JSONObject jsonObject = JSONObject.parseObject(result); JSONObject jsonObject = JSONObject.parseObject(result);
JSONObject resource = jsonObject.getJSONObject("resource"); JSONObject resource = jsonObject.getJSONObject("resource");
@@ -171,8 +174,8 @@ public class NotifyController {
@RequestMapping("/refundCallBack") @RequestMapping("/refundCallBack")
public String refundCallBack(@RequestBody CzgBaseRespParams respParams) { public String refundCallBack(@RequestBody PolyBaseResp respParams) {
JSONObject czg = CzgPayUtils.getCzg(respParams); JSONObject czg = PolyPayUtils.getCzg(respParams);
AssertUtil.isNull(czg, "退款回调数据为空"); AssertUtil.isNull(czg, "退款回调数据为空");
log.info("退款回调数据为:{}", czg); log.info("退款回调数据为:{}", czg);
orderInfoCustomService.refundCallBackOrder(czg.getString("mchOrderNo"), czg); orderInfoCustomService.refundCallBackOrder(czg.getString("mchOrderNo"), czg);