feat(pay-v2): P8 Task3 订阅创建 + 首期激活(subscription.created)+ 端点

This commit is contained in:
wangjia
2026-07-10 17:59:35 +08:00
parent 83e3551609
commit 4c242607a7
12 changed files with 411 additions and 11 deletions
+2 -1
View File
@@ -45,6 +45,7 @@ func TestE2ECryptoQuerySettles(t *testing.T) {
db := model.OpenTestDB(t)
orders := store.NewOrderStore(db)
refunds := store.NewRefundStore(db)
subs := store.NewSubscriptionStore(db)
acctReg := accounts.New([]config.AccountConfig{
{AccountID: "e2e-1", Channel: "crypto", Enabled: true, Region: "global", CredentialEnvPrefix: "e2e"},
})
@@ -56,7 +57,7 @@ func TestE2ECryptoQuerySettles(t *testing.T) {
picker := accounts.NewRouter(acctReg, nil, nil)
spy := &spyEnqueuer{}
g := gateway.New(orders, refunds, preg, picker, cryptoResolver{}, spy, "global")
g := gateway.New(orders, refunds, preg, picker, cryptoResolver{}, spy, "global", subs)
// 下单 → 从 session payload 拿到期望链上金额(base+唯一尾数),喂给假 TronGrid。
res, err := g.CreateOrder(context.Background(), gateway.CreateOrderInput{