Files
hfb_sys/backend/internal/model/payment.go
T

42 lines
2.2 KiB
Go

package model
import (
"time"
"gorm.io/datatypes"
)
type PaymentOrder struct {
ID uint64 `gorm:"primaryKey" json:"id"`
PaymentNo string `gorm:"size:64;not null;uniqueIndex" json:"payment_no"`
OrderID uint64 `gorm:"not null;index" json:"order_id"`
OrderNo string `gorm:"size:64;not null;index" json:"order_no"`
UserID uint64 `gorm:"not null;index" json:"user_id"`
PaymentConfigID uint64 `gorm:"not null;default:0;index" json:"payment_config_id"`
Provider string `gorm:"size:32;not null" json:"provider"`
MerchantID string `gorm:"size:32;not null;default:''" json:"merchant_id"`
ThirdOrderID string `gorm:"size:64;not null;uniqueIndex" json:"third_order_id"`
ProviderOrderID string `gorm:"size:64;not null;default:'';index" json:"provider_order_id"`
PayWay string `gorm:"size:16;not null;default:''" json:"pay_way"`
JSPayFlag string `gorm:"column:jspay_flag;size:8;not null;default:''" json:"jspay_flag"`
AmountCent int64 `gorm:"not null;default:0" json:"amount_cent"`
BizType string `gorm:"size:32;not null;default:'order_pay';index" json:"biz_type"`
Status string `gorm:"size:32;not null;default:'created';index" json:"status"`
TDCode string `gorm:"size:512;not null;default:''" json:"td_code"`
JSPayURL string `gorm:"column:jspay_url;size:512;not null;default:''" json:"jspay_url"`
JSPayInfo string `gorm:"column:jspay_info;type:text" json:"jspay_info"`
RawRequest datatypes.JSON `json:"raw_request"`
RawResponse datatypes.JSON `json:"raw_response"`
RetryCount int `gorm:"not null;default:0" json:"retry_count"`
LastRetryAt *time.Time `json:"last_retry_at"`
NextRetryAt *time.Time `json:"next_retry_at"`
PaidAt *time.Time `json:"paid_at"`
NotifiedAt *time.Time `json:"notified_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (PaymentOrder) TableName() string {
return "payment_orders"
}