初始提交:岩美 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:
wangjia
2026-06-25 07:21:48 +08:00
commit 6da6964451
29 changed files with 2205 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package channel
import (
"context"
"errors"
"net/http"
"github.com/wangjia/pay/internal/model"
)
// ErrNotImplemented 渠道尚未实现。
var ErrNotImplemented = errors.New("微信支付渠道尚未实现:微信无可用沙箱,待真实商户号下来后补 V3 实现")
// wechatChannel 占位实现。接口已就绪,补齐 V3 下单/回调/查单即可启用。
type wechatChannel struct{ m *model.Merchant }
func newWechat(m *model.Merchant) (Channel, error) { return &wechatChannel{m: m}, nil }
func (w *wechatChannel) Name() string { return "wechat" }
func (w *wechatChannel) PagePay(context.Context, CreateReq) (string, error) {
return "", ErrNotImplemented
}
func (w *wechatChannel) PreCreate(context.Context, CreateReq) (string, error) {
return "", ErrNotImplemented
}
func (w *wechatChannel) VerifyNotify(context.Context, *http.Request) (*NotifyResult, error) {
return nil, ErrNotImplemented
}
func (w *wechatChannel) Query(context.Context, string) (*QueryResult, error) {
return nil, ErrNotImplemented
}