优化结构

This commit is contained in:
Yvan
2026-08-28 10:21:59 +08:00
parent a16d362bb5
commit fec3820464
19 changed files with 138 additions and 136 deletions
+2 -1
View File
@@ -12,6 +12,7 @@ import (
"fmt"
"io"
bizpayment "kra/internal/biz/payment"
"kra/internal/paymentkit"
"net/http"
"strings"
"sync"
@@ -207,7 +208,7 @@ func allinpayCreateMethod(extra, config map[string]any) (string, error) {
if value == "" {
value = firstAny(config, "method", "pay_method", "trade_type")
}
normalized := strings.NewReplacer(".", "_", "-", "_", " ", "_").Replace(strings.ToLower(strings.TrimSpace(value)))
normalized := paymentkit.NormalizePaymentMethod(value)
switch normalized {
case "", "pay", "unified", "unified_pay":
return "pay", nil