fix 小程序发起支付失败的bug

This commit is contained in:
damonyuan 2024-11-15 00:32:17 +08:00
parent 20e3ff0a02
commit 54c69af36d
1 changed files with 5 additions and 2 deletions

View File

@ -172,7 +172,7 @@ public class PayServiceImpl implements IPayService {
String openId = null; String openId = null;
UserAuth userAuth = userAuthMapper.selectOne(new QueryWrapper<UserAuth>() UserAuth userAuth = userAuthMapper.selectOne(new QueryWrapper<UserAuth>()
.eq("user_id", params.getUserId()) .eq("user_id", params.getUserId())
.eq("terminal", terminal) //.eq("terminal", terminal)
.last("limit 1")); .last("limit 1"));
if (StringUtils.isNotNull(userAuth)) { if (StringUtils.isNotNull(userAuth)) {
@ -217,7 +217,10 @@ public class PayServiceImpl implements IPayService {
return ret; return ret;
} }
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
ret.put("config", WxPayDriver.unifiedOrder(requestV3)); JSONObject config = JSONObject.parseObject(JSONObject.toJSONString(WxPayDriver.unifiedOrder(requestV3)));
config.put("package", config.getString("packageValue"));
config.remove("packageValue");
ret.put("config", config);
ret.put("pay_way", 2); ret.put("pay_way", 2);
return ret; return ret;
//return WxPayDriver.unifiedOrder(requestV3); //return WxPayDriver.unifiedOrder(requestV3);