diff --git a/partnerapi/tnc/const.go b/partnerapi/tnc/const.go index d12a697..d07f2f1 100644 --- a/partnerapi/tnc/const.go +++ b/partnerapi/tnc/const.go @@ -34,7 +34,7 @@ const ( baseURLStaging = "https://ext.stg.vnfai.com" baseURLAuthProd = "https://auth.vnfai.com" - baseURLProd = "https://ext.vnfai.com" + baseURLProd = "https://ext-api.vnfai.com" ) const ( diff --git a/partnerapi/tnc/model_request.go b/partnerapi/tnc/model_request.go index 5f0a41d..3f2352c 100644 --- a/partnerapi/tnc/model_request.go +++ b/partnerapi/tnc/model_request.go @@ -45,8 +45,14 @@ type OutboundRequestPayload struct { // UpdateORLogisticInfoPayload ... type UpdateORLogisticInfoPayload struct { - OrID int `json:"orId"` - TrackingCode string `json:"trackingCode"` - ShippingLabel string `json:"shippingLabel"` - SlaShipDate string `json:"slaShipDate"` + OrID int `json:"orId"` + + TPLCode string `json:"tplCode"` + TrackingCode string `json:"trackingCode"` + ShippingLabels []LogisticInfoLabel `json:"shippingLabels"` +} + +type LogisticInfoLabel struct { + Caption string `json:"caption"` + URI string `json:"uri"` } diff --git a/partnerapi/tnc/tnc.go b/partnerapi/tnc/tnc.go index 0df0e74..30d1e30 100644 --- a/partnerapi/tnc/tnc.go +++ b/partnerapi/tnc/tnc.go @@ -67,7 +67,6 @@ func (c *Client) CreateOutboundRequest(p OutboundRequestPayload) (*OutboundReque } var ( r model.CommunicationHttpResponse - errRes Error dataRes []OutboundRequestRes ) if err = pjson.Unmarshal(msg.Data, &r); err != nil { @@ -78,6 +77,7 @@ func (c *Client) CreateOutboundRequest(p OutboundRequestPayload) (*OutboundReque return nil, fmt.Errorf("tnc.Client.CreateOutboundRequest: empty_response") } if res.StatusCode >= http.StatusBadRequest { + var errRes Error if err = r.ParseResponseData(&errRes); err != nil { return nil, fmt.Errorf("tnc.Client.CreateOutboundRequest: parse_response_err: %v", err) } @@ -92,7 +92,7 @@ func (c *Client) CreateOutboundRequest(p OutboundRequestPayload) (*OutboundReque item := &dataRes[0] e := item.Error if e != nil { - return nil, errRes + return nil, e } return item, err