优化结构

This commit is contained in:
Yvan
2026-08-22 12:13:16 +08:00
parent d987244d0e
commit b27a66e9d3
200 changed files with 1794 additions and 1715 deletions
+3 -3
View File
@@ -6,12 +6,12 @@ import (
"encoding/json"
"fmt"
"io"
"kra/internal/biz/system"
"net"
"net/http"
"net/http/httptest"
"testing"
"kra/internal/biz"
"kra/pkg/paymentkit"
"github.com/go-pay/gopay"
@@ -84,14 +84,14 @@ func TestQQCreateKeepsClientPaymentDataOutOfDurableIdentities(t *testing.T) {
_, _ = w.Write(paymentutil.XMLEncode(encoded))
}))
result, err := (&qqAdapter{}).Create(context.Background(), &biz.PaymentRequest{
result, err := (&qqAdapter{}).Create(context.Background(), &system.PaymentRequest{
TradeNo: "MERCHANT-QQ-1", Subject: "subject", Amount: 100,
Currency: "CNY", ClientIP: "127.0.0.1", NotifyURL: "https://merchant.example/qq/notify",
}, map[string]any{"mch_id": "QQ-MERCHANT", "api_key": "qq-api-key"})
if err != nil {
t.Fatal(err)
}
if result.Provider != biz.PaymentQQ || result.Status != "created" || result.TradeNo != "MERCHANT-QQ-1" {
if result.Provider != system.PaymentQQ || result.Status != "created" || result.TradeNo != "MERCHANT-QQ-1" {
t.Fatalf("create result = %+v", result)
}
if result.QueryID != "" || result.ProviderTradeNo != "" {