public function fetchServices(){
        if (!array_key_exists('ShipmentRequestDetails.AmazonOrderId',$this->options)){
            $this->log("Amazon Order ID must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.ItemList.Item.1.OrderItemId',$this->options)){
            $this->log("Items must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.ShipFromAddress.Name',$this->options)){
            $this->log("Shipping Address must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.PackageDimensions.Length',$this->options) &&
                !array_key_exists('ShipmentRequestDetails.PackageDimensions.PredefinedPackageDimensions',$this->options)){
            $this->log("Package Dimensions must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.Weight.Value',$this->options)){
            $this->log("Weight must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.ShippingServiceOptions.DeliveryExperience',$this->options)){
            $this->log("Delivery Experience must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.ShippingServiceOptions.CarrierWillPickUp',$this->options)){
            $this->log("Carrier Pick-Up Option must be set in order to fetch a service list",'Warning');
            return false;
        }

        $url = $this->urlbase.$this->urlbranch;

        $query = $this->genQuery();

        $path = $this->options['Action'].'Result';
        if ($this->mockMode){
           $xml = $this->fetchMockFile()->$path;
        } else {
            $response = $this->sendRequest($url, array('Post'=>$query));

            if (!$this->checkResponse($response)){
                return false;
            }

            $xml = simplexml_load_string($response['body'])->$path;
        }

        $this->parseXML($xml);
    }
public function fetchServices(){
        if (!array_key_exists('ShipmentRequestDetails.AmazonOrderId',$this->options)){
            $this->log("Amazon Order ID must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.ItemList.Item.1.OrderItemId',$this->options)){
            $this->log("Items must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.ShipFromAddress.Name',$this->options)){
            $this->log("Shipping Address must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.PackageDimensions.Length',$this->options) &&
                !array_key_exists('ShipmentRequestDetails.PackageDimensions.PredefinedPackageDimensions',$this->options)){
            $this->log("Package Dimensions must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.Weight.Value',$this->options)){
            $this->log("Weight must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.ShippingServiceOptions.DeliveryExperience',$this->options)){
            $this->log("Delivery Experience must be set in order to fetch a service list",'Warning');
            return false;
        }
        if (!array_key_exists('ShipmentRequestDetails.ShippingServiceOptions.CarrierWillPickUp',$this->options)){
            $this->log("Carrier Pick-Up Option must be set in order to fetch a service list",'Warning');
            return false;
        }

        $url = $this->urlbase.$this->urlbranch;

        $query = $this->genQuery();

        $path = $this->options['Action'].'Result';
        if ($this->mockMode){
           $xml = $this->fetchMockFile()->$path;
        } else {
            $response = $this->sendRequest($url, array('Post'=>$query));

            if (!$this->checkResponse($response)){
                return false;
            }

            $xml = simplexml_load_string($response['body'])->$path;
        }

        $this->parseXML($xml);
    }
public function fetchServices ( ) { if ( ! array_key_exists ( 'ShipmentRequestDetails.AmazonOrderId' , $ this -> options ) ) { $ this -> log ( "Amazon Order ID must be set in order to fetch a service list" , 'Warning' ) ; return false ; } if ( ! array_key_exists ( 'ShipmentRequestDetails.ItemList.Item.1.OrderItemId' , $ this -> options ) ) { $ this -> log ( "Items must be set in order to fetch a service list" , 'Warning' ) ; return false ; } if ( ! array_key_exists ( 'ShipmentRequestDetails.ShipFromAddress.Name' , $ this -> options ) ) { $ this -> log ( "Shipping Address must be set in order to fetch a service list" , 'Warning' ) ; return false ; } if ( ! array_key_exists ( 'ShipmentRequestDetails.PackageDimensions.Length' , $ this -> options ) && ! array_key_exists ( 'ShipmentRequestDetails.PackageDimensions.PredefinedPackageDimensions' , $ this -> options ) ) { $ this -> log ( "Package Dimensions must be set in order to fetch a service list" , 'Warning' ) ; return false ; } if ( ! array_key_exists ( 'ShipmentRequestDetails.Weight.Value' , $ this -> options ) ) { $ this -> log ( "Weight must be set in order to fetch a service list" , 'Warning' ) ; return false ; } if ( ! array_key_exists ( 'ShipmentRequestDetails.ShippingServiceOptions.DeliveryExperience' , $ this -> options ) ) { $ this -> log ( "Delivery Experience must be set in order to fetch a service list" , 'Warning' ) ; return false ; } if ( ! array_key_exists ( 'ShipmentRequestDetails.ShippingServiceOptions.CarrierWillPickUp' , $ this -> options ) ) { $ this -> log ( "Carrier Pick-Up Option must be set in order to fetch a service list" , 'Warning' ) ; return false ; } $ url = $ this -> urlbase . $ this -> urlbranch ; $ query = $ this -> genQuery ( ) ; $ path = $ this -> options [ 'Action' ] . 'Result' ; if ( $ this -> mockMode ) { $ xml = $ this -> fetchMockFile ( ) -> $ path ; } else { $ response = $ this -> sendRequest ( $ url , array ( 'Post' => $ query ) ) ; if ( ! $ this -> checkResponse ( $ response ) ) { return false ; } $ xml = simplexml_load_string ( $ response [ 'body' ] ) -> $ path ; } $ this -> parseXML ( $ xml ) ; }
Fetches a list of eligible shipping Services from Amazon.

Submits a <i>GetEligibleShippingServices</i> request to Amazon. Amazon will send
one to three lists back as a response, which can be retrieved using <i>getServiceList</i>.
Other methods are available for fetching specific values from the valid services list.
The following parameters are required: Amazon order ID, item list, shipping address,
package dimensions, shipment weight, delivery experience option, and carrier pick-up option.
@return boolean <b>FALSE</b> if something goes wrong
Fetches a list of eligible shipping Services from Amazon .