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" }