优化结构
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
bizpayment "kra/internal/biz/payment"
|
||||
"kra/internal/paymentkit"
|
||||
"strings"
|
||||
|
||||
"github.com/go-pay/gopay"
|
||||
@@ -110,7 +111,7 @@ func douyinCreateMethod(extra, config map[string]any) (string, error) {
|
||||
if value == "" {
|
||||
value = firstAny(config, "method", "pay_method", "trade_type", "pay_type", "channel")
|
||||
}
|
||||
normalized := strings.NewReplacer(".", "_", "-", "_", " ", "_").Replace(strings.ToLower(strings.TrimSpace(value)))
|
||||
normalized := paymentkit.NormalizePaymentMethod(value)
|
||||
switch normalized {
|
||||
case "", "jsapi", "js_api", "mini", "mini_program", "miniprogram", "applet":
|
||||
return "jsapi", nil
|
||||
|
||||
Reference in New Issue
Block a user