feat(payment): 增加支付配置测试支付与全链路报文

This commit is contained in:
2026-11-20 14:51:17 +08:00
parent b539e3a42f
commit 8fec2fa5a2
19 changed files with 2353 additions and 5 deletions
@@ -0,0 +1,50 @@
package model
import (
"time"
"gorm.io/datatypes"
)
// PaymentConfigTestOrder 支付配置真实通道测试单,与业务支付流水完全隔离。
type PaymentConfigTestOrder struct {
ID uint64 `gorm:"primaryKey" json:"id"`
TenantID uint64 `gorm:"not null;default:0;index:idx_payment_config_test_tenant_created" json:"tenant_id"`
PaymentConfigID uint64 `gorm:"not null;index:idx_payment_config_test_config" json:"payment_config_id"`
ConfigName string `gorm:"size:128;not null" json:"config_name"`
Provider string `gorm:"size:32;not null" json:"provider"`
MerchantID string `gorm:"size:128;not null" json:"merchant_id"`
PayWay string `gorm:"size:16;not null;default:''" json:"pay_way"`
Environment string `gorm:"size:16;not null;default:''" json:"environment"`
ConfigStatus string `gorm:"size:32;not null;default:''" json:"config_status"`
TestNo string `gorm:"size:64;not null;uniqueIndex" json:"test_no"`
ThirdOrderID string `gorm:"size:64;not null;uniqueIndex" json:"third_order_id"`
NotifyToken string `gorm:"size:64;not null;uniqueIndex" json:"-"`
ProviderOrderID string `gorm:"size:64;not null;default:''" json:"provider_order_id"`
AmountCent int64 `gorm:"not null;default:0" json:"amount_cent"`
Status string `gorm:"size:32;not null;default:'created';index:idx_payment_config_test_status" 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"`
ErrorMessage string `gorm:"size:512;not null;default:''" json:"error_message"`
RawRequest datatypes.JSON `json:"raw_request"`
RawResponse datatypes.JSON `json:"raw_response"`
CreateRequest datatypes.JSON `json:"create_request"`
CreateResponse datatypes.JSON `json:"create_response"`
QueryRequest datatypes.JSON `json:"query_request"`
QueryResponse datatypes.JSON `json:"query_response"`
NotifyRequest datatypes.JSON `json:"notify_request"`
NotifyResult datatypes.JSON `json:"notify_result"`
NotifyAck string `gorm:"size:512;not null;default:''" json:"notify_ack"`
QueryCount int `gorm:"not null;default:0" json:"query_count"`
LastQueriedAt *time.Time `json:"last_queried_at,omitempty"`
PaidAt *time.Time `json:"paid_at,omitempty"`
NotifiedAt *time.Time `json:"notified_at,omitempty"`
CreatedBy *uint64 `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (PaymentConfigTestOrder) TableName() string {
return "payment_config_test_orders"
}