Documentation
¶
Overview ¶
Package simhttp 是 sim 模拟渠道的 DEV 测试 HTTP 面(「模拟三个支付渠道的 测试接口」),供人工 curl / 外部脚本驱动全管线:
POST /dev/billing-sim/{channel}/checkout 下单(走真实 svc.CreateCheckout)
POST /dev/billing-sim/{channel}/event 构造签名事件投递(真实
svc.HandleWebhook,raw body 保真)
GET /dev/billing-sim/{channel}/approve 本地 approve 占位页(会话回跳目标)
channel ∈ simwaffo | simpaypal | simstripe。
THIS SURFACE IS DEV-ONLY AND MUST NEVER BE MOUNTED IN PRODUCTION —— it forges payment webhooks. Mount 时以 Deps.Production=true 直接 panic 兜底 (接线侧必须同时用 PLOYKIT_DEV_ENABLED=1 且非 production 双重门控)。 本包路由刻意放在 sim/simhttp 而非 */adapters/http:tools/check_api.py 只 扫描各域 adapters/http 与 example 主干——DEV 测试面不入 OpenAPI 契约。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
Svc *app.BillingService
Channels app.ChannelSet // sim 渠道实例来源(取当前验签密钥;热重建后取新实例)
Repo app.Repo // 订单反查(事件旋钮自动补全)
Pool *pgxpool.Pool // 下单旋钮落点(plan 价格覆盖 / expires_at 改写)
Now func() time.Time
Log *slog.Logger
// Production=true 时 Mount 直接 panic——DEV-ONLY 的编译期外兜底。
Production bool
}
Deps wires the dev billing-sim surface.
Click to show internal directories.
Click to hide internal directories.