接入分销订单支付退款与站点隔离

This commit is contained in:
yml2213
2026-09-05 10:52:36 +08:00
parent 2ffa7a89b1
commit ac67a91438
13 changed files with 299 additions and 27 deletions
@@ -3,6 +3,7 @@ package payment
import (
"context"
"hfb_sys/backend/internal/model"
"hfb_sys/backend/internal/modules/distribution"
"time"
"gorm.io/gorm"
@@ -69,6 +70,9 @@ func (r *Repository) confirmPaid(ctx context.Context, payment *model.PaymentOrde
}
newConvID = convID
notifyFn = r.orderRepo.NotifyNewConversation
if err := distribution.SnapshotPaidOrderTx(tx, payment.OrderID, payment.AmountCent); err != nil {
return err
}
}
}
+5 -1
View File
@@ -6,6 +6,7 @@ import (
"time"
"hfb_sys/backend/internal/model"
"hfb_sys/backend/internal/modules/distribution"
"hfb_sys/backend/internal/modules/rentergrowth"
"go.uber.org/zap"
@@ -429,7 +430,10 @@ func (r *Repository) updateOrderRefundStatus(ctx context.Context, orderID uint64
return err
}
}
return tx.Save(&order).Error
if err := tx.Save(&order).Error; err != nil {
return err
}
return distribution.ApplyRefundTx(tx, orderID, refundAmountCent)
})
}
func (r *Repository) markOrderRefunding(ctx context.Context, orderID uint64, refundAmountCent int64) error {