修复退款幂等与补偿重试

This commit is contained in:
yml2213
2026-06-14 07:55:02 +08:00
parent 607d2415a1
commit fec8e37181
11 changed files with 772 additions and 143 deletions
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"log"
"time"
"hfb_sys/backend/internal/model"
@@ -274,7 +275,9 @@ func (r *Repository) startRefundBestEffort(ctx context.Context, action *refundAc
if action == nil || r.refundStarter == nil {
return
}
_, _ = r.refundStarter.StartRefund(ctx, action.OrderID, action.RefundAmountCent, action.BizType, action.Remark)
if _, err := r.refundStarter.StartRefund(ctx, action.OrderID, action.RefundAmountCent, action.BizType, action.Remark); err != nil {
log.Printf("[dispute] start refund failed order_id=%d biz_type=%s amount_cent=%d err=%v", action.OrderID, action.BizType, action.RefundAmountCent, err)
}
}
func renterFrozenBalance(tx *gorm.DB, renterID uint64) (int64, error) {