Пример #1
0
 * 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);
        echo "Service Response\n";
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;
}