卡密,直充
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var response *OrderResp
|
var response *OrderResp
|
||||||
if err = json.Unmarshal(result, &response); err != nil {
|
if err = json.Unmarshal(result, &response); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return response, nil
|
return response, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,10 +35,12 @@ func (c *Direct) Query(ctx context.Context, request *Query) (*QueryResp, error)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var response *QueryResp
|
var response *QueryResp
|
||||||
if err = json.Unmarshal(result, &response); err != nil {
|
if err = json.Unmarshal(result, &response); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return response, nil
|
return response, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,8 @@ func TestDirect_Query(t *testing.T) {
|
||||||
}
|
}
|
||||||
a := &Direct{DctWServer: server}
|
a := &Direct{DctWServer: server}
|
||||||
req := &Query{
|
req := &Query{
|
||||||
MerchantId: "23329",
|
MerchantId: "25537",
|
||||||
OutTradeNo: "test_zltx__direct_1",
|
OutTradeNo: "test_zltx_direct_1",
|
||||||
Version: "1.0",
|
Version: "1.0",
|
||||||
}
|
}
|
||||||
resp, err := a.Query(context.Background(), req)
|
resp, err := a.Query(context.Background(), req)
|
||||||
|
|
Loading…
Reference in New Issue