DengBiao 7 meses atrás
pai
commit
7a5ad5a570
1 arquivos alterados com 5 adições e 1 exclusões
  1. +5
    -1
      app/customer/svc/svc_pay.go

+ 5
- 1
app/customer/svc/svc_pay.go Ver arquivo

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


Carregando…
Cancelar
Salvar