From 1b3162df5d663963cf380116c82a893f39fcab60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Fri, 15 Nov 2024 13:47:51 +0800 Subject: [PATCH] TestZc_DctWServer --- dctw/v1/api/card/card_test.go | 4 ++-- dctw/v1/api/direct/direct_test.go | 12 ++++++------ dctw/v1/core/core.go | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dctw/v1/api/card/card_test.go b/dctw/v1/api/card/card_test.go index 83d9440..0ebcc3a 100644 --- a/dctw/v1/api/card/card_test.go +++ b/dctw/v1/api/card/card_test.go @@ -29,7 +29,7 @@ func TestCard_Order(t *testing.T) { OutTradeNo: "test_card_zltx_1", ProductId: "222", Mobile: "18666666666", - NotifyUrl: "http://test.openapi.1688sup.cn", + NotifyUrl: "https://gateway.dev.cdlsxd.cn/yxh5api/v1/order/direct/notify", Version: "1.0", } resp, err := a.Order(context.Background(), req) @@ -90,7 +90,7 @@ func TestCard_Notify(t *testing.T) { headers.Set("Content-Type", core.ApplicationJSON) var httpRequest = &http.Request{ - Header: http.Header{}, + Header: headers, Body: ioutil.NopCloser(bytes.NewBuffer(body)), } resp, err := a.Notify(context.Background(), httpRequest) diff --git a/dctw/v1/api/direct/direct_test.go b/dctw/v1/api/direct/direct_test.go index 347ed88..c4b4178 100644 --- a/dctw/v1/api/direct/direct_test.go +++ b/dctw/v1/api/direct/direct_test.go @@ -25,12 +25,12 @@ func TestDirect_Order(t *testing.T) { a := &Direct{DctWServer: server} req := &Order{ Number: 1, - MerchantId: "23329", - OutTradeNo: "test_direct_zltx_7", - ProductId: "106", + MerchantId: "25537", + OutTradeNo: "test_zltx_direct_1", + ProductId: "101", AccountType: 1, RechargeAccount: "18666666666", - NotifyUrl: "http://test.openapi.1688sup.cn", + NotifyUrl: "https://gateway.dev.cdlsxd.cn/yxh5api/v1/order/direct/notify", Version: "1.0", } resp, err := a.Order(context.Background(), req) @@ -57,7 +57,7 @@ func TestDirect_Query(t *testing.T) { a := &Direct{DctWServer: server} req := &Query{ MerchantId: "23329", - OutTradeNo: "test_direct_zltx_7", + OutTradeNo: "test_zltx__direct_1", Version: "1.0", } resp, err := a.Query(context.Background(), req) @@ -91,7 +91,7 @@ func TestDirect_Notify(t *testing.T) { headers.Set("Content-Type", core.ApplicationJSON) var httpRequest = &http.Request{ - Header: http.Header{}, + Header: headers, Body: ioutil.NopCloser(bytes.NewBuffer(body)), } resp, err := a.Notify(context.Background(), httpRequest) diff --git a/dctw/v1/core/core.go b/dctw/v1/core/core.go index e5af089..11a71f6 100644 --- a/dctw/v1/core/core.go +++ b/dctw/v1/core/core.go @@ -14,7 +14,7 @@ import ( const ( DeBug = true - SignType = "md5" + SignType = "MD5" SignKeyName = "Authorization" ApplicationJSON = "application/json" )