Example #1
0
 /**
  * Confirm Preorder
  * Given a shipment id. and date as input, this API confirms a shipment as a
  * pre-order.
  * This date must be the same as the NeedByDate (NBD) that is returned in the
  * GetPreorderInfo API. Any other date will result in an appropriate error code.
  * All items in the shipment with a release date on or after the
  * ConfirmedFulfillableDate ( also returned by the GetPreorderInfo  API) would
  * be pre-orderable on the website and would be fulfilled without promise breaks,
  * if the NBD is met.
  *
  * @param mixed $request array of parameters for FBAInboundServiceMWS_Model_ConfirmPreorder request or FBAInboundServiceMWS_Model_ConfirmPreorder object itself
  * @see FBAInboundServiceMWS_Model_ConfirmPreorderRequest
  * @return FBAInboundServiceMWS_Model_ConfirmPreorderResponse
  *
  * @throws FBAInboundServiceMWS_Exception
  */
 public function confirmPreorder($request)
 {
     if (!$request instanceof FBAInboundServiceMWS_Model_ConfirmPreorderRequest) {
         require_once dirname(__FILE__) . '/Model/ConfirmPreorderRequest.php';
         $request = new FBAInboundServiceMWS_Model_ConfirmPreorderRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'ConfirmPreorder';
     $httpResponse = $this->_invoke($parameters);
     require_once dirname(__FILE__) . '/Model/ConfirmPreorderResponse.php';
     $response = FBAInboundServiceMWS_Model_ConfirmPreorderResponse::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 Confirm Preorder Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as FBAInboundServiceMWS_Model_ConfirmPreorder
$request = new FBAInboundServiceMWS_Model_ConfirmPreorderRequest();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeConfirmPreorder($service, $request);
/**
 * Get Confirm Preorder 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_ConfirmPreorder or array of parameters
 */
function invokeConfirmPreorder(FBAInboundServiceMWS_Interface $service, $request)
{
    try {
        $response = $service->ConfirmPreorder($request);