diff --git a/dctw/v1/api/direct/direct.go b/dctw/v1/api/direct/direct.go index 16a5211..6374525 100644 --- a/dctw/v1/api/direct/direct.go +++ b/dctw/v1/api/direct/direct.go @@ -21,10 +21,12 @@ func (c *Direct) Order(ctx context.Context, request *Order) (*OrderResp, error) if err != nil { return nil, err } + var response *OrderResp if err = json.Unmarshal(result, &response); err != nil { return nil, err } + return response, nil } @@ -33,10 +35,12 @@ func (c *Direct) Query(ctx context.Context, request *Query) (*QueryResp, error) if err != nil { return nil, err } + var response *QueryResp if err = json.Unmarshal(result, &response); err != nil { return nil, err } + return response, nil } diff --git a/dctw/v1/api/direct/direct_test.go b/dctw/v1/api/direct/direct_test.go index c4b4178..818877d 100644 --- a/dctw/v1/api/direct/direct_test.go +++ b/dctw/v1/api/direct/direct_test.go @@ -56,8 +56,8 @@ func TestDirect_Query(t *testing.T) { } a := &Direct{DctWServer: server} req := &Query{ - MerchantId: "23329", - OutTradeNo: "test_zltx__direct_1", + MerchantId: "25537", + OutTradeNo: "test_zltx_direct_1", Version: "1.0", } resp, err := a.Query(context.Background(), req)