解决冲突

This commit is contained in:
桀尼龟 2025-06-23 15:32:57 +08:00
commit 80759ec111

View File

@ -167,6 +167,26 @@ func CreateAntomPay(c *gin.Context) {
// 检查 订单信息 type是1说明既有主套餐又有增值服务 // 检查 订单信息 type是1说明既有主套餐又有增值服务
detail, detailErr := service.BundleProvider.OrderRecordsDetail(context.Background(), &bundle.OrderRecordsDetailRequest{ detail, detailErr := service.BundleProvider.OrderRecordsDetail(context.Background(), &bundle.OrderRecordsDetailRequest{
OrderNo: req.OutTradeNo, OrderNo: req.OutTradeNo,
//金额校验
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100)))
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
if orderAmountInCents != reqAmountInCents {
fmt.Println("orderAmountInCents :", orderAmountInCents)
fmt.Println("reqAmountInCents :", reqAmountInCents)
fmt.Println("111111111111111111111111111111111111")
service.Error(c, errors.New(common.InvalidOrderAmount))
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 需要 查询 支付结果
if detail.OrderRecord.Status == bundleModel.OrderSigned && detail.OrderRecord.CheckoutSessionId != "" && detail.OrderRecord.PayTime == "" {
// 查询支付结果
stripeInfosRes, stripeInfosErr := service.PaymentProvider.QueryAntomPayByCheckoutSessionId(context.Background(), &payment.AntomPayQueryRequest{
CheckoutSessionIds: []string{detail.OrderRecord.CheckoutSessionId},
}) })
if detailErr != nil { if detailErr != nil {
fmt.Println("=============== antom创建支付查询主订单信息报错", detailErr) fmt.Println("=============== antom创建支付查询主订单信息报错", detailErr)