Files
web_hgdjb_server/pub/pubdef/paydef.go
T
2026-11-07 10:47:32 +08:00

53 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package pubdef
import "videoweb/pub/common/maths"
// VipOrderStatus 订单状态
type VipOrderStatus int32
const (
VipOrderPending VipOrderStatus = 1 // 待支付
VipOrderSuccess VipOrderStatus = 2 // 支付成功
VipOrderFailed VipOrderStatus = 3 // 支付失败
)
func (s VipOrderStatus) Desc() string {
switch s {
case VipOrderPending:
return "待支付"
case VipOrderSuccess:
return "支付成功"
case VipOrderFailed:
return "支付失败"
}
return "未知"
}
// PayMode 支付方式
const (
PayModeAlipay = "alipay" // 支付宝
PayModeWechat = "wechat" // 微信
)
// SubmitVipOrderInfo 第三方下单成功后的返回信息
type SubmitVipOrderInfo struct {
TradeNo string
Oid string // 第三方订单号
PayUrl string // 支付链接
PayUrlMode string // 支付链接模式(webview/scheme)
PayChannel string // 支付渠道
PayRate string // 费率
}
// VipOrderCallbackParam 支付回调参数(标准化后)
type VipOrderCallbackParam struct {
TradeNo string // 本地订单号
Oid string // 第三方订单号
RealAmount int64 // 实际支付金额(分)
PaymentAt interface{} // 支付时间(time.Time)
}
func GetTrandNoWithUUID() string {
return OrderPrefix + maths.GenUUID()
}