Ejemplo n.º 1
0
 /**
  * Estimate Transport Request
  * Initiates the process for requesting an estimated shipping cost based-on the shipment
  *     for which the request is being made, whether or not the carrier shipment is partnered/non-partnered
  *     and the carrier type.
  *
  * @param mixed $request array of parameters for FBAInboundServiceMWS_Model_EstimateTransportRequest request or FBAInboundServiceMWS_Model_EstimateTransportRequest object itself
  * @see FBAInboundServiceMWS_Model_EstimateTransportInputRequest
  * @return FBAInboundServiceMWS_Model_EstimateTransportRequestResponse
  *
  * @throws FbaInbound_Exception
  */
 public function estimateTransportRequest($request)
 {
     if (!$request instanceof Model\FBAInboundServiceMWS_Model_EstimateTransportInputRequest) {
         //require_once (dirname(__FILE__) . '/Model/EstimateTransportInputRequest.php');
         $request = new FBAInboundServiceMWS_Model_EstimateTransportInputRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'EstimateTransportRequest';
     $httpResponse = $this->_invoke($parameters);
     //require_once (dirname(__FILE__) . '/Model/EstimateTransportRequestResponse.php');
     $response = Model\FBAInboundServiceMWS_Model_EstimateTransportRequestResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }
 * Uncomment to try out Mock Service that simulates FBAInboundServiceMWS
 * responses without calling FBAInboundServiceMWS service.
 *
 * Responses are loaded from local XML files. You can tweak XML files to
 * experiment with various outputs during development
 *
 * XML files available under FBAInboundServiceMWS/Mock tree
 *
 ***********************************************************************/
// $service = new FBAInboundServiceMWS_Mock();
/************************************************************************
 * Setup request parameters and uncomment invoke to try out
 * sample for Estimate Transport Request Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as FBAInboundServiceMWS_Model_EstimateTransportRequest
$request = new FBAInboundServiceMWS_Model_EstimateTransportInputRequest();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeEstimateTransportRequest($service, $request);
/**
 * Get Estimate Transport Request Action Sample
 * Gets competitive pricing and related information for a product identified by
 * the MarketplaceId and ASIN.
 *
 * @param FBAInboundServiceMWS_Interface $service instance of FBAInboundServiceMWS_Interface
 * @param mixed $request FBAInboundServiceMWS_Model_EstimateTransportRequest or array of parameters
 */
function invokeEstimateTransportRequest(FBAInboundServiceMWS_Interface $service, $request)
{
    try {
        $response = $service->EstimateTransportRequest($request);