ZF2-293: Support multiple versions of AWS API
[Cloned from ZF-5434, originally posted by [~baxter]]
I think it would be a good idea to be able to specify the version you'd like to use. An example would be:
$amazon = new Zend\Service\Amazon('****','CA'); $amazon->setVersion('2008-08-19'); $results = $amazon->itemSearch(array( 'SearchIndex' => 'Jewelry', 'Keywords' => 'gold necklace', 'ResponseGroup' => 'Small,ItemAttributes,Images,SalesRank,Reviews,EditorialReview,Similarities,ListmaniaLists' ));
From taking a quick look through the only update I can see to the class would be the following:
adding the public function setVersion which would set $this->version in _prepareOptions check to see if this->version is set and if so update the query to include the Version parameter in _checkErrors update the namespace to 'http://webservices.amazon.com/AWSECommerceService/…->version
quoted from the amazon best practises:
"Amazon Associates Web Service makes frequent releases. Each release either adds functionality or increases the accuracy, speed, and stability of Amazon Associates Web Service. Most releases do both. Check http://aws.amazon.com/resources frequently for documentation about the latest release.
To use the latest version of the API, you must include the version parameter in your requests. Otherwise, Amazon Associates Web Service uses the default API version, which is from 2005-10-05"