Compare commits

...

2 Commits

Author SHA1 Message Date
jhc
eae408d711 xiugai 2025-03-29 10:54:52 +08:00
jhc
016fa3ee72 修改 2025-03-29 10:53:46 +08:00

View File

@ -12,6 +12,7 @@ import (
"fonchain-fiee/pkg/service/bundle/common"
bundleModel "fonchain-fiee/pkg/service/bundle/model"
"io"
"math"
"net/http"
"strconv"
@ -53,9 +54,10 @@ func CreateStripeCheckoutSession(c *gin.Context) {
fmt.Println("detail.OrderRecord.TotalAmount*100 :", detail.OrderRecord.TotalAmount*100)
//金额校验
if detail.OrderRecord.TotalAmount*100 != float32(req.ProductAllPrice) {
fmt.Println("11111111111111111111111111111111111111111111111")
fmt.Println("金额错误11111111111111111111")
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100)))
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
if orderAmountInCents != reqAmountInCents {
fmt.Println("111111111111111111111111111111111111")
service.Error(c, errors.New(common.InvalidOrderAmount))
return
}