吸怪
This commit is contained in:
parent
7b3d59a562
commit
a7f279c87e
@ -140,7 +140,10 @@ func UpdateBundleOrderStatusPaid(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
totalStripe := 0
|
||||||
|
|
||||||
if stripeInfosRes != nil && len(stripeInfosRes.StripeInfos) > 0 {
|
if stripeInfosRes != nil && len(stripeInfosRes.StripeInfos) > 0 {
|
||||||
|
totalStripe = len(stripeInfosRes.StripeInfos)
|
||||||
for _, stripeInfo := range stripeInfosRes.StripeInfos {
|
for _, stripeInfo := range stripeInfosRes.StripeInfos {
|
||||||
if stripeInfo.OutTradeNo == detail.OrderRecord.OrderNo && stripeInfo.PaymentIntentStatus == "paid" {
|
if stripeInfo.OutTradeNo == detail.OrderRecord.OrderNo && stripeInfo.PaymentIntentStatus == "paid" {
|
||||||
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
|
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
|
||||||
@ -152,9 +155,22 @@ func UpdateBundleOrderStatusPaid(c *gin.Context) {
|
|||||||
service.Error(c, detailErr)
|
service.Error(c, detailErr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
totalStripe--
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if totalStripe != 0 && totalStripe == len(stripeInfosRes.StripeInfos) {
|
||||||
|
_, updateOrderRecordErr := service.BundleProvider.UpdateOrderRecord(context.Background(), &bundle.OrderRecord{
|
||||||
|
Uuid: detail.OrderRecord.Uuid,
|
||||||
|
CheckoutSessionId: "",
|
||||||
|
CheckoutSessionUrl: "",
|
||||||
|
})
|
||||||
|
if updateOrderRecordErr != nil {
|
||||||
|
service.Error(c, detailErr)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
service.Success(c, nil)
|
service.Success(c, nil)
|
||||||
|
@ -65,6 +65,7 @@ func CreateStripeCheckoutSession(c *gin.Context) {
|
|||||||
Status: bundleModel.OrderPaid,
|
Status: bundleModel.OrderPaid,
|
||||||
PayTime: common.GetBeijingTime(),
|
PayTime: common.GetBeijingTime(),
|
||||||
})
|
})
|
||||||
|
fmt.Println("detail.OrderRecord.Uuid :", detail.OrderRecord.Uuid)
|
||||||
if updateOrderRecordErr != nil {
|
if updateOrderRecordErr != nil {
|
||||||
service.Error(c, detailErr)
|
service.Error(c, detailErr)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user