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:
haiwu
2023-08-15 00:16:30 +08:00
committed by GitHub
parent abaf4ca8d9
commit 2ff9020884
13 changed files with 230 additions and 14 deletions

View File

@ -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)
}