This commit is contained in:
李子铭 2024-11-14 19:25:13 +08:00
parent c9c91d9146
commit e0985d04af
4 changed files with 16 additions and 13 deletions

View File

@ -22,7 +22,6 @@ func (c *Card) Order(ctx context.Context, request *Order) (*OrderResp, error) {
if err != nil {
return nil, err
}
fmt.Println("result:", string(result))
var response *OrderResp
if err = json.Unmarshal(result, &response); err != nil {
return nil, err

View File

@ -10,11 +10,14 @@ import (
)
func TestCardOrder(t *testing.T) {
server, err := core.NewDctWServer(&core.DctWConfig{
AppId: "1",
AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9",
BaseUri: "http://test.openapi.1688sup.cn",
})
server, err := core.NewDctWServer(
&core.DctWConfig{
AppId: "1",
AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9",
BaseUri: "http://test.openapi.1688sup.cn",
},
core.WithDebug(true),
)
if err != nil {
t.Fatal(err)
}

View File

@ -3,7 +3,6 @@ package direct
import (
"context"
"encoding/json"
"fmt"
"gitea.cdlsxd.cn/sdk/plugin/dctw/v1/api"
"gitea.cdlsxd.cn/sdk/plugin/dctw/v1/core"
"io/ioutil"
@ -22,7 +21,6 @@ func (c *Direct) Order(ctx context.Context, request *Order) (*OrderResp, error)
if err != nil {
return nil, err
}
fmt.Printf("result: %s\n", string(result))
var response *OrderResp
if err = json.Unmarshal(result, &response); err != nil {
return nil, err

View File

@ -11,11 +11,14 @@ import (
)
func TestDirect_Order(t *testing.T) {
server, err := core.NewDctWServer(&core.DctWConfig{
AppId: "1",
AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9",
BaseUri: "http://test.openapi.1688sup.cn",
})
server, err := core.NewDctWServer(
&core.DctWConfig{
AppId: "1",
AppKey: "1e2bf7a04b8b1e6be5dc78d04e8639c9",
BaseUri: "http://test.openapi.1688sup.cn",
},
core.WithDebug(true),
)
if err != nil {
t.Fatal(err)
}