卡密,直充

This commit is contained in:
李子铭 2024-11-15 14:51:11 +08:00
parent 35ccf00466
commit fe8e56420f
2 changed files with 6 additions and 2 deletions

View File

@ -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
}

View File

@ -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)