优化结构
This commit is contained in:
@@ -12,14 +12,13 @@ import (
|
||||
"encoding/json"
|
||||
"encoding/pem"
|
||||
"fmt"
|
||||
"kra/internal/biz/system"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"kra/internal/biz"
|
||||
|
||||
"github.com/go-pay/gopay"
|
||||
"github.com/go-pay/gopay/allinpay"
|
||||
"github.com/go-pay/gopay/douyin"
|
||||
@@ -117,7 +116,7 @@ func TestLakalaKeepsQueryAndFinalTradeIdentitiesSeparate(t *testing.T) {
|
||||
t.Fatalf("query result = %+v", result)
|
||||
}
|
||||
|
||||
refund, err := (&lakalaAdapter{}).Refund(context.Background(), &biz.PaymentRefundRequest{
|
||||
refund, err := (&lakalaAdapter{}).Refund(context.Background(), &system.PaymentRefundRequest{
|
||||
TradeNo: "MERCHANT-LAKALA-1", QueryID: created.QueryID,
|
||||
RefundNo: "REFUND-LAKALA-1", Amount: 40, Currency: "JPY",
|
||||
}, config)
|
||||
@@ -217,8 +216,8 @@ func TestLakalaCreateRoutesSupportedMethods(t *testing.T) {
|
||||
if tc.configMethod != "" {
|
||||
config["method"] = tc.configMethod
|
||||
}
|
||||
result, err := adapter.Create(context.Background(), &biz.PaymentRequest{
|
||||
Provider: biz.PaymentLakala, TradeNo: tc.tradeNo, Subject: "subject", Amount: 100,
|
||||
result, err := adapter.Create(context.Background(), &system.PaymentRequest{
|
||||
Provider: system.PaymentLakala, TradeNo: tc.tradeNo, Subject: "subject", Amount: 100,
|
||||
Currency: "JPY", Extra: extra,
|
||||
}, config)
|
||||
if err != nil {
|
||||
@@ -239,8 +238,8 @@ func TestLakalaCreateRoutesSupportedMethods(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestLakalaCreateRejectsUnknownMethod(t *testing.T) {
|
||||
_, err := (&lakalaAdapter{}).Create(context.Background(), &biz.PaymentRequest{
|
||||
Provider: biz.PaymentLakala, TradeNo: "L-UNKNOWN", Subject: "subject", Amount: 100,
|
||||
_, err := (&lakalaAdapter{}).Create(context.Background(), &system.PaymentRequest{
|
||||
Provider: system.PaymentLakala, TradeNo: "L-UNKNOWN", Subject: "subject", Amount: 100,
|
||||
Currency: "JPY", Extra: map[string]any{"method": "unsupported"},
|
||||
}, map[string]any{"partner_code": "PART", "credential_code": "credential", "channel": "Wechat"})
|
||||
if err == nil || !strings.Contains(err.Error(), "不支持的下单方式") {
|
||||
|
||||
Reference in New Issue
Block a user