diff --git a/pkg/service/bundle/pay.go b/pkg/service/bundle/pay.go index 43c6a64..7a507a7 100644 --- a/pkg/service/bundle/pay.go +++ b/pkg/service/bundle/pay.go @@ -254,8 +254,8 @@ func CreateAntomPay(c *gin.Context) { fmt.Println("detail.OrderRecord.TotalAmount*100 :", detail.OrderRecord.TotalAmount*100) //金额校验 - orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100))) - reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice))) + orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount) * 100)) + reqAmountInCents := req.ProductAllPrice if orderAmountInCents != reqAmountInCents { fmt.Println("orderAmountInCents :", orderAmountInCents) fmt.Println("reqAmountInCents :", reqAmountInCents) @@ -326,7 +326,7 @@ func CreateAntomPay(c *gin.Context) { orderAmountInCents := int64(0.0) for _, info := range res.AddBundleInfos { - temp := int64(math.Round(float64(info.Amount * 100))) + temp := int64(math.Round(float64(info.Amount) * 100)) orderAmountInCents += temp } @@ -334,7 +334,7 @@ func CreateAntomPay(c *gin.Context) { fmt.Println("req.ProductAllPrice :", req.ProductAllPrice) //金额校验 - reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice))) + reqAmountInCents := req.ProductAllPrice if orderAmountInCents != reqAmountInCents { fmt.Println("orderAmountInCents :", orderAmountInCents) fmt.Println("reqAmountInCents :", reqAmountInCents)