修改了配置文件

This commit is contained in:
wucongxing8150 2024-09-20 14:55:15 +08:00
parent 4f47c2922e
commit 301b11fa4e
2 changed files with 18 additions and 3 deletions

View File

@ -152,9 +152,14 @@ func (r *Pay) GetPayOrder(c *gin.Context) {
return
}
appId := config.C.Wechat.AppId
if config.C.Env == "dev" {
appId = config.C.Wechat.TestPayAppId
}
// 处理返回数据
g := app.PayOrderDataResponse{
AppId: config.C.Wechat.TestPayAppId,
AppId: appId,
Total: paymentAmountTotal,
Description: "肝病算一算",
OpenId: user.OpenId,

View File

@ -364,8 +364,13 @@ func (r *OrderSingleService) GetJsapiPrepay(m *model.OrderSingle) (prepay *jsapi
return nil, errors.New("发起支付失败")
}
appId := config.C.Wechat.AppId
if config.C.Env == "dev" {
appId = config.C.Wechat.TestPayAppId
}
jsapiRequest := weChat.JsapiRequest{
AppId: config.C.Wechat.TestPayAppId,
AppId: appId,
MchId: config.C.Wechat.Pay1281030301.MchId,
Description: "肝病算一算",
OutTradeNo: m.OrderNo,
@ -398,8 +403,13 @@ func (r *OrderSingleService) GetAppPrepay(m *model.OrderSingle) (prepay *app.Pre
return nil, errors.New("发起支付失败")
}
appId := config.C.Wechat.AppId
if config.C.Env == "dev" {
appId = config.C.Wechat.TestPayAppId
}
appRequest := weChat.AppRequest{
AppId: config.C.Wechat.TestPayAppId,
AppId: appId,
MchId: config.C.Wechat.Pay1281030301.MchId,
Description: "肝病算一算",
OutTradeNo: m.OrderNo,