修改
This commit is contained in:
parent
e795a6ab4f
commit
016fa3ee72
@ -12,6 +12,7 @@ import (
|
|||||||
"fonchain-fiee/pkg/service/bundle/common"
|
"fonchain-fiee/pkg/service/bundle/common"
|
||||||
bundleModel "fonchain-fiee/pkg/service/bundle/model"
|
bundleModel "fonchain-fiee/pkg/service/bundle/model"
|
||||||
"io"
|
"io"
|
||||||
|
"math"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
@ -52,7 +53,9 @@ func CreateStripeCheckoutSession(c *gin.Context) {
|
|||||||
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
|
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
|
||||||
|
|
||||||
//金额校验
|
//金额校验
|
||||||
if detail.OrderRecord.TotalAmount*100 != float32(req.ProductAllPrice) {
|
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100)))
|
||||||
|
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
|
||||||
|
if orderAmountInCents != reqAmountInCents {
|
||||||
service.Error(c, errors.New(common.InvalidOrderAmount))
|
service.Error(c, errors.New(common.InvalidOrderAmount))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user