48 lines
3.2 KiB
Go
48 lines
3.2 KiB
Go
package app_model
|
||
|
||
import "time"
|
||
|
||
const (
|
||
// PayTypeWX PayType 支付类型
|
||
PayTypeWX = 1 // 微信支付
|
||
PayTypeTL = 2 // 通联宝支付
|
||
|
||
// PayStatusNo Status 状态值
|
||
PayStatusNo = 0
|
||
PayStatusYes = 1
|
||
PayStatusFailed = 2
|
||
PayStatusCanceled = 3
|
||
PayStatusRefund = 4
|
||
|
||
PayBody = "京西云打印机余额充值"
|
||
OrderPayVendorId = 1 // 京西平台
|
||
)
|
||
|
||
type OrderPay struct {
|
||
ID int `orm:"column(id)" json:"id" db:"id"`
|
||
CreatedAt time.Time `orm:"type(datetime)" json:"created_at" db:"created_at"` // 创建时间
|
||
UpdatedAt time.Time `orm:"type(datetime)" json:"updated_at" db:"updated_at"` // 更新时间
|
||
PayOrderID string `orm:"column(pay_order_id);size(48)" json:"pay_order_id" db:"pay_order_id"` // 京西支付定单号
|
||
PayType int `orm:"type(int);size(2)" json:"pay_type" db:"pay_type"` // 支付类型[1-微信,2-通联,3-抖音]
|
||
VendorPayType string `orm:"size(48)" json:"vendorPayType"` //
|
||
VendorOrderID string `orm:"column(vendor_order_id);size(48);index" json:"vendor_order_id" db:"vendor_order_id"` // 支付对应的购物订单号
|
||
PrintNo string `orm:"column(print_no);size(48);index" json:"print_no" db:"print_no"` // 充值打印机编号
|
||
Status int `orm:"type(int);size(2)" json:"status" json:"status" db:"status"` // 订单支付状态
|
||
PayCreatedAt time.Time `orm:"type(datetime);index" json:"pay_created_at" db:"pay_created_at"` // 下单时间
|
||
PayFinishedAt time.Time `orm:"type(datetime)" json:"pay_finished_at" db:"pay_finished_at"` // 支付完成时间
|
||
TotalFee int `orm:"type(int);size(11)" json:"total_fee" db:"total_fee"` // 支付金额
|
||
PrepayID string `orm:"column(prepay_id);index;size(48)" json:"prepay_id" db:"prepay_id"` // 下单后,支付前,支付方生成的事务ID
|
||
TransactionID string `orm:"column(transaction_id);index;size(48)" json:"transaction_id" db:"transaction_id"` // 支付成功后,支付方生成的事务ID
|
||
OriginalData string `orm:"type(text)" json:"-"` // 返回消息
|
||
VendorID int `orm:"column(vendor_id)" json:"vendor_id" db:"vendor_id"` // 购物订单所属厂商代码(当前只有京西)
|
||
CodeURL string `orm:"column(code_url);size(3200)" json:"codeURL"` //
|
||
}
|
||
|
||
type PayOrder struct {
|
||
SubAppID string `json:"sub_app_id" form:"sub_app_id" binding:"required"` // appID
|
||
PayType int `json:"pay_type" form:"pay_type" binding:"required"` // 支付类型
|
||
VendorPayType string `json:"vendor_pay_type" form:"vendor_pay_type" binding:"required"` // 平台支付类型
|
||
TotalFee int `json:"total_fee" form:"total_fee" binding:"required"` // 支付金额
|
||
PrintNo string `json:"print_no" form:"print_no" binding:"required"` // 打印机编号
|
||
}
|