shanshanzhong 69ac1f104d
Some checks failed
Build docker and publish / build (20.15.1) (push) Has been cancelled
修复订单支付显示方式
2026-03-04 23:20:36 -08:00

31 lines
629 B
Go

package order
import (
"strings"
paymentPlatform "github.com/perfect-panel/server/pkg/payment"
)
func canonicalOrderMethod(method string) string {
method = strings.TrimSpace(method)
if method == "" {
return ""
}
platform := paymentPlatform.ParsePlatform(method)
if platform == paymentPlatform.UNSUPPORTED {
return ""
}
return platform.String()
}
func normalizeOrderMethod(orderMethod string, paymentMethod string) string {
if method := canonicalOrderMethod(paymentMethod); method != "" {
return method
}
if method := canonicalOrderMethod(orderMethod); method != "" {
return method
}
return "unknown"
}