初始提交:岩美 pay 收款服务(支付宝当面付 + 多商户多渠道架构)
- Go/Gin/GORM + 纯 Go SQLite(无 cgo) - Channel 多渠道接口:支付宝当面付(precreate)/电脑网站支付(page.pay) 已实现,微信占位 - 多商户 merchants 表,回调验签+金额核对+幂等+查单兜底 - 收款页/结果页/二维码端点;docs/ 设计文档与部署 Runbook - 密钥走环境变量/Bitwarden,不入库 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type OrderStatus string
|
||||
|
||||
const (
|
||||
OrderPending OrderStatus = "pending" // 待支付
|
||||
OrderPaid OrderStatus = "paid" // 已支付
|
||||
OrderClosed OrderStatus = "closed" // 已关闭/超时
|
||||
OrderRefunded OrderStatus = "refunded" // 已退款
|
||||
)
|
||||
|
||||
// Order 一笔收款订单。OutTradeNo 是我们生成的商户订单号,贯穿下单/回调/查单。
|
||||
type Order struct {
|
||||
Base
|
||||
OutTradeNo string `gorm:"uniqueIndex;size:64;not null" json:"out_trade_no"`
|
||||
MerchantID uint64 `gorm:"index;not null" json:"merchant_id"`
|
||||
Channel string `gorm:"size:16" json:"channel"`
|
||||
ProductID uint64 `json:"product_id"`
|
||||
Subject string `gorm:"size:128" json:"subject"`
|
||||
Amount string `gorm:"size:20;not null" json:"amount"` // 权威金额,回调/查单核对用
|
||||
Status OrderStatus `gorm:"index;size:16;not null" json:"status"`
|
||||
TradeNo string `gorm:"index;size:64" json:"trade_no"` // 支付宝交易号
|
||||
BuyerLogonID string `gorm:"size:128" json:"buyer_logon_id"`
|
||||
PaidAt *time.Time `json:"paid_at"`
|
||||
ClientIP string `gorm:"size:64" json:"client_ip"`
|
||||
}
|
||||
Reference in New Issue
Block a user