196 lines
12 KiB
Go
196 lines
12 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
type PlatformPaymentChannel struct {
|
|
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
|
Channel string `orm:"column(channel);size(32)" json:"channel"`
|
|
Name string `orm:"column(name);size(64)" json:"name"`
|
|
MerchantNo string `orm:"column(merchant_no);size(128)" json:"merchant_no"`
|
|
ConfigJSON *string `orm:"column(config_json);type(text);null" json:"-"`
|
|
CertJSON *string `orm:"column(cert_json);type(text);null" json:"-"`
|
|
CallbackURL string `orm:"column(callback_url);size(255)" json:"callback_url"`
|
|
Enabled int8 `orm:"column(enabled);default(0)" json:"enabled"`
|
|
ExtraJSON *string `orm:"column(extra_json);type(text);null" json:"-"`
|
|
LastTestTime *time.Time `orm:"column(last_test_time);type(datetime);null" json:"last_test_time"`
|
|
LastTestResult string `orm:"column(last_test_result);size(255)" json:"last_test_result"`
|
|
Remark string `orm:"column(remark);size(255)" json:"remark"`
|
|
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
|
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
|
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
|
}
|
|
|
|
func (m *PlatformPaymentChannel) TableName() string { return "yz_platform_payment_channel" }
|
|
|
|
type PlatformPaymentOrder struct {
|
|
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
|
PayNo string `orm:"column(pay_no);size(40)" json:"pay_no"`
|
|
OutTradeNo string `orm:"column(out_trade_no);size(64)" json:"out_trade_no"`
|
|
OrderType string `orm:"column(order_type);size(32)" json:"order_type"`
|
|
Subject string `orm:"column(subject);size(255)" json:"subject"`
|
|
TenantID string `orm:"column(tenant_id);size(64)" json:"tenant_id"`
|
|
TenantName string `orm:"column(tenant_name);size(128)" json:"tenant_name"`
|
|
Amount int64 `orm:"column(amount);default(0)" json:"amount"`
|
|
OrderAmount int64 `orm:"column(order_amount);default(0)" json:"order_amount"`
|
|
Currency string `orm:"column(currency);size(8)" json:"currency"`
|
|
Channel string `orm:"column(channel);size(32)" json:"channel"`
|
|
MerchantNo string `orm:"column(merchant_no);size(128)" json:"merchant_no"`
|
|
ChannelTradeNo string `orm:"column(channel_trade_no);size(64)" json:"channel_trade_no"`
|
|
Status string `orm:"column(status);size(20)" json:"status"`
|
|
RefundAmount int64 `orm:"column(refund_amount);default(0)" json:"refund_amount"`
|
|
ClientIP string `orm:"column(client_ip);size(64)" json:"client_ip"`
|
|
ReturnURL string `orm:"column(return_url);size(255)" json:"return_url"`
|
|
NotifyURL string `orm:"column(notify_url);size(255)" json:"notify_url"`
|
|
ExpireAt *time.Time `orm:"column(expire_at);type(datetime);null" json:"expire_at"`
|
|
PaidAt *time.Time `orm:"column(paid_at);type(datetime);null" json:"paid_at"`
|
|
ClosedAt *time.Time `orm:"column(closed_at);type(datetime);null" json:"closed_at"`
|
|
NotifyAt *time.Time `orm:"column(notify_at);type(datetime);null" json:"notify_at"`
|
|
LastQueryAt *time.Time `orm:"column(last_query_at);type(datetime);null" json:"last_query_at"`
|
|
OrderSynced int8 `orm:"column(order_synced);default(0)" json:"order_synced"`
|
|
PromoterID string `orm:"column(promoter_id);size(64)" json:"promoter_id"`
|
|
PromoterName string `orm:"column(promoter_name);size(128)" json:"promoter_name"`
|
|
PromoterType string `orm:"column(promoter_type);size(32)" json:"promoter_type"`
|
|
Remark string `orm:"column(remark);size(255)" json:"remark"`
|
|
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
|
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
|
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
|
}
|
|
|
|
func (m *PlatformPaymentOrder) TableName() string { return "yz_platform_payment_order" }
|
|
|
|
const (
|
|
PayStatusCreated = "created"
|
|
PayStatusPending = "pending"
|
|
PayStatusPaying = "paying"
|
|
PayStatusPaid = "paid"
|
|
PayStatusFailed = "failed"
|
|
PayStatusClosed = "closed"
|
|
PayStatusRefunding = "refunding"
|
|
PayStatusRefunded = "refunded"
|
|
)
|
|
|
|
type PlatformPaymentOrderLog struct {
|
|
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
|
PayNo string `orm:"column(pay_no);size(40)" json:"pay_no"`
|
|
FromStatus string `orm:"column(from_status);size(20)" json:"from_status"`
|
|
ToStatus string `orm:"column(to_status);size(20)" json:"to_status"`
|
|
Operator string `orm:"column(operator);size(64)" json:"operator"`
|
|
Remark string `orm:"column(remark);size(500)" json:"remark"`
|
|
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
|
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
|
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
|
}
|
|
|
|
func (m *PlatformPaymentOrderLog) TableName() string { return "yz_platform_payment_order_log" }
|
|
|
|
type PlatformPaymentCallbackLog struct {
|
|
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
|
Channel string `orm:"column(channel);size(32)" json:"channel"`
|
|
EventType string `orm:"column(event_type);size(64)" json:"event_type"`
|
|
EventID string `orm:"column(event_id);size(128)" json:"event_id"`
|
|
PayNo string `orm:"column(pay_no);size(40)" json:"pay_no"`
|
|
OutTradeNo string `orm:"column(out_trade_no);size(64)" json:"out_trade_no"`
|
|
ChannelTradeNo string `orm:"column(channel_trade_no);size(64)" json:"channel_trade_no"`
|
|
TradeState string `orm:"column(trade_state);size(32)" json:"trade_state"`
|
|
Amount int64 `orm:"column(amount);default(0)" json:"amount"`
|
|
VerifyResult int8 `orm:"column(verify_result);default(0)" json:"verify_result"`
|
|
IsDuplicate int8 `orm:"column(is_duplicate);default(0)" json:"is_duplicate"`
|
|
HandleResult int8 `orm:"column(handle_result);default(0)" json:"handle_result"`
|
|
HandleMsg string `orm:"column(handle_msg);size(255)" json:"handle_msg"`
|
|
RawBody *string `orm:"column(raw_body);type(text);null" json:"raw_body"`
|
|
ClientIP string `orm:"column(client_ip);size(64)" json:"client_ip"`
|
|
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
|
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
|
}
|
|
|
|
func (m *PlatformPaymentCallbackLog) TableName() string {
|
|
return "yz_platform_payment_callback_log"
|
|
}
|
|
|
|
type PlatformPaymentChannelBill struct {
|
|
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
|
Channel string `orm:"column(channel);size(32)" json:"channel"`
|
|
BillDate time.Time `orm:"column(bill_date);type(date)" json:"bill_date"`
|
|
ChannelTradeNo string `orm:"column(channel_trade_no);size(64)" json:"channel_trade_no"`
|
|
OutTradeNo string `orm:"column(out_trade_no);size(64)" json:"out_trade_no"`
|
|
Amount int64 `orm:"column(amount);default(0)" json:"amount"`
|
|
Fee int64 `orm:"column(fee);default(0)" json:"fee"`
|
|
TradeState string `orm:"column(trade_state);size(32)" json:"trade_state"`
|
|
TradeTime *time.Time `orm:"column(trade_time);type(datetime);null" json:"trade_time"`
|
|
IsMatched int8 `orm:"column(is_matched);default(0)" json:"is_matched"`
|
|
MatchedPayNo string `orm:"column(matched_pay_no);size(40)" json:"matched_pay_no"`
|
|
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
|
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
|
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
|
}
|
|
|
|
func (m *PlatformPaymentChannelBill) TableName() string {
|
|
return "yz_platform_payment_channel_bill"
|
|
}
|
|
|
|
type PlatformPaymentReconcileDiff struct {
|
|
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
|
Channel string `orm:"column(channel);size(32)" json:"channel"`
|
|
BillDate time.Time `orm:"column(bill_date);type(date)" json:"bill_date"`
|
|
BatchNo string `orm:"column(batch_no);size(40)" json:"batch_no"`
|
|
LocalTradeNo string `orm:"column(local_trade_no);size(64)" json:"local_trade_no"`
|
|
ChannelTradeNo string `orm:"column(channel_trade_no);size(64)" json:"channel_trade_no"`
|
|
LocalAmount *int64 `orm:"column(local_amount);null" json:"local_amount"`
|
|
ChannelAmount *int64 `orm:"column(channel_amount);null" json:"channel_amount"`
|
|
DiffAmount int64 `orm:"column(diff_amount);default(0)" json:"diff_amount"`
|
|
DiffType string `orm:"column(diff_type);size(20)" json:"diff_type"`
|
|
HandleStatus string `orm:"column(handle_status);size(20)" json:"handle_status"`
|
|
HandleUserID string `orm:"column(handle_user_id);size(64)" json:"handle_user_id"`
|
|
HandleUserName string `orm:"column(handle_user_name);size(128)" json:"handle_user_name"`
|
|
HandleTime *time.Time `orm:"column(handle_time);type(datetime);null" json:"handle_time"`
|
|
Remark string `orm:"column(remark);size(500)" json:"remark"`
|
|
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
|
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
|
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
|
}
|
|
|
|
func (m *PlatformPaymentReconcileDiff) TableName() string {
|
|
return "yz_platform_payment_reconcile_diff"
|
|
}
|
|
|
|
const (
|
|
DiffTypeLong = "long"
|
|
DiffTypeShort = "short"
|
|
DiffTypeStatusMismatch = "status_mismatch"
|
|
)
|
|
|
|
const (
|
|
DiffHandleUnhandled = "unhandled"
|
|
DiffHandleHandling = "handling"
|
|
DiffHandleHandled = "handled"
|
|
DiffHandleIgnored = "ignored"
|
|
)
|
|
|
|
type PlatformPaymentRefund struct {
|
|
ID uint64 `orm:"column(id);pk;auto" json:"id"`
|
|
RefundNo string `orm:"column(refund_no);size(40)" json:"refund_no"`
|
|
PayNo string `orm:"column(pay_no);size(40)" json:"pay_no"`
|
|
OutTradeNo string `orm:"column(out_trade_no);size(64)" json:"out_trade_no"`
|
|
Channel string `orm:"column(channel);size(32)" json:"channel"`
|
|
ChannelRefundNo string `orm:"column(channel_refund_no);size(64)" json:"channel_refund_no"`
|
|
Amount int64 `orm:"column(amount);default(0)" json:"amount"`
|
|
Reason string `orm:"column(reason);size(500)" json:"reason"`
|
|
Status string `orm:"column(status);size(20)" json:"status"`
|
|
FailReason string `orm:"column(fail_reason);size(500)" json:"fail_reason"`
|
|
OperatorID string `orm:"column(operator_id);size(64)" json:"operator_id"`
|
|
OperatorName string `orm:"column(operator_name);size(128)" json:"operator_name"`
|
|
FinishedAt *time.Time `orm:"column(finished_at);type(datetime);null" json:"finished_at"`
|
|
Remark string `orm:"column(remark);size(500)" json:"remark"`
|
|
CreateTime time.Time `orm:"column(create_time);auto_now_add;type(datetime)" json:"create_time"`
|
|
UpdateTime time.Time `orm:"column(update_time);auto_now;type(datetime)" json:"update_time"`
|
|
DeleteTime *time.Time `orm:"column(delete_time);type(datetime);null" json:"delete_time"`
|
|
}
|
|
|
|
func (m *PlatformPaymentRefund) TableName() string { return "yz_platform_payment_refund" }
|
|
|
|
const (
|
|
RefundStatusProcessing = "processing"
|
|
RefundStatusSuccess = "success"
|
|
RefundStatusFailed = "failed"
|
|
)
|