优化结构

This commit is contained in:
Yvan
2026-08-28 09:19:54 +08:00
parent 03a4131f6e
commit 279692375b
57 changed files with 778 additions and 799 deletions
+5 -4
View File
@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
bizpayment "kra/internal/biz/payment"
"kra/internal/paymentkit"
"strings"
"time"
@@ -476,12 +477,12 @@ func applyProviderIdentity(tx *gorm.DB, po *paymentOrderPO, update *bizpayment.P
}
func normalizeOrderPaymentStatus(value string) string {
switch strings.ToLower(strings.TrimSpace(value)) {
case "success", "paid", "fulfilled":
switch paymentkit.NormalizeStatus(value, "") {
case "success":
return bizpayment.PaymentStatusPaid
case "pending", "created", "client_pending", "processing":
case "pending":
return bizpayment.PaymentStatusPending
case "failed", "closed", "cancelled", "canceled":
case "failed":
return bizpayment.PaymentStatusFailed
default:
return ""