1
This commit is contained in:
@@ -3,6 +3,7 @@ package fnpsapi
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"time"
|
||||
)
|
||||
@@ -77,6 +78,12 @@ func (a *API) CreateOrder(createOrderParam *CreateOrderReqParam) (result string,
|
||||
}
|
||||
orderHead["business_data"] = string(bytes)
|
||||
resultData, err := a.AccessAPI(ApiURL, "createOrder", RequestPost, orderHead)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if utils.Interface2String(resultData["code"]) != "200" || utils.Interface2String(resultData["apiCode"]) != "" {
|
||||
return "", fmt.Errorf(fmt.Sprintf("其他异常错误信息:%s", utils.Interface2String(resultData["apiCode"])))
|
||||
}
|
||||
if orderId, ok := resultData["business_data"]; ok {
|
||||
res := &CreateOrderRes{}
|
||||
if err := json.Unmarshal([]byte(utils.Interface2String(orderId)), res); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user