From 4af1ac9da3493f705c40659e320b69e686363665 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 9 Oct 2023 17:31:19 +0800 Subject: [PATCH] update --- app/customer/svc/svc_pay.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/customer/svc/svc_pay.go b/app/customer/svc/svc_pay.go index 91415c0..dfa2ae9 100644 --- a/app/customer/svc/svc_pay.go +++ b/app/customer/svc/svc_pay.go @@ -215,7 +215,7 @@ func BuyPackageForWx(c *gin.Context, req md.BuyPackageReq) (outTradeNo, prepayId NotifyUrl: core.String(sysCfg[enum2.WxJsapiPayNotifyUrl]), Amount: &jsapi.Amount{ Currency: core.String("CNY"), - Total: core.Int64(utils.StrToInt64(total) * 100), + Total: core.Int64(int64(totalPrice * 100)), }, Payer: &jsapi.Payer{ //SpOpenid: core.String("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"), @@ -224,6 +224,12 @@ func BuyPackageForWx(c *gin.Context, req md.BuyPackageReq) (outTradeNo, prepayId }, ) + fmt.Println(">>>>>>>>>>>", core.Int64(utils.StrToInt64(total)*100)) + if err != nil { + _ = session.Rollback() + return + } + //5、插入订单记录 now := time.Now() centralKitchenForSchoolPackageOrd := db.CentralKitchenForSchoolPackageOrd{}