fix: 微信支付,接口bug修复。

This commit is contained in:
tianyongbao
2026-01-19 14:16:33 +08:00
parent 063579f8e3
commit 3fc42ac5b9
4 changed files with 7 additions and 4 deletions

View File

@@ -216,7 +216,8 @@ public class WeixinController extends BaseController {
openId,
request.getPayId(),
request.getListDeviceId(),
request.getJsCode()
request.getJsCode(),
wxPayNotifyProperties.getNotifyUrl()
);
if (orderId == null || orderId <= 0) {

View File

@@ -20,9 +20,10 @@ public interface PayOrderBusinessService {
* @param payId 支付选项ID
* @param deviceIds 设备ID列表
* @param jsCode 微信登录code
* @param notifyUrl 支付回调通知URL
* @return 订单ID
*/
Long createPayOrder(Long userId, String openId, Integer payId, List<Long> deviceIds, String jsCode);
Long createPayOrder(Long userId, String openId, Integer payId, List<Long> deviceIds, String jsCode, String notifyUrl);
/**
* 根据商户订单号查询订单

View File

@@ -46,7 +46,7 @@ public class PayOrderBusinessServiceImpl implements PayOrderBusinessService {
@Override
@Transactional(rollbackFor = Exception.class)
public Long createPayOrder(Long userId, String openId, Integer payId, List<Long> deviceIds, String jsCode) {
public Long createPayOrder(Long userId, String openId, Integer payId, List<Long> deviceIds, String jsCode, String notifyUrl) {
// 1. 获取支付选项配置
WxPayItemProperties.PayItem payItem = wxPayItemProperties.getPayItemById(payId);
if (payItem == null) {
@@ -92,6 +92,7 @@ public class PayOrderBusinessServiceImpl implements PayOrderBusinessService {
order.setProfitStatus(0);
order.setTradeType("JSAPI");
order.setAttachment(String.valueOf(payId)); // 设置支付选项ID
order.setNotifyUrl(notifyUrl); // 设置支付回调通知URL
payOrderMapper.insert(order);