diff --git a/includes/classes/AmazonCore.php b/includes/classes/AmazonCore.php index 705d1035..af0b8148 100644 --- a/includes/classes/AmazonCore.php +++ b/includes/classes/AmazonCore.php @@ -852,14 +852,11 @@ protected function _urlencode($value) { * @return string */ protected function _getParametersAsString(array $parameters) { -// $queryParameters = array(); -// foreach ($parameters as $key => $value) { -// $queryParameters[] = $key . '=' . $this->_urlencode($value); -// } -// return implode('&', $queryParameters); - - // We may as well use the input method! - return http_build_query($parameters); + $queryParameters = array(); + foreach ($parameters as $key => $value) { + $queryParameters[] = $key . '=' . $this->_urlencode($value); + } + return implode('&', $queryParameters); } /** @@ -927,4 +924,4 @@ protected function _sign($data, $key, $algorithm) // -- End Functions from Amazon -- -} \ No newline at end of file +} diff --git a/includes/classes/AmazonFeed.php b/includes/classes/AmazonFeed.php index f45e7e68..7ebee099 100644 --- a/includes/classes/AmazonFeed.php +++ b/includes/classes/AmazonFeed.php @@ -28,19 +28,19 @@ class AmazonFeed extends AmazonFeedsCore{ protected $response; protected $feedContent; protected $feedMD5; - + /** * AmazonFeed submits a Feed to Amazon. - * + * * The parameters are passed to the parent constructor, which are * in turn passed to the AmazonCore constructor. See it for more information * on these parameters and common methods. - * @param string $s [optional]
Name for the store you want to use. - * This parameter is optional if only one store is defined in the config file.
* @param boolean $mock [optional]This is a flag for enabling Mock Mode. * This defaults to FALSE.
* @param array|string $m [optional]The files (or file) to use in Mock Mode.
* @param string $config [optional]An alternate config file to set. Used for testing.
+ * @internal param string $s [optional]Name for the store you want to use. + * This parameter is optional if only one store is defined in the config file.
*/ public function __construct($s = null, $mock = false, $m = null, $config = null){ parent::__construct($s, $mock, $m, $config); @@ -293,16 +293,18 @@ protected function parseXML($xml){ $this->log("Successfully submitted feed #".$this->response['FeedSubmissionId'].' ('.$this->response['FeedType'].')'); } - + /** * Generates array for Header. - * + * * This method creates the Header array to use with cURL. It contains the Content MD5. * @return array */ protected function genHeader(){ - $return[0] = "Content-MD5:".$this->feedMD5; - return $return; + return [ + "Content-Type: text/xml", + "Content-MD5:" . $this->feedMD5, + ]; } /** @@ -325,7 +327,15 @@ public function getResponse(){ } } + /** + * + * Returns currently set feed content + * @return mixed + */ + public function getFeedContent(){ + return $this->feedContent; + } } -?> \ No newline at end of file +?> diff --git a/includes/classes/AmazonShipmentItemList.php b/includes/classes/AmazonShipmentItemList.php index 58f5de37..e7ce7d9a 100644 --- a/includes/classes/AmazonShipmentItemList.php +++ b/includes/classes/AmazonShipmentItemList.php @@ -155,8 +155,10 @@ public function resetTimeLimits(){ * @return boolean FALSE if something goes wrong */ public function fetchItems($r = true){ - if (!array_key_exists('ShipmentId', $this->options)){ - $this->log("Shipment ID must be set before requesting items!",'Warning'); + if (!array_key_exists('ShipmentId', $this->options) + && (!array_key_exists('LastUpdatedAfter', $this->options) && !array_key_exists('LastUpdatedBefore', $this->options)) + ) { + $this->log("Shipment ID or time constraints must be set before requesting items!", 'Warning'); return false; }