卡密,直充
This commit is contained in:
parent
35ccf00466
commit
fe8e56420f
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue