mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
ci: fix bug in WeChat payment provider
This commit is contained in:
12
pp/util.go
12
pp/util.go
@ -23,3 +23,15 @@ func getPriceString(price float64) string {
|
||||
priceString := strings.TrimRight(strings.TrimRight(fmt.Sprintf("%.2f", price), "0"), ".")
|
||||
return priceString
|
||||
}
|
||||
|
||||
func joinAttachString(tokens []string) string {
|
||||
return strings.Join(tokens, "|")
|
||||
}
|
||||
|
||||
func parseAttachString(s string) (string, string, string, error) {
|
||||
tokens := strings.Split(s, "|")
|
||||
if len(tokens) != 3 {
|
||||
return "", "", "", fmt.Errorf("parseAttachString() error: len(tokens) expected 3, got: %d", len(tokens))
|
||||
}
|
||||
return tokens[0], tokens[1], tokens[2], nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user