You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
947 B
39 lines
947 B
package public
|
|
|
|
import (
|
|
"fmt"
|
|
"recook/configs"
|
|
)
|
|
|
|
const (
|
|
TimeExpireDuration = "10m"
|
|
)
|
|
|
|
func GenerateOrderRecookPayOutTradeNo(userId uint, orderId uint) string {
|
|
return combineTradeNo(userId, "M0", orderId)
|
|
}
|
|
|
|
func GenerateOrderWxPayOutTradeNo(userId uint, orderId uint) string {
|
|
return combineTradeNo(userId, "M1", orderId)
|
|
}
|
|
|
|
func GenerateOrderAliPayOutTradeNo(userId uint, orderId uint) string {
|
|
return combineTradeNo(userId, "M2", orderId)
|
|
}
|
|
|
|
func GenerateOrderWxMiniPayOutTradeNo(userId uint, orderId uint) string {
|
|
return combineTradeNo(userId, "M4", orderId)
|
|
}
|
|
|
|
func GenerateOrderWxH5PayOutTradeNo(userId uint, orderId uint) string {
|
|
return combineTradeNo(userId, "M5", orderId)
|
|
}
|
|
|
|
func combineTradeNo(userId uint, flag string, orderId uint) string {
|
|
if configs.IsProductionEnv() {
|
|
return fmt.Sprintf("%dT%s%s%d", userId, "order", flag, orderId)
|
|
} else {
|
|
return fmt.Sprintf("F%dT%s%s%d", userId, "order", flag, orderId)
|
|
}
|
|
}
|