mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
feat: support Stripe payment provider (#2204)
* feat: add stripe payment provider * feat: support stripe payment * feat: delete todo comment * feat: remove description struct * feat: change outOrderId->orderId
This commit is contained in:
14
pp/util.go
14
pp/util.go
@ -16,6 +16,8 @@ package pp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -35,3 +37,15 @@ func parseAttachString(s string) (string, string, string, error) {
|
||||
}
|
||||
return tokens[0], tokens[1], tokens[2], nil
|
||||
}
|
||||
|
||||
func priceInt64ToFloat64(price int64) float64 {
|
||||
return float64(price) / 100
|
||||
}
|
||||
|
||||
func priceFloat64ToInt64(price float64) int64 {
|
||||
return int64(math.Round(price * 100))
|
||||
}
|
||||
|
||||
func priceFloat64ToString(price float64) string {
|
||||
return strconv.FormatFloat(price, 'f', 2, 64)
|
||||
}
|
||||
|
Reference in New Issue
Block a user