修改
This commit is contained in:
parent
80759ec111
commit
d5546933f9
@ -167,26 +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)))
|
//orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100)))
|
||||||
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
|
//reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
|
||||||
if orderAmountInCents != reqAmountInCents {
|
//if orderAmountInCents != reqAmountInCents {
|
||||||
fmt.Println("orderAmountInCents :", orderAmountInCents)
|
// fmt.Println("orderAmountInCents :", orderAmountInCents)
|
||||||
fmt.Println("reqAmountInCents :", reqAmountInCents)
|
// fmt.Println("reqAmountInCents :", reqAmountInCents)
|
||||||
fmt.Println("111111111111111111111111111111111111")
|
// fmt.Println("111111111111111111111111111111111111")
|
||||||
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.Status :", detail.OrderRecord.Status)
|
||||||
fmt.Println("detail.OrderRecord.CheckoutSessionId :", detail.OrderRecord.CheckoutSessionId)
|
//fmt.Println("detail.OrderRecord.CheckoutSessionId :", detail.OrderRecord.CheckoutSessionId)
|
||||||
fmt.Println("detail.OrderRecord.PayTime :", detail.OrderRecord.PayTime)
|
//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 == "" {
|
||||||
// 查询支付结果
|
// // 查询支付结果
|
||||||
stripeInfosRes, stripeInfosErr := service.PaymentProvider.QueryAntomPayByCheckoutSessionId(context.Background(), &payment.AntomPayQueryRequest{
|
// stripeInfosRes, stripeInfosErr := service.PaymentProvider.QueryAntomPayByCheckoutSessionId(context.Background(), &payment.AntomPayQueryRequest{
|
||||||
CheckoutSessionIds: []string{detail.OrderRecord.CheckoutSessionId},
|
// CheckoutSessionIds: []string{detail.OrderRecord.CheckoutSessionId},
|
||||||
})
|
})
|
||||||
if detailErr != nil {
|
if detailErr != nil {
|
||||||
fmt.Println("=============== antom创建支付,查询主订单信息报错:", detailErr)
|
fmt.Println("=============== antom创建支付,查询主订单信息报错:", detailErr)
|
||||||
@ -257,6 +257,8 @@ func CreateAntomPay(c *gin.Context) {
|
|||||||
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100)))
|
orderAmountInCents := int64(math.Round(float64(detail.OrderRecord.TotalAmount * 100)))
|
||||||
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
|
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
|
||||||
if orderAmountInCents != reqAmountInCents {
|
if orderAmountInCents != reqAmountInCents {
|
||||||
|
fmt.Println("orderAmountInCents :", orderAmountInCents)
|
||||||
|
fmt.Println("reqAmountInCents :", reqAmountInCents)
|
||||||
fmt.Println("111111111111111111111111111111111111")
|
fmt.Println("111111111111111111111111111111111111")
|
||||||
service.Error(c, errors.New(common.InvalidOrderAmount))
|
service.Error(c, errors.New(common.InvalidOrderAmount))
|
||||||
return
|
return
|
||||||
@ -334,6 +336,8 @@ func CreateAntomPay(c *gin.Context) {
|
|||||||
//金额校验
|
//金额校验
|
||||||
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
|
reqAmountInCents := int64(math.Round(float64(req.ProductAllPrice)))
|
||||||
if orderAmountInCents != reqAmountInCents {
|
if orderAmountInCents != reqAmountInCents {
|
||||||
|
fmt.Println("orderAmountInCents :", orderAmountInCents)
|
||||||
|
fmt.Println("reqAmountInCents :", reqAmountInCents)
|
||||||
fmt.Println("111111111111111111111111111111111111")
|
fmt.Println("111111111111111111111111111111111111")
|
||||||
service.Error(c, errors.New(common.InvalidOrderAmount))
|
service.Error(c, errors.New(common.InvalidOrderAmount))
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user