Пример #1
0
 /**
  * Get Service Status
  * Gets the status of the service.
  *     Status is one of GREEN, RED representing:
  *     GREEN: The service section is operating normally.
  *     RED: The service section disruption.
  *
  * @param mixed $request array of parameters for FBAInventoryServiceMWS_Model_GetServiceStatus request or FBAInventoryServiceMWS_Model_GetServiceStatus object itself
  * @see FBAInventoryServiceMWS_Model_GetServiceStatusRequest
  * @return FBAInventoryServiceMWS_Model_GetServiceStatusResponse
  *
  * @throws FBAInventoryServiceMWS_Exception
  */
 public function getServiceStatus($request)
 {
     if (!$request instanceof FBAInventoryServiceMWS_Model_GetServiceStatusRequest) {
         $request = new FBAInventoryServiceMWS_Model_GetServiceStatusRequest($request);
     }
     $parameters = $request->toQueryParameterArray();
     $parameters['Action'] = 'GetServiceStatus';
     $httpResponse = $this->_invoke($parameters);
     $response = FBAInventoryServiceMWS_Model_GetServiceStatusResponse::fromXML($httpResponse['ResponseBody']);
     $response->setResponseHeaderMetadata($httpResponse['ResponseHeaderMetadata']);
     return $response;
 }
Пример #2
0
 * Uncomment to try out Mock Service that simulates FBAInventoryServiceMWS
 * responses without calling FBAInventoryServiceMWS service.
 *
 * Responses are loaded from local XML files. You can tweak XML files to
 * experiment with various outputs during development
 *
 * XML files available under FBAInventoryServiceMWS/Mock tree
 *
 ***********************************************************************/
// $service = new FBAInventoryServiceMWS_Mock();
/************************************************************************
 * Setup request parameters and uncomment invoke to try out
 * sample for Get Service Status Action
 ***********************************************************************/
// @TODO: set request. Action can be passed as FBAInventoryServiceMWS_Model_GetServiceStatus
$request = new FBAInventoryServiceMWS_Model_GetServiceStatusRequest();
$request->setSellerId(MERCHANT_ID);
// object or array of parameters
invokeGetServiceStatus($service, $request);
/**
 * Get Get Service Status Action Sample
 * Gets competitive pricing and related information for a product identified by
 * the MarketplaceId and ASIN.
 *
 * @param FBAInventoryServiceMWS_Interface $service instance of FBAInventoryServiceMWS_Interface
 * @param mixed $request FBAInventoryServiceMWS_Model_GetServiceStatus or array of parameters
 */
function invokeGetServiceStatus(FBAInventoryServiceMWS_Interface $service, $request)
{
    try {
        $response = $service->GetServiceStatus($request);
function GetServiceStatusInventory()
{
    AmzFBA_Woo_Log("DEBUG", "Inventory", __FUNCTION__, "Entering");
    $UserSettings = get_option('woocommerce_amazonfba_settings');
    $ChosenMarketplace = $UserSettings['AmzFBA_Marketplace'];
    $MWSEndpointURL = GetMWSEndpointURL("FulfillmentInventory", $ChosenMarketplace);
    $config = array('ServiceURL' => $MWSEndpointURL, 'ProxyHost' => null, 'ProxyPort' => -1, 'MaxErrorRetry' => 3);
    $service = new FBAInventoryServiceMWS_Client(ACCESS_KEY_ID, SECRET_ACCESS_KEY, $config, APPLICATION_NAME, APPLICATION_VERSION);
    $request = new FBAInventoryServiceMWS_Model_GetServiceStatusRequest();
    $request->setSellerId(SELLER_ID);
    $returnmessage = invokeGetServiceStatusInventory($service, $request);
    AmzFBA_Woo_Log("DEBUG", "Inventory", __FUNCTION__, "Exiting");
    return $returnmessage;
}