vhqtvn / amazon-mws-psr4
Amazon MWS rebuild
dev-master
2018-03-20 12:41 UTC
Requires
- php: ^7.0
Requires (Dev)
- kevinlebrun/colors.php: ^1.0
- nikic/php-parser: ^3.1.4
This package is not auto-updated.
Last update: 2025-03-30 07:44:12 UTC
README
Amazon Marketplace Webservice SDKs in PSR4.
Install using composer:
composer require vhqtvn/amazon-mws-psr4
Example usage:
try { $service = new MarketplaceWebServiceOrdersClient( AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, APP_NAME, APP_VERSION, [ 'ServiceURL' => "https://mws.amazonservices.com/Orders/" . MarketplaceWebServiceOrdersClient::SERVICE_VERSION, ] ); $request = new MarketplaceWebServiceOrdersModelListOrdersRequest(); $request->setSellerId($client->MERCHANT_ID); $request->setMarketplaceId($client->MARKETPLACE_ID); $request->setCreatedAfter(Carbon::now()->modify('-1 day')->toIso8601String()); $response = $service->ListOrders($request); foreach ($response->ListOrdersResult->Orders as $order) { echo "============================================\n"; echo "= Order $order->AmazonOrderId\n"; echo "= Customer Email $order->BuyerEmail\n"; echo "= Customer Name $order->BuyerName\n"; } } catch (MarketplaceWebServiceOrdersException $ex) { echo("Caught Exception: " . $ex->getMessage() . "\n"); echo("Response Status Code: " . $ex->getStatusCode() . "\n"); echo("Error Code: " . $ex->getErrorCode() . "\n"); echo("Error Type: " . $ex->getErrorType() . "\n"); echo("Request ID: " . $ex->getRequestId() . "\n"); echo("XML: " . $ex->getXML() . "\n"); echo("ResponseHeaderMetadata: " . $ex->getResponseHeaderMetadata() . "\n"); } catch (\Exception $ex) { }