34 lines
1.4 KiB
Go
34 lines
1.4 KiB
Go
|
|
package entities
|
|||
|
|
|
|||
|
|
import "github.com/shopspring/decimal"
|
|||
|
|
|
|||
|
|
// WechatOrderStatus 微信订单状态枚举(别名)
|
|||
|
|
type WechatOrderStatus = PayOrderStatus
|
|||
|
|
|
|||
|
|
const (
|
|||
|
|
WechatOrderStatusPending WechatOrderStatus = PayOrderStatusPending // 待支付
|
|||
|
|
WechatOrderStatusSuccess WechatOrderStatus = PayOrderStatusSuccess // 支付成功
|
|||
|
|
WechatOrderStatusFailed WechatOrderStatus = PayOrderStatusFailed // 支付失败
|
|||
|
|
WechatOrderStatusCancelled WechatOrderStatus = PayOrderStatusCancelled // 已取消
|
|||
|
|
WechatOrderStatusClosed WechatOrderStatus = PayOrderStatusClosed // 已关闭
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
const (
|
|||
|
|
WechatOrderPlatformApp = "app" // 微信APP支付
|
|||
|
|
WechatOrderPlatformH5 = "h5" // 微信H5支付
|
|||
|
|
WechatOrderPlatformMini = "mini" // 微信小程序支付
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// WechatOrder 微信订单实体(统一表 typay_orders,兼容多支付渠道)
|
|||
|
|
type WechatOrder = PayOrder
|
|||
|
|
|
|||
|
|
// NewWechatOrder 工厂方法 - 创建微信订单(统一表 typay_orders)
|
|||
|
|
func NewWechatOrder(rechargeID, outTradeNo, subject string, amount decimal.Decimal, platform string) *WechatOrder {
|
|||
|
|
return NewPayOrder(rechargeID, outTradeNo, subject, amount, platform, "wechat")
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// NewWechatPayOrder 工厂方法 - 创建微信支付订单(别名,保持向后兼容)
|
|||
|
|
func NewWechatPayOrder(rechargeID, outTradeNo, subject string, amount decimal.Decimal, platform string) *WechatOrder {
|
|||
|
|
return NewWechatOrder(rechargeID, outTradeNo, subject, amount, platform)
|
|||
|
|
}
|