优化结构
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
bizpayment "kra/internal/biz/payment"
|
||||
"kra/internal/paymentkit"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
@@ -435,7 +436,7 @@ func alipayCreateMethod(extra, config map[string]any) (string, error) {
|
||||
if value == "" {
|
||||
value = firstAny(config, "method", "pay_method", "trade_type", "channel")
|
||||
}
|
||||
normalized := strings.NewReplacer(".", "_", "-", "_", " ", "_").Replace(strings.ToLower(strings.TrimSpace(value)))
|
||||
normalized := paymentkit.NormalizePaymentMethod(value)
|
||||
switch normalized {
|
||||
case "", "create", "trade_create", "alipay_trade_create", "jsapi", "miniapp", "mini_program":
|
||||
return "alipay.trade.create", nil
|
||||
|
||||
Reference in New Issue
Block a user