fd5f56f7de
- 微信支付 V3 Native 渠道 (wechat.go):Native下单/回调AES-GCM解密验签/查单 - 支付宝:手机网站支付 wap.pay + 按 UA 自适应(PC page.pay扫码 / 手机拉App);qr_pay_mode=2 完整扫码收银台 - 业务对接:下单接口扩展(biz_system/biz_ref/return_url)+ HMAC 签名鉴权;支付成功 webhook 主动推送业务方 + 60s 重试 + BizNotifyLog - 通用多业务:config.biz 改 map,加业务只改配置(BIZ_<SYS>_SECRET/_CALLBACK_URL) - seedPlans:四档真实套餐 + promo_first_month(¥1) + test_liandiao(0.01),均挂 biz_code;/products 暴露 biz_code - 删除沙箱 pay.html;对接设计文档入 docs Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019UQmqWmV67sXGLrb3U1XXn
34 lines
1.6 KiB
Go
34 lines
1.6 KiB
Go
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"`
|
|
|
|
// —— 业务对接(如 jiu 授权续费)——
|
|
BizSystem string `gorm:"index;size:32" json:"biz_system,omitempty"` // 业务来源,如 jiu;决定入账后回调哪个 webhook。空=独立收款(/paytest 等)
|
|
BizRef string `gorm:"size:128" json:"biz_ref,omitempty"` // 业务引用(jiu 的 purchase_id),webhook 原样回传
|
|
BizNotified bool `gorm:"default:false" json:"biz_notified"` // 业务 webhook 是否已成功回调(幂等/重试用)
|
|
}
|