Exemple #1
0
 /**
  * Get Package Labels
  * Retrieves the PDF-formatted package label data for the packages of the
  *     shipment. These labels will include relevant data for shipments utilizing
  *     Amazon-partnered carriers. The PDF data will be ZIP'd and then it will be encoded as a Base64 string, and
  *     MD5 hash is included with the response to validate the label data which will be encoded as Base64.
  *     The language of the address and FC prep instructions sections of the labels are
  *     determined by the marketplace in which the request is being made and the marketplace of
  *     the destination FC, respectively.
  *
  *     Only select PageTypes are supported in each marketplace. By marketplace, the
  *     supported types are:
  *       * US non-partnered UPS: PackageLabel_Letter_6
  *       * US partnered-UPS: PackageLabel_Letter_2
  *       * GB, DE, FR, IT, ES: PackageLabel_A4_4, PackageLabel_Plain_Paper
  *       * Partnered EU: ? <!-- TODO: define this -->
  *       * JP/CN: PackageLabel_Plain_Paper
  *
  * @param mixed $request array of parameters for FBAInboundServiceMWS_Model_GetPackageLabels request or FBAInboundServiceMWS_Model_GetPackageLabels object itself
  * @see FBAInboundServiceMWS_Model_GetPackageLabelsRequest
  * @return FBAInboundServiceMWS_Model_GetPackageLabelsResponse
  *
  * @throws FBAInboundServiceMWS_Exception
  */
 public function getPackageLabels($request)
 {
     if (!$request instanceof FBAInboundServiceMWS_Model_GetPackageLabelsRequest) {
         $request = new FBAInboundServiceMWS_Model_GetPackageLabelsRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'GetPackageLabels';
     $httpResponse = $this->_invoke($parameters);
     $response = FBAInboundServiceMWS_Model_GetPackageLabelsResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }
 /**
  * Get Package Labels
  * Retrieves the PDF-formatted package label data for the packages of the
  *     shipment. These labels will include relevant data for shipments utilizing 
  *     Amazon-partnered carriers. The PDF data will be ZIP'd and then it will be encoded as a Base64 string, and
  *     MD5 hash is included with the response to validate the label data which will be encoded as Base64.
  *     The language of the address and FC prep instructions sections of the labels are
  *     determined by the marketplace in which the request is being made and the marketplace of
  *     the destination FC, respectively.
  *     
  *     Only select PageTypes are supported in each marketplace. By marketplace, the
  *     supported types are:
  *       * US non-partnered UPS: PackageLabel_Letter_6
  *       * US partnered-UPS: PackageLabel_Letter_2
  *       * GB, DE, FR, IT, ES: PackageLabel_A4_4, PackageLabel_Plain_Paper
  *       * Partnered EU: ? <!-- TODO: define this -->
  *       * JP/CN: PackageLabel_Plain_Paper
  *
  * @param mixed $request array of parameters for FBAInboundServiceMWS_Model_GetPackageLabels request or FBAInboundServiceMWS_Model_GetPackageLabels object itself
  * @see FBAInboundServiceMWS_Model_GetPackageLabelsRequest
  * @return FBAInboundServiceMWS_Model_GetPackageLabelsResponse
  *
  * @throws FbaInbound_Exception
  */
 public function getPackageLabels($request)
 {
     if (!$request instanceof Model\FBAInboundServiceMWS_Model_GetPackageLabelsRequest) {
         //require_once (dirname(__FILE__) . '/Model/GetPackageLabelsRequest.php');
         $request = new FBAInboundServiceMWS_Model_GetPackageLabelsRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'GetPackageLabels';
     $httpResponse = $this->_invoke($parameters);
     //require_once (dirname(__FILE__) . '/Model/GetPackageLabelsResponse.php');
     $response = Model\FBAInboundServiceMWS_Model_GetPackageLabelsResponse::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 Get Package Labels Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as FBAInboundServiceMWS_Model_GetPackageLabels
$request = new FBAInboundServiceMWS_Model_GetPackageLabelsRequest();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeGetPackageLabels($service, $request);
/**
 * Get Get Package Labels 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_GetPackageLabels or array of parameters
 */
function invokeGetPackageLabels(FBAInboundServiceMWS_Interface $service, $request)
{
    try {
        $response = $service->GetPackageLabels($request);