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