优化结构

This commit is contained in:
Yvan
2026-08-28 11:10:57 +08:00
parent 5b17f47141
commit 676fa4d952
10 changed files with 91 additions and 80 deletions
+2 -4
View File
@@ -12,8 +12,6 @@ import (
"net/http/httptest"
"testing"
"kra/internal/paymentkit"
"github.com/go-pay/gopay"
gopayQQ "github.com/go-pay/gopay/qq"
)
@@ -55,7 +53,7 @@ func TestQQCreateKeepsClientPaymentDataOutOfDurableIdentities(t *testing.T) {
http.Error(w, "invalid XML", http.StatusBadRequest)
return
}
values, err := paymentkit.XMLValues(body)
values, err := testXMLValues(body)
if err != nil {
t.Errorf("parse request XML: %v", err)
http.Error(w, "invalid XML", http.StatusBadRequest)
@@ -81,7 +79,7 @@ func TestQQCreateKeepsClientPaymentDataOutOfDurableIdentities(t *testing.T) {
for key, value := range response {
encoded[key] = fmt.Sprint(value)
}
_, _ = w.Write(paymentkit.XMLEncode(encoded))
_, _ = w.Write(testXMLEncode(encoded))
}))
result, err := (&qqAdapter{}).Create(context.Background(), &bizpayment.PaymentRequest{