From 0e0116250a5c2edb59eaac20b6ab5ede9d9e18e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Fri, 11 Oct 2024 19:00:49 +0800 Subject: [PATCH] test --- plugins/zltx_card/internal/transform.go | 2 ++ plugins/zltx_card/internal/zltx_card_test.go | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/zltx_card/internal/transform.go b/plugins/zltx_card/internal/transform.go index 662569f..d018a0f 100644 --- a/plugins/zltx_card/internal/transform.go +++ b/plugins/zltx_card/internal/transform.go @@ -97,6 +97,8 @@ func notifyResp(in po.Notify, appKey string) (*proto.NotifyResponse, error) { if len(parts) > 1 { car.Number = parts[0] car.Password = parts[1] + } else { + car.Password = s } b, _ := json.Marshal(car) pb.Result.Extra = b diff --git a/plugins/zltx_card/internal/zltx_card_test.go b/plugins/zltx_card/internal/zltx_card_test.go index 2611c91..890f9b7 100644 --- a/plugins/zltx_card/internal/zltx_card_test.go +++ b/plugins/zltx_card/internal/zltx_card_test.go @@ -13,8 +13,8 @@ var zltx = &ZLTXCardService{} func config() []byte { c := &Config{ - AppId: "23329", - AppKey: "8db16e8cc8363ed4eb4c14f9520bcc32", + AppId: "23369", + AppKey: "837c7a898810160ce5aab4c42bf22bc4", BaseUri: "http://test.openapi.1688sup.cn", NotifyUrl: "http://test.openapi.1688sup.cn", } @@ -82,7 +82,7 @@ func TestNotify(t *testing.T) { Config: config(), Queries: nil, Headers: nil, - Body: []byte(`{"merchantId":23329,"outTradeNo":"202410081741521448720005","status":"01","sign":"6AE0A09FA40CFE34280615DFA80C6E22"}`), + Body: []byte(`{"merchantId":23369,"outTradeNo":"202410111811015310010016","status":"01","cardCode":"2BFP3O53mSkWs3UzAlTMbg==","sign":"7EA395A982FD950296E4776369FA29B5"}`), } t.Run("TestNotify", func(t *testing.T) { got, err := zltx.Notify(context.Background(), in)