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