|
|
@@ -215,6 +215,10 @@ func BuyPackageForWx(c *gin.Context, req md.BuyPackageReq) (outTradeNo, total st |
|
|
|
|
|
|
|
sysCfg := sysCfgDb.SysCfgFindWithDb(enum2.WxAppletAppId, enum2.WxSpAppId, enum2.WxSpMchId, enum2.WxAppletAppId, enum2.WxJsapiPayNotifyUrl) |
|
|
|
fmt.Println(int64(math.Round(totalPrice * 100))) |
|
|
|
openId := c.GetHeader("open_id") |
|
|
|
if openId == "" { |
|
|
|
openId = user.OpenId |
|
|
|
} |
|
|
|
result, _, err := wxSvc.Prepay(c, |
|
|
|
jsapi.PrepayRequest{ |
|
|
|
SpAppid: core.String(sysCfg[enum2.WxSpAppId]), |
|
|
@@ -232,7 +236,7 @@ func BuyPackageForWx(c *gin.Context, req md.BuyPackageReq) (outTradeNo, total st |
|
|
|
}, |
|
|
|
Payer: &jsapi.Payer{ |
|
|
|
//SpOpenid: core.String("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"), |
|
|
|
SubOpenid: core.String(user.OpenId), |
|
|
|
SubOpenid: core.String(openId), |
|
|
|
}, |
|
|
|
}, |
|
|
|
) |
|
|
|