A simple wrapper for https://github.com/Exeu/apai-io Amazon Product Advertising API.
Add to composer.json:
{
"require": {
"rootman/simpleapa": "~1.0"
}
}
Fire up composer:
$ composer install
Register the Serviceprovider.
Publish the config:
$ php artisan vendor:publish
Fill the config.
use ApaiIO\ApaiIO;
use ApaiIO\Configuration\GenericConfiguration;
$conf = new GenericConfiguration();
$conf
->setCountry('de')
->setAccessKey('AMAZON ACCESS KEY')
->setSecretKey('AMAZON SECRET KEY')
->setAssociateTag('AMAZON ASSOCIATE TAG')
->setRequest('\ApaiIO\Request\Soap\Request')
->setResponseTransformer('\ApaiIO\ResponseTransformer\ObjectToArray');
$apa = SimpleAPA(new ApaiIO($conf));
$apa->bestPrice('B004BM3M6W');
$apa = App::make('SimpleAPA'); // don't actually use it like that, better inject it
$apa->bestPrice('B004BM3M6W');
$apa = App::make('SimpleAPA');
return Cache::remember('asin_B000OG4YNE', 60*24, function() use ($apa) {
return $apa->bestPrice('B000OG4YNE');
});