修改
This commit is contained in:
parent
45424388f7
commit
e795a6ab4f
@ -40,18 +40,27 @@ func CreateStripeCheckoutSession(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println("detail.OrderRecord.CustomerID :", detail.OrderRecord.CustomerID)
|
||||||
|
|
||||||
// 判断 是否是 本人操作
|
// 判断 是否是 本人操作
|
||||||
if strconv.FormatUint(userInfo.ID, 10) != detail.OrderRecord.CustomerID {
|
if strconv.FormatUint(userInfo.ID, 10) != detail.OrderRecord.CustomerID {
|
||||||
service.Error(c, errors.New(common.NotMatchOrderInfo))
|
service.Error(c, errors.New(common.NotMatchOrderInfo))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println("detail.OrderRecord.TotalAmount :", detail.OrderRecord.TotalAmount)
|
||||||
|
fmt.Println("req.ProductAllPrice :", req.ProductAllPrice)
|
||||||
|
|
||||||
//金额校验
|
//金额校验
|
||||||
if detail.OrderRecord.TotalAmount*100 != float32(req.ProductAllPrice) {
|
if detail.OrderRecord.TotalAmount*100 != float32(req.ProductAllPrice) {
|
||||||
service.Error(c, errors.New(common.InvalidOrderAmount))
|
service.Error(c, errors.New(common.InvalidOrderAmount))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println("detail.OrderRecord.Status :", detail.OrderRecord.Status)
|
||||||
|
fmt.Println("detail.OrderRecord.CheckoutSessionId :", detail.OrderRecord.CheckoutSessionId)
|
||||||
|
fmt.Println("detail.OrderRecord.PayTime :", detail.OrderRecord.PayTime)
|
||||||
|
|
||||||
// 如果 当前订单 是 已签未支付 且 存在 checkoutSessionId 需要 查询 支付结果
|
// 如果 当前订单 是 已签未支付 且 存在 checkoutSessionId 需要 查询 支付结果
|
||||||
if detail.OrderRecord.Status == bundleModel.OrderSigned && detail.OrderRecord.CheckoutSessionId != "" && detail.OrderRecord.PayTime == "" {
|
if detail.OrderRecord.Status == bundleModel.OrderSigned && detail.OrderRecord.CheckoutSessionId != "" && detail.OrderRecord.PayTime == "" {
|
||||||
// 查询支付结果
|
// 查询支付结果
|
||||||
@ -94,6 +103,9 @@ func CreateStripeCheckoutSession(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println("result.CheckoutSessionId :", result.CheckoutSessionId)
|
||||||
|
fmt.Println("result.CheckoutSessionUrl :", result.CheckoutSessionUrl)
|
||||||
|
|
||||||
//更新订单状态
|
//更新订单状态
|
||||||
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
|
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
|
||||||
Uuid: detail.OrderRecord.Uuid,
|
Uuid: detail.OrderRecord.Uuid,
|
||||||
|
Loading…
Reference in New Issue
Block a user