/** * This function will retrieve a list of all items with quantity that was adjusted within the past 24 hours. * The entire list of items is returned, with each item contained in an array. * Note that this does not relay whether or not the feed had any errors. * To get this information, the feed's results must be retrieved. */ function getAmazonFeedStatus() { require '../includes/classes.php'; //autoload classes, not needed if composer is being used try { $amz = new AmazonFeedList("myStore"); $amz->setTimeLimits('- 24 hours'); //limit time frame for feeds to any updated since the given time $amz->setFeedStatuses(array("_SUBMITTED_", "_IN_PROGRESS_", "_DONE_")); //exclude cancelled feeds $amz->fetchFeedSubmissions(); //this is what actually sends the request return $amz->getFeedList(); } catch (Exception $ex) { echo 'There was a problem with the Amazon library. Error: ' . $ex->getMessage(); } }
public function testCancelFeeds() { resetLog(); $this->object->setMock(true, 'cancelFeeds.xml'); $this->assertFalse($this->object->getFeedCount()); //not fetched yet $ok = $this->object->cancelFeeds(); $this->assertNull($ok); $check = parseLog(); $this->assertEquals('Single Mock File set: cancelFeeds.xml', $check[1]); $this->assertEquals('Fetched Mock File: mock/cancelFeeds.xml', $check[2]); $this->assertEquals('Successfully cancelled 1 report requests.', $check[3]); $o = $this->object->getOptions(); $this->assertEquals('CancelFeedSubmissions', $o['Action']); $count = $this->object->getFeedCount(); $this->assertEquals('1', $count); }