支付方式问题

This commit is contained in:
2026-01-17 17:52:24 +08:00
parent 9bcbad42ad
commit 37651e0e02
2 changed files with 12 additions and 3 deletions

View File

@@ -2,8 +2,10 @@ package com.czg.controller.pay;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import com.czg.PayCst;
import com.czg.annotation.Debounce;
import com.czg.constants.ParamCodeCst;
import com.czg.exception.CzgException;
import com.czg.market.service.OrderInfoService;
import com.czg.order.dto.CheckOrderPay;
import com.czg.order.entity.OrderInfo;
@@ -175,6 +177,13 @@ public class OrderPayController {
@PostMapping("/shopPayApi/js2Pay")
@Debounce(value = "#payParam.checkOrderPay.orderId")
public CzgResult<Map<String, Object>> js2PayOrder(HttpServletRequest request, @RequestBody OrderPayParamDTO payParam) {
if ("alipay".equals(payParam.getPayType())) {
payParam.setPayType(PayCst.Type.ALIPAY);
} else if ("wechatPay".equals(payParam.getPayType())) {
payParam.setPayType(PayCst.Type.WECHAT);
} else {
throw new CzgException(payParam.getPayType() + "支付方式错误");
}
return orderPayService.js2PayOrder(ServletUtil.getClientIP(request), payParam);
}