优化结构
This commit is contained in:
@@ -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 != "" {
|
||||
|
||||
Reference in New Issue
Block a user