Downloads
Stars
Version
This is a wrapper for the rossjcooper/paapiphpsdk package and gives the user a Service Container binding and facade a configured instance of the Amazon\ProductAdvertisingAPI\v1\com\amazon\paapi5\v1\api\DefaultApi
class.
composer require rossjcooper/laravel-amazon-products
config/app.php
file:
Rossjcooper\LaravelAmazonProducts\ServiceProvider::class
to your providers array in config/app.php
.'AmazonProductsAPI' => Rossjcooper\LaravelAmazonProducts\Facades\API::class
to your aliases array in config/app.php
.php artisan vendor:publish --provider="Rossjcooper\LaravelAmazonProducts\ServiceProvider" --tag="config"
will create a config/amazon_products.php
file..env
file:AMAZON_PRODUCTS_ACCESS_KEY=youAccessKey
AMAZON_PRODUCTS_PRIVATE_KEY=youPrivateKey
config/amazon_products.php
file.public function handle(\Rossjcooper\LaravelAmazonProducts\API $api)
{
$request = new SearchItemsRequest();
$request->setSearchIndex('All');
$request->setKeywords('Harry Potter');
$request->setResources([
SearchItemsResource::ITEM_INFOTITLE,
SearchItemsResource::OFFERSLISTINGSPRICE,
]);
$request->setPartnerTag(config('mypartnertag'));
$request->setPartnerType(config('Associates'));
$response = $api->searchItems($request);
foreach($response->getSearchResult()->getItems() as $item) {
//...
}
}
For more info on using the actual SDK see the main repo rossjcooper/paapiphpsdk
We're using the brilliant Orchestra Testbench v4 to run unit tests in a Laravel based environment.
Please only report issues relating to the Laravel side of things here, main API issues should be reported here