Package Data | |
---|---|
Maintainer Username: | IreIsaac |
Maintainer Contact: | isaac.r.enderline@gmail.com (isaac) |
Package Create Date: | 2015-09-12 |
Package Last Update: | 2016-02-03 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-12 15:02:13 |
Package Statistics | |
---|---|
Total Downloads: | 283 |
Monthly Downloads: | 1 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 1 |
Total Forks: | 4 |
Total Open Issues: | 1 |
package to help simplify requests to MWS. Heavily relys on GuzzleHttp.
Make sure to add the .env file in the root of your project, or add to your .env file, the following lines. There is also .env.example file included.
MWS_SELLER_ID=
MWS_MARKETPLACE_ID=
MWS_DEVELOPER_ACCOUNT_NUMBER=
MWS_SECRET_KEY=
MWS_SIGNATURE_METHOD=
MWS_SIGNATURE_VERSION=
AWS_ACCESS_KEY_ID=
composer require ireisaac\mws
// in your config/app.php
'providers' => [
...
IreIsaac\Mws\Support\MwsServiceProvider::class,
],
'aliases' => [
...
'Mws' => IreIsaac\Mws\Support\MwsFacade::class,
],
after adding the service provider, in the root of your laravel project run:
php artisan vendor:publish
The goal is to be able to call any MWS operation as a static method and pass any query params needed/wanted as an associative array.
use Mws;
use Carbon\Carbon;
public function search($query)
{
$response = Mws::listMatchingProducts(['Query' => $query]);
return $response->xml();
}
public function orders()
{
// Orders from the last week
$response = Mws::ListOrders([
'CreatedAfter' => Carbon::now()->subWeek()->toIso8601String()
]);
return $response->xml();
}
Notice you can call operations formatted with the first letter capitalized (studly case), or lowercase (snake case).