优化结构
This commit is contained in:
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user