caponica / amazon-paa-bundle
Symfony2 service to access the Amazon Product Advertising API
Installs: 1 014
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=5.3.2
- symfony/symfony: >=2.1
Requires (Dev)
- caponica/amazon-paa: dev-master
This package is auto-updated.
Last update: 2024-12-15 10:23:44 UTC
README
Amazon PAA integration via a Symfony service wrapper around caponica/amazon-paa.
Installation
Install using composer by adding the following in the require
section of your composer.json
file:
"require": { ... "caponica/amazon-paa-bundle": "dev-master" },
Register the bundle in your kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Caponica\AmazonPaaBundle\CaponicaAmazonPaaBundle(), ); }
Configuration
The bundle does not add a service to your project by default. To add the service, you will need to define the parameters and then the service itself.
To access multiple marketplaces, create multiple services (one for each marketplace). The simplest way to do this is with parameters (as shown below), but you can use any method you like to load the relevant configuration parameters and pass them to setConfig.
# app/config/parameters.yml caponica_amazon_paa_config_de: access_key: your_access_key_de secret_key: your_secret_key_de associate_tag: your_associate_tag_de domain_suffix: 'de' caponica_amazon_paa_config_uk: access_key: your_access_key_uk secret_key: your_secret_key_uk associate_tag: your_associate_tag_uk domain_suffix: 'co.uk'
# services.yml caponica_paa_client_de: class: %caponica_amazon_paa.client.class% factory: [ '%caponica_amazon_paa.client.class%', 'buildFromArray' ] arguments: [ '%caponica_amazon_paa_config_de%' ] caponica_paa_client_uk: class: %caponica_amazon_paa.client.class% factory: [ '%caponica_amazon_paa.client.class%', 'buildFromArray' ] arguments: [ '%caponica_amazon_paa_config_uk%' ]
Usage
To access the service, just reference it by the service name you defined above. E.g., from a controller:
/** @var CaponicaAmazonPaa\Client\ApaaClient $apaaClientUk */
$apaaClientUk = $this->container->get('caponica_paa_client_uk');
$itemLookupResponse = $apaaClientUk->callItemLookupFull('B009O3VLPW');