fix: 微信支付,接口bug修复。
This commit is contained in:
@@ -400,6 +400,6 @@ wx:
|
|||||||
# 支付回调通知配置
|
# 支付回调通知配置
|
||||||
pay-notify:
|
pay-notify:
|
||||||
# 支付回调通知URL(需根据实际域名配置)
|
# 支付回调通知URL(需根据实际域名配置)
|
||||||
notify-url: "https://yourdomain.com/weixin/pay_notify"
|
notify-url: "https://api.yuceyun.cn/fishery-api/weixin/pay_notify"
|
||||||
# 微信商户号(与上面wx.pay.mch-id保持一致)
|
# 微信商户号(与上面wx.pay.mch-id保持一致)
|
||||||
mch-id: "1671289865"
|
mch-id: "1671289865"
|
||||||
|
|||||||
@@ -216,7 +216,8 @@ public class WeixinController extends BaseController {
|
|||||||
openId,
|
openId,
|
||||||
request.getPayId(),
|
request.getPayId(),
|
||||||
request.getListDeviceId(),
|
request.getListDeviceId(),
|
||||||
request.getJsCode()
|
request.getJsCode(),
|
||||||
|
wxPayNotifyProperties.getNotifyUrl()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (orderId == null || orderId <= 0) {
|
if (orderId == null || orderId <= 0) {
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ public interface PayOrderBusinessService {
|
|||||||
* @param payId 支付选项ID
|
* @param payId 支付选项ID
|
||||||
* @param deviceIds 设备ID列表
|
* @param deviceIds 设备ID列表
|
||||||
* @param jsCode 微信登录code
|
* @param jsCode 微信登录code
|
||||||
|
* @param notifyUrl 支付回调通知URL
|
||||||
* @return 订单ID
|
* @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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据商户订单号查询订单
|
* 根据商户订单号查询订单
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class PayOrderBusinessServiceImpl implements PayOrderBusinessService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@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. 获取支付选项配置
|
// 1. 获取支付选项配置
|
||||||
WxPayItemProperties.PayItem payItem = wxPayItemProperties.getPayItemById(payId);
|
WxPayItemProperties.PayItem payItem = wxPayItemProperties.getPayItemById(payId);
|
||||||
if (payItem == null) {
|
if (payItem == null) {
|
||||||
@@ -92,6 +92,7 @@ public class PayOrderBusinessServiceImpl implements PayOrderBusinessService {
|
|||||||
order.setProfitStatus(0);
|
order.setProfitStatus(0);
|
||||||
order.setTradeType("JSAPI");
|
order.setTradeType("JSAPI");
|
||||||
order.setAttachment(String.valueOf(payId)); // 设置支付选项ID
|
order.setAttachment(String.valueOf(payId)); // 设置支付选项ID
|
||||||
|
order.setNotifyUrl(notifyUrl); // 设置支付回调通知URL
|
||||||
|
|
||||||
payOrderMapper.insert(order);
|
payOrderMapper.insert(order);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user