Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions includes/classes/AmazonCore.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -927,4 +924,4 @@ protected function _sign($data, $key, $algorithm)

// -- End Functions from Amazon --

}
}
28 changes: 19 additions & 9 deletions includes/classes/AmazonFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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] <p>Name for the store you want to use.
* This parameter is optional if only one store is defined in the config file.</p>
* @param boolean $mock [optional] <p>This is a flag for enabling Mock Mode.
* This defaults to <b>FALSE</b>.</p>
* @param array|string $m [optional] <p>The files (or file) to use in Mock Mode.</p>
* @param string $config [optional] <p>An alternate config file to set. Used for testing.</p>
* @internal param string $s [optional] <p>Name for the store you want to use.
* This parameter is optional if only one store is defined in the config file.</p>
*/
public function __construct($s = null, $mock = false, $m = null, $config = null){
parent::__construct($s, $mock, $m, $config);
Expand Down Expand Up @@ -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,
];
}

/**
Expand All @@ -325,7 +327,15 @@ public function getResponse(){
}
}

/**
*
* Returns currently set feed content
* @return mixed
*/
public function getFeedContent(){
return $this->feedContent;
}


}
?>
?>
6 changes: 4 additions & 2 deletions includes/classes/AmazonShipmentItemList.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,10 @@ public function resetTimeLimits(){
* @return boolean <b>FALSE</b> 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;
}

Expand Down