Documentation
¶
Overview ¶
fedex provides access to (some) FedEx Soap API's and unmarshall answers into Go structures
History: Nov 20 13 tcolar Creation
Index ¶
- Constants
- func Dump(reply TrackReply)
- type AncillaryDetail
- type CompletedTrackDetail
- type Event
- type Fedex
- func (f Fedex) ParseTrackReply(xmlResp []byte) (reply TrackReply, err error)
- func (f Fedex) PostXml(url string, xml string) (content []byte, err error)
- func (f Fedex) TrackByNumber(carrierCode string, trackingNo string) (reply TrackReply, err error)
- func (f Fedex) TrackByPo(carrierCode string, po string, postalCode string, countryCode string) (reply TrackReply, err error)
- func (f Fedex) TrackByShipperRef(carrierCode string, shipperRef string, shipperAccountNumber string) (reply TrackReply, err error)
- type Identifier
- type Location
- type Notification
- type OtherIdentifier
- type Service
- type SpecialHandling
- type StatusDetail
- type TrackDetail
- type TrackReply
- type Version
- type Weight
Constants ¶
const ( // Convenience constants for standard Fedex API url's FEDEX_API_URL = "https://ws.fedex.com:443/web-services" FEDEX_API_TEST_URL = "https://wsbeta.fedex.com:443/web-services" FEDEX_TEST_TRACKING = "123456789012" )
const ( FEDEX_SOAP_HEAD = `` /* 656-byte string literal not displayed */ FEDEX_SOAP_TAIL = ` </q0:TrackRequest> </soapenv:Body></soapenv:Envelope>` )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AncillaryDetail ¶
type CompletedTrackDetail ¶
type CompletedTrackDetail struct {
HighestSeverity string
Notifications []Notification
DuplicateWaybill bool
MoreData bool
TrackDetails []TrackDetail
}
type Fedex ¶
Fedex : Utility to retrieve data from Fedex API Bypassing painful proper SOAP implementation and just crafting minimal XML messages to get the data we need. Fedex WSDL docs here: http://images.fedex.com/us/developer/product/WebServices/MyWebHelp/DeveloperGuide2012.pdf
func (Fedex) ParseTrackReply ¶
func (f Fedex) ParseTrackReply(xmlResp []byte) (reply TrackReply, err error)
Unmarshal XML SOAP response into a TrackReply
func (Fedex) TrackByNumber ¶
func (f Fedex) TrackByNumber(carrierCode string, trackingNo string) (reply TrackReply, err error)
TrackByNumber : Returns tracking info for a specific Fedex tracking number
func (Fedex) TrackByPo ¶
func (f Fedex) TrackByPo(carrierCode string, po string, postalCode string, countryCode string) (reply TrackReply, err error)
TrackByPo : Returns tracking info for a specific Purchase Order (often the OrderId) Note that Fedex requires the Destination Postal Code & country
to match when making PO queries
func (Fedex) TrackByShipperRef ¶
func (f Fedex) TrackByShipperRef(carrierCode string, shipperRef string, shipperAccountNumber string) (reply TrackReply, err error)
TrackByShipperRef : Return tracking info for a specific shipper reference ShipperRef is usually an order ID or other unique identifier ShipperAccountNumber is the Fedex account number of the shipper
type Identifier ¶
type Notification ¶
type OtherIdentifier ¶
type OtherIdentifier struct {
PackageIdentifier Identifier
}
type SpecialHandling ¶
type StatusDetail ¶
type StatusDetail struct {
CreationTime string
Code string
Description string
Location Location
AncillaryDetails []AncillaryDetail
}
type TrackDetail ¶
type TrackDetail struct {
TrackingNumber string
TrackingNumberUniqueIdentifier string
Notification Notification
StatusDetail StatusDetail
CarrierCode string
OperatingCompanyOrCarrierDescription string
OtherIdentifiers []OtherIdentifier
Service Service
PackageWeight Weight
ShipmentWeight Weight
Packaging string
PackagingType string
PackageSequenceNumber int
PackageCount int
SpecialHandlings []SpecialHandling
ShipTimestamp string
ActualDeliveryTimestamp string
DestinationAddress Location
ActualDeliveryAddress Location
DeliveryLocationType string
DeliveryLocationDescription string
DeliveryAttempts int
DeliverySignatureName string
TotalUniqueAddressCountInConsolidation int
NotificationEventsAvailable string
RedirectToHoldEligibility string
Events []Event
}
type TrackReply ¶
type TrackReply struct {
HighestSeverity string
Notifications []Notification
Version Version
CompletedTrackDetails []CompletedTrackDetail
}
TrackReply : Track reply root (`xml:"Body>TrackReply"`)
func (TrackReply) Failed ¶
func (r TrackReply) Failed() bool