Browse Source

update

tmp
DengBiao 8 months ago
parent
commit
7a5ad5a570
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/customer/svc/svc_pay.go

+ 5
- 1
app/customer/svc/svc_pay.go View File

@@ -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),
},
},
)


Loading…
Cancel
Save