├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── CREDITS
├── INSTALL.md
├── LICENSE
├── NOTICE
├── README.md
├── amazon-config.default.php
├── composer.json
├── environment.php
├── examples
├── feed_examples.php
├── inventory_examples.php
└── order_examples.php
├── includes
├── classes.php
├── classes
│ ├── AmazonCore.php
│ ├── AmazonFeed.php
│ ├── AmazonFeedList.php
│ ├── AmazonFeedResult.php
│ ├── AmazonFeedsCore.php
│ ├── AmazonFinanceCore.php
│ ├── AmazonFinancialEventList.php
│ ├── AmazonFinancialGroupList.php
│ ├── AmazonFulfillmentOrder.php
│ ├── AmazonFulfillmentOrderCreator.php
│ ├── AmazonFulfillmentOrderList.php
│ ├── AmazonFulfillmentPreview.php
│ ├── AmazonInboundCore.php
│ ├── AmazonInventoryCore.php
│ ├── AmazonInventoryList.php
│ ├── AmazonMerchantCore.php
│ ├── AmazonMerchantServiceList.php
│ ├── AmazonMerchantShipment.php
│ ├── AmazonMerchantShipmentCreator.php
│ ├── AmazonOrder.php
│ ├── AmazonOrderCore.php
│ ├── AmazonOrderItemList.php
│ ├── AmazonOrderList.php
│ ├── AmazonOrderSet.php
│ ├── AmazonOutboundCore.php
│ ├── AmazonPackageTracker.php
│ ├── AmazonParticipationList.php
│ ├── AmazonPreorder.php
│ ├── AmazonPrepInfo.php
│ ├── AmazonProduct.php
│ ├── AmazonProductFeeEstimate.php
│ ├── AmazonProductInfo.php
│ ├── AmazonProductList.php
│ ├── AmazonProductSearch.php
│ ├── AmazonProductsCore.php
│ ├── AmazonRecommendationCore.php
│ ├── AmazonRecommendationList.php
│ ├── AmazonReport.php
│ ├── AmazonReportAcknowledger.php
│ ├── AmazonReportList.php
│ ├── AmazonReportRequest.php
│ ├── AmazonReportRequestList.php
│ ├── AmazonReportScheduleList.php
│ ├── AmazonReportScheduleManager.php
│ ├── AmazonReportsCore.php
│ ├── AmazonSellersCore.php
│ ├── AmazonServiceStatus.php
│ ├── AmazonShipment.php
│ ├── AmazonShipmentItemList.php
│ ├── AmazonShipmentList.php
│ ├── AmazonShipmentPlanner.php
│ ├── AmazonSubscription.php
│ ├── AmazonSubscriptionCore.php
│ ├── AmazonSubscriptionDestinationList.php
│ ├── AmazonSubscriptionList.php
│ ├── AmazonTransport.php
│ └── AmazonTransportDocument.php
└── includes.php
├── mock
└── .gitignore
├── nbproject
├── project.properties
└── project.xml
└── test-cases
├── bootstrap.php
├── helperFunctions.php
├── includes
└── classes
│ ├── AmazonCoreTest.php
│ ├── AmazonFeedListTest.php
│ ├── AmazonFeedResultTest.php
│ ├── AmazonFeedTest.php
│ ├── AmazonFinancialEventListTest.php
│ ├── AmazonFinancialGroupListTest.php
│ ├── AmazonFulfillmentOrderCreatorTest.php
│ ├── AmazonFulfillmentOrderListTest.php
│ ├── AmazonFulfillmentOrderTest.php
│ ├── AmazonFulfillmentPreviewTest.php
│ ├── AmazonInventoryListTest.php
│ ├── AmazonMerchantServiceListTest.php
│ ├── AmazonMerchantShipmentTest.php
│ ├── AmazonOrderItemListTest.php
│ ├── AmazonOrderListTest.php
│ ├── AmazonOrderSetTest.php
│ ├── AmazonOrderTest.php
│ ├── AmazonPackageTrackerTest.php
│ ├── AmazonParticipationListTest.php
│ ├── AmazonPreorderTest.php
│ ├── AmazonPrepInfoTest.php
│ ├── AmazonProductFeeEstimateTest.php
│ ├── AmazonProductInfoTest.php
│ ├── AmazonProductListTest.php
│ ├── AmazonProductSearchTest.php
│ ├── AmazonProductTest.php
│ ├── AmazonRecommendationListTest.php
│ ├── AmazonReportAcknowledgerTest.php
│ ├── AmazonReportListTest.php
│ ├── AmazonReportRequestListTest.php
│ ├── AmazonReportRequestTest.php
│ ├── AmazonReportScheduleListTest.php
│ ├── AmazonReportScheduleManagerTest.php
│ ├── AmazonReportTest.php
│ ├── AmazonServiceStatusTest.php
│ ├── AmazonShipmentItemListTest.php
│ ├── AmazonShipmentListTest.php
│ ├── AmazonShipmentPlannerTest.php
│ ├── AmazonShipmentTest.php
│ ├── AmazonSubscriptionDestinationListTest.php
│ ├── AmazonSubscriptionListTest.php
│ ├── AmazonSubscriptionTest.php
│ ├── AmazonTransportDocumentTest.php
│ └── AmazonTransportTest.php
├── mock
├── acknowledgeReports.xml
├── cancelFeeds.xml
├── cancelRequests.xml
├── confirmPreorder.xml
├── confirmTransport.xml
├── countFeeds.xml
├── createMerchantShipment.xml
├── createShipment.xml
├── createSubscription.xml
├── deleteSubscription.xml
├── deregisterDestination.xml
├── estimateTransport.xml
├── fetchBillOfLading.xml
├── fetchCategories.xml
├── fetchCompetitivePricing.xml
├── fetchDestinations.xml
├── fetchEstimates.xml
├── fetchFeedResult.xml
├── fetchFeedSubmissions.xml
├── fetchFeedSubmissionsToken.xml
├── fetchFeedSubmissionsToken2.xml
├── fetchFinancialEvents.xml
├── fetchFinancialEventsToken.xml
├── fetchFinancialEventsToken2.xml
├── fetchFinancialGroups.xml
├── fetchFinancialGroupsToken.xml
├── fetchFinancialGroupsToken2.xml
├── fetchFulfillmentOrder.xml
├── fetchFulfillmentOrderList.xml
├── fetchFulfillmentOrderListToken.xml
├── fetchFulfillmentOrderListToken2.xml
├── fetchInventoryList.xml
├── fetchInventoryListToken.xml
├── fetchInventoryListToken2.xml
├── fetchLowestOffer.xml
├── fetchLowestPricedOffers.xml
├── fetchMerchantServiceList.xml
├── fetchMerchantShipment.xml
├── fetchMyPrice.xml
├── fetchOrder.xml
├── fetchOrderItems.xml
├── fetchOrderItemsToken.xml
├── fetchOrderItemsToken2.xml
├── fetchOrderList.xml
├── fetchOrderListToken.xml
├── fetchOrderListToken2.xml
├── fetchPackageLabels.xml
├── fetchPalletLabels.xml
├── fetchParticipationList.xml
├── fetchParticipationListToken.xml
├── fetchParticipationListToken2.xml
├── fetchPlan.xml
├── fetchPreorderInfo.xml
├── fetchPrepInstructionsAsin.xml
├── fetchPrepInstructionsSku.xml
├── fetchPreview.xml
├── fetchProductList.xml
├── fetchRecommendationTimes.xml
├── fetchRecommendations.xml
├── fetchRecommendationsToken.xml
├── fetchRecommendationsToken2.xml
├── fetchReport.xml
├── fetchReportCount.xml
├── fetchReportList.xml
├── fetchReportListToken.xml
├── fetchReportListToken2.xml
├── fetchReportRequestCount.xml
├── fetchReportRequestList.xml
├── fetchReportRequestListToken.xml
├── fetchReportRequestListToken2.xml
├── fetchReportScheduleCount.xml
├── fetchReportScheduleList.xml
├── fetchReportScheduleListToken.xml
├── fetchReportScheduleListToken2.xml
├── fetchServiceStatus.xml
├── fetchShipmentItems.xml
├── fetchShipmentItemsToken.xml
├── fetchShipmentItemsToken2.xml
├── fetchShipments.xml
├── fetchShipmentsToken.xml
├── fetchShipmentsToken2.xml
├── fetchSubscription.xml
├── fetchSubscriptionList.xml
├── fetchTrackingDetails.xml
├── fetchTransportContentLtlNonPartnered.xml
├── fetchTransportContentLtlPartnered.xml
├── fetchTransportContentSpNonPartnered.xml
├── fetchTransportContentSpPartnered.xml
├── manageReportSchedule.xml
├── pingDestination.xml
├── registerDestination.xml
├── requestReport.xml
├── saveFeed.xml
├── saveReport.xml
├── searchProducts.xml
├── sendTransportContents.xml
├── submitFeed.xml
├── updateShipment.xml
├── updateSubscription.xml
└── voidTransport.xml
├── phpunit.xml
└── test-config.php
/.gitignore:
--------------------------------------------------------------------------------
1 | /nbproject/private/
2 | amazon-config.php
3 | test.php
4 | log.txt
5 | /test-cases/log.txt
6 | composer.lock
7 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: php
2 | php:
3 | - 5.4
4 | - 5.5
5 | - 5.6
6 | - 7
7 | - 7.1
8 | - 7.2
9 |
10 | matrix:
11 | allow_failures:
12 | php: 7.1
13 | php: 7.2
14 |
15 | # install packages explicitly
16 | install:
17 | - composer self-update && composer install
18 |
19 | # show me what phpunit version we are running
20 | before_script:
21 | - vendor/bin/phpunit --version
22 |
23 | # run the test suite
24 | script: cd test-cases && php ../vendor/bin/phpunit --bootstrap bootstrap.php
25 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 | ##General
3 | All pull requests should target the master branch. Commits should not have different code changes mixed together and should have descriptive messages.
4 |
5 | ##Project Scope
6 | The goal of this project is to provide a library with which the average merchant can communicate with Amazon's MWS services without needing to learn the complex language of the API. When contributing, think about whether or not the contribution is something that the average Amazon merchant would need to intract with Amazon.
7 |
8 | Code for handling the merchant's data, such as for generating feeds or data crunching, falls outside of the library's intended scope and, while useful, is best left to separate projects.
9 |
10 | ##Code Guidelines
11 | The library is written using a custom style and does not follow any particular standard. For the sake of cohesion, changes to the code should be written in this same style. Please do not make changes to the style of the code.
12 |
13 | Any new changes should fit within the previously-mentioned goal of the project. New public methods and classes should have names that are easy to understand and use without needing to consult the API's documentation. Try to follow the trend of similar existing functions, such as how methods that send requests to get information from Amazon usually have names that start with "fetch."
14 |
15 | New methods should have phpdocs explaining how to use them and how they will affect the options sent in the next request. New classes should have phpdocs explaining their purpose and the workflow for using them. If the class is one that sends requests to Amazon, the documentation should indicate which Amazon actions it can perform and which of its methods are required before a request can be sent. Check the phpdocs on existing classes for examples.
16 |
--------------------------------------------------------------------------------
/CREDITS:
--------------------------------------------------------------------------------
1 | The phpAmazonMWS library was designed and written by Thomas Hernandez (peardian at gmail) for the CPI Group.
2 |
--------------------------------------------------------------------------------
/INSTALL.md:
--------------------------------------------------------------------------------
1 | ## Installing
2 | To install, simply add the library to your project. Composer is the default installation tool for this library.
3 | If you do not use Composer for your project, you can still auto-load classes by including the file **includes/classes.php** in the page or function.
4 |
5 | Before you use any commands, you need to create an **amazon-config.php** file with your account credentials. Start by copying the template provided (*amazon-config.default.php*) and renaming the file.
6 |
7 | If you are operating outside of the United States, be sure to change the Amazon Service URL to the one matching your region.
8 |
9 | You can also link the built-in logging system to your own system by putting the logging function's name in the *$logfunction* parameter.
10 |
11 | The default location for the built-in log file is in the library's main directory. In the event that PHP does not have the correct permissions to create a file in there, you will have to create the log file as "log.txt" and give PHP permission to edit it.
12 |
13 | ## Usage
14 | All of the technical details required by the API are handled behind the scenes,
15 | so users can easily build code for sending requests to Amazon
16 | without having to jump hurdles such as parameter URL formatting and token management.
17 | The general work flow for using one of the objects is this:
18 |
19 | 1. Create an object for the task you need to perform.
20 | 2. Load it up with parameters, depending on the object, using *set____* methods.
21 | 3. Submit the request to Amazon. The methods to do this are usually named *fetch____* or *submit____* and have no parameters.
22 | 4. Reference the returned data, whether as single values or in bulk, using *get____* methods.
23 | 5. Monitor the performance of the library using the built-in logging system.
24 |
25 | Note that if you want to act on more than one Amazon store, you will need a separate object for each store.
26 |
27 | Also note that the objects perform best when they are not treated as reusable. Otherwise, you may end up grabbing old response data if a new request fails.
28 |
29 | ## Examples
30 | Here is an example of a function used to get all warehouse-fulfilled orders from Amazon updated in the past 24 hours:
31 | ```php
32 | function getAmazonOrders() {
33 | $amz = new AmazonOrderList("myStore"); //store name matches the array key in the config file
34 | $amz->setLimits('Modified', "- 24 hours");
35 | $amz->setFulfillmentChannelFilter("MFN"); //no Amazon-fulfilled orders
36 | $amz->setOrderStatusFilter(
37 | array("Unshipped", "PartiallyShipped", "Canceled", "Unfulfillable")
38 | ); //no shipped or pending
39 | $amz->setUseToken(); //Amazon sends orders 100 at a time, but we want them all
40 | $amz->fetchOrders();
41 | return $amz->getList();
42 | }
43 | ```
44 | This example shows a function used to send a previously-created XML feed to Amazon to update Inventory numbers:
45 | ```php
46 | function sendInventoryFeed($feed) {
47 | $amz=new AmazonFeed(); //if there is only one store in config, it can be omitted
48 | $amz->setFeedType("_POST_INVENTORY_AVAILABILITY_DATA_"); //feed types listed in documentation
49 | $amz->setFeedContent($feed);
50 | $amz->submitFeed();
51 | return $amz->getResponse();
52 | }
53 | ```
54 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CPIGroup/phpAmazonMWS/bf594dcb60e3176ec69148e90bd9e618f41a85d3/NOTICE
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | phpAmazonMWS
2 | ============
3 |
4 | [](https://travis-ci.org/CPIGroup/phpAmazonMWS)
5 |
6 | A library to connect to Amazon's Merchant Web Services (MWS) in an object-oriented manner, with a focus on intuitive usage.
7 |
8 | This is __NOT__ for Amazon Web Services (AWS) - Cloud Computing Services.
9 |
10 |
11 | ## Example Usage
12 | Here are a couple of examples of the library in use.
13 | All of the technical details required by the API are handled behind the scenes,
14 | so users can easily build code for sending requests to Amazon
15 | without having to jump hurdles such as parameter URL formatting and token management.
16 |
17 | Here is an example of a function used to get all warehouse-fulfilled orders from Amazon updated in the past 24 hours:
18 | ```php
19 | function getAmazonOrders() {
20 | $amz = new AmazonOrderList("myStore"); //store name matches the array key in the config file
21 | $amz->setLimits('Modified', "- 24 hours");
22 | $amz->setFulfillmentChannelFilter("MFN"); //no Amazon-fulfilled orders
23 | $amz->setOrderStatusFilter(
24 | array("Unshipped", "PartiallyShipped", "Canceled", "Unfulfillable")
25 | ); //no shipped or pending
26 | $amz->setUseToken(); //Amazon sends orders 100 at a time, but we want them all
27 | $amz->fetchOrders();
28 | return $amz->getList();
29 | }
30 | ```
31 | This example shows a function used to send a previously-created XML feed to Amazon to update Inventory numbers:
32 | ```php
33 | function sendInventoryFeed($feed) {
34 | $amz=new AmazonFeed(); //if there is only one store in config, it can be omitted
35 | $amz->setFeedType("_POST_INVENTORY_AVAILABILITY_DATA_"); //feed types listed in documentation
36 | $amz->setFeedContent($feed);
37 | $amz->submitFeed();
38 | return $amz->getResponse();
39 | }
40 | ```
41 |
--------------------------------------------------------------------------------
/amazon-config.default.php:
--------------------------------------------------------------------------------
1 |
41 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cpigroup/php-amazon-mws",
3 | "type": "library",
4 | "description": "An open-source library to connect to Amazon's MWS web services in an object-oriented manner, with a focus on intuitive usage.",
5 | "license": "Apache-2.0",
6 | "keywords": [
7 | "API",
8 | "Amazon",
9 | "PHP"
10 | ],
11 | "require": {
12 | "php": ">=5.4",
13 | "ext-curl": "*"
14 | },
15 | "require-dev": {
16 | "phpunit/phpunit": ">=4.0.0, <6.0.0"
17 | },
18 | "autoload": {
19 | "classmap": [
20 | "includes/classes/"
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/environment.php:
--------------------------------------------------------------------------------
1 |
110 |
--------------------------------------------------------------------------------
/examples/feed_examples.php:
--------------------------------------------------------------------------------
1 | ';
10 | foreach ($list as $feed) {
11 | //these are arrays
12 | echo 'Feed ID: '.$feed['FeedSubmissionId'];
13 | echo ' Type: '.$feed['FeedType'];
14 | echo ' Date Sent: '.$feed['SubmittedDate'];
15 | echo ' Status: '.$feed['FeedProcessingStatus'];
16 | echo '
';
17 | }
18 | }
19 |
20 | /**
21 | * This function will retrieve a list of all items with quantity that was adjusted within the past 24 hours.
22 | * The entire list of items is returned, with each item contained in an array.
23 | * Note that this does not relay whether or not the feed had any errors.
24 | * To get this information, the feed's results must be retrieved.
25 | */
26 | function getAmazonFeedStatus(){
27 | require('../includes/classes.php'); //autoload classes, not needed if composer is being used
28 | try {
29 | $amz=new AmazonFeedList("myStore");
30 | $amz->setTimeLimits('- 24 hours'); //limit time frame for feeds to any updated since the given time
31 | $amz->setFeedStatuses(array("_SUBMITTED_", "_IN_PROGRESS_", "_DONE_")); //exclude cancelled feeds
32 | $amz->fetchFeedSubmissions(); //this is what actually sends the request
33 | return $amz->getFeedList();
34 | } catch (Exception $ex) {
35 | echo 'There was a problem with the Amazon library. Error: '.$ex->getMessage();
36 | }
37 | }
38 |
39 | /**
40 | * This function will send a provided Inventory feed to Amazon.
41 | * Amazon's response to the feed is returned as an array.
42 | * This function is not actively used on this example page as a safety precaution.
43 | */
44 | function sendInventoryFeed($feed) {
45 | try {
46 | $amz=new AmazonFeed(); //if there is only one store in config, it can be omitted
47 | $amz->setFeedType("_POST_INVENTORY_AVAILABILITY_DATA_"); //feed types listed in documentation
48 | $amz->setFeedContent($feed); //can be either XML or CSV data; a file upload method is available as well
49 | $amz->submitFeed(); //this is what actually sends the request
50 | return $amz->getResponse();
51 | } catch (Exception $ex) {
52 | echo 'There was a problem with the Amazon library. Error: '.$ex->getMessage();
53 | }
54 | }
55 |
56 | /**
57 | * This function will get the processing results of a feed previously sent to Amazon and give the data.
58 | * In order to do this, a feed ID is required. The response is in XML.
59 | */
60 | function getFeedResult($feedId) {
61 | try {
62 | $amz=new AmazonFeedResult("myStore", $feedId); //feed ID can be quickly set by passing it to the constructor
63 | $amz->setFeedId($feedId); //otherwise, it must be set this way
64 | $amz->fetchFeedResult();
65 | return $amz->getRawFeed();
66 | } catch (Exception $ex) {
67 | echo 'There was a problem with the Amazon library. Error: '.$ex->getMessage();
68 | }
69 | }
70 |
71 |
72 | ?>
73 |
--------------------------------------------------------------------------------
/examples/inventory_examples.php:
--------------------------------------------------------------------------------
1 | ';
10 | foreach ($list as $item) {
11 | //these are arrays
12 | echo 'Item SKU: '.$item['SellerSKU'];
13 | echo ' Condition: '.$item['Condition'];
14 | echo ' In Stock: '.$item['InStockSupplyQuantity'];
15 | echo '
';
16 | }
17 | }
18 |
19 | /**
20 | * This function will retrieve a list of all items with quantity that was adjusted within the past 24 hours.
21 | * The entire list of items is returned, with each item contained in an array.
22 | */
23 | function getAmazonSupply(){
24 | require('../includes/classes.php'); //autoload classes, not needed if composer is being used
25 | try {
26 | $obj = new AmazonInventoryList("myStore"); //store name matches the array key in the config file
27 | $obj->setUseToken(); //tells the object to automatically use tokens right away
28 | $obj->setStartTime("- 24 hours");
29 | $obj->fetchInventoryList(); //this is what actually sends the request
30 | return $obj->getSupply();
31 | } catch (Exception $ex) {
32 | echo 'There was a problem with the Amazon library. Error: '.$ex->getMessage();
33 | }
34 | }
35 |
36 |
37 | ?>
38 |
--------------------------------------------------------------------------------
/examples/order_examples.php:
--------------------------------------------------------------------------------
1 | ';
10 | foreach ($list as $order) {
11 | //these are AmazonOrder objects
12 | echo 'Order Number: '.$order->getAmazonOrderId();
13 | echo ' Purchase Date: '.$order->getPurchaseDate();
14 | echo ' Status: '.$order->getOrderStatus();
15 | echo ' Customer: '.$order->getBuyerName();
16 | $address=$order->getShippingAddress(); //address is an array
17 | echo ' City: '.$address['City'];
18 | echo '
';
19 | }
20 | }
21 |
22 | /**
23 | * This function will retrieve a list of all unshipped MFN orders made within the past 24 hours.
24 | * The entire list of orders is returned, with each order contained in an AmazonOrder object.
25 | * Note that the items in the order are not included in the data.
26 | * To get the order's items, the "fetchItems" method must be used by the specific order object.
27 | */
28 | function getAmazonOrders() {
29 | require('../includes/classes.php'); //autoload classes, not needed if composer is being used
30 | try {
31 | $amz = new AmazonOrderList("myStore"); //store name matches the array key in the config file
32 | $amz->setLimits('Modified', "- 24 hours"); //accepts either specific timestamps or relative times
33 | $amz->setFulfillmentChannelFilter("MFN"); //no Amazon-fulfilled orders
34 | $amz->setOrderStatusFilter(
35 | array("Unshipped", "PartiallyShipped", "Canceled", "Unfulfillable")
36 | ); //no shipped or pending orders
37 | $amz->setUseToken(); //tells the object to automatically use tokens right away
38 | $amz->fetchOrders(); //this is what actually sends the request
39 | return $amz->getList();
40 | } catch (Exception $ex) {
41 | echo 'There was a problem with the Amazon library. Error: '.$ex->getMessage();
42 | }
43 | }
44 |
45 | ?>
46 |
--------------------------------------------------------------------------------
/includes/classes.php:
--------------------------------------------------------------------------------
1 |
30 |
--------------------------------------------------------------------------------
/includes/classes/AmazonFeedsCore.php:
--------------------------------------------------------------------------------
1 | Name for the store you want to use.
34 | * This parameter is optional if only one store is defined in the config file.
35 | * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
36 | * This defaults to FALSE.
37 | * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
38 | * @param string $config [optional]
An alternate config file to set. Used for testing.
39 | */
40 | public function __construct($s = null, $mock = false, $m = null, $config = null){
41 | parent::__construct($s, $mock, $m, $config);
42 | include($this->env);
43 |
44 | $this->urlbranch = '';
45 | if(isset($AMAZON_VERSION_FEEDS)) {
46 | $this->options['Version'] = $AMAZON_VERSION_FEEDS;
47 | }
48 | }
49 | }
50 | ?>
51 |
--------------------------------------------------------------------------------
/includes/classes/AmazonFinanceCore.php:
--------------------------------------------------------------------------------
1 | Name for the store you want to use.
34 | * This parameter is optional if only one store is defined in the config file.
35 | * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
36 | * This defaults to FALSE.
37 | * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
38 | * @param string $config [optional]
An alternate config file to set. Used for testing.
39 | */
40 | public function __construct($s = null, $mock = false, $m = null, $config = null){
41 | parent::__construct($s, $mock, $m, $config);
42 | include($this->env);
43 |
44 | if(isset($AMAZON_VERSION_FINANCE)){
45 | $this->urlbranch = 'Finances/'.$AMAZON_VERSION_FINANCE;
46 | $this->options['Version'] = $AMAZON_VERSION_FINANCE;
47 | }
48 |
49 | if(isset($THROTTLE_LIMIT_FINANCE)) {
50 | $this->throttleLimit = $THROTTLE_LIMIT_FINANCE;
51 | }
52 | if(isset($THROTTLE_TIME_FINANCE)) {
53 | $this->throttleTime = $THROTTLE_TIME_FINANCE;
54 | }
55 | $this->throttleGroup = 'Finance';
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/includes/classes/AmazonInboundCore.php:
--------------------------------------------------------------------------------
1 | Name for the store you want to use.
34 | * This parameter is optional if only one store is defined in the config file.
35 | * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
36 | * This defaults to FALSE.
37 | * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
38 | * @param string $config [optional]
An alternate config file to set. Used for testing.
39 | */
40 | public function __construct($s = null, $mock = false, $m = null, $config = null){
41 | parent::__construct($s, $mock, $m, $config);
42 | include($this->env);
43 |
44 | if(isset($AMAZON_VERSION_INBOUND)){
45 | $this->urlbranch = 'FulfillmentInboundShipment/'.$AMAZON_VERSION_INBOUND;
46 | $this->options['Version'] = $AMAZON_VERSION_INBOUND;
47 | }
48 |
49 |
50 | if(isset($THROTTLE_LIMIT_INVENTORY)) {
51 | $this->throttleLimit = $THROTTLE_LIMIT_INVENTORY;
52 | }
53 | if(isset($THROTTLE_TIME_INVENTORY)) {
54 | $this->throttleTime = $THROTTLE_TIME_INVENTORY;
55 | }
56 | $this->throttleGroup = 'Inventory';
57 | }
58 | }
59 | ?>
60 |
--------------------------------------------------------------------------------
/includes/classes/AmazonInventoryCore.php:
--------------------------------------------------------------------------------
1 | Name for the store you want to use.
34 | * This parameter is optional if only one store is defined in the config file.
35 | * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
36 | * This defaults to FALSE.
37 | * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
38 | * @param string $config [optional]
An alternate config file to set. Used for testing.
39 | */
40 | public function __construct($s = null, $mock = false, $m = null, $config = null){
41 | parent::__construct($s, $mock, $m, $config);
42 | include($this->env);
43 |
44 | if(isset($AMAZON_VERSION_INVENTORY)){
45 | $this->urlbranch = 'FulfillmentInventory/'.$AMAZON_VERSION_INVENTORY;
46 | $this->options['Version'] = $AMAZON_VERSION_INVENTORY;
47 | }
48 |
49 | if(isset($THROTTLE_LIMIT_INVENTORY)) {
50 | $this->throttleLimit = $THROTTLE_LIMIT_INVENTORY;
51 | }
52 | if(isset($THROTTLE_TIME_INVENTORY)) {
53 | $this->throttleTime = $THROTTLE_TIME_INVENTORY;
54 | }
55 | $this->throttleGroup = 'Inventory';
56 | }
57 | }
58 | ?>
59 |
--------------------------------------------------------------------------------
/includes/classes/AmazonMerchantCore.php:
--------------------------------------------------------------------------------
1 | Name for the store you want to use.
34 | * This parameter is optional if only one store is defined in the config file.
35 | * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
36 | * This defaults to FALSE.
37 | * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
38 | * @param string $config [optional]
An alternate config file to set. Used for testing.
39 | */
40 | public function __construct($s = null, $mock = false, $m = null, $config = null){
41 | parent::__construct($s, $mock, $m, $config);
42 | include($this->env);
43 |
44 | if(isset($AMAZON_VERSION_MERCHANT)){
45 | $this->urlbranch = 'MerchantFulfillment/'.$AMAZON_VERSION_MERCHANT;
46 | $this->options['Version'] = $AMAZON_VERSION_MERCHANT;
47 | }
48 |
49 | if(isset($THROTTLE_LIMIT_MERCHANT)) {
50 | $this->throttleLimit = $THROTTLE_LIMIT_MERCHANT;
51 | }
52 | if(isset($THROTTLE_TIME_MERCHANT)) {
53 | $this->throttleTime = $THROTTLE_TIME_MERCHANT;
54 | }
55 | $this->throttleGroup = 'MerchantFulfillment';
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/includes/classes/AmazonOrderCore.php:
--------------------------------------------------------------------------------
1 | Name for the store you want to use.
34 | * This parameter is optional if only one store is defined in the config file.
35 | * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
36 | * This defaults to FALSE.
37 | * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
38 | * @param string $config [optional]
An alternate config file to set. Used for testing.
39 | */
40 | public function __construct($s = null, $mock = false, $m = null, $config = null){
41 | parent::__construct($s, $mock, $m, $config);
42 | include($this->env);
43 |
44 | if(isset($AMAZON_VERSION_ORDERS)){
45 | $this->urlbranch = 'Orders/'.$AMAZON_VERSION_ORDERS;
46 | $this->options['Version'] = $AMAZON_VERSION_ORDERS;
47 | }
48 | }
49 | }
50 | ?>
51 |
--------------------------------------------------------------------------------
/includes/classes/AmazonOutboundCore.php:
--------------------------------------------------------------------------------
1 | Name for the store you want to use.
34 | * This parameter is optional if only one store is defined in the config file.
35 | * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
36 | * This defaults to FALSE.
37 | * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
38 | * @param string $config [optional]
An alternate config file to set. Used for testing.
39 | */
40 | public function __construct($s = null, $mock = false, $m = null, $config = null){
41 | parent::__construct($s, $mock, $m, $config);
42 | include($this->env);
43 |
44 | if(isset($AMAZON_VERSION_OUTBOUND)){
45 | $this->urlbranch = 'FulfillmentOutboundShipment/'.$AMAZON_VERSION_OUTBOUND;
46 | $this->options['Version'] = $AMAZON_VERSION_OUTBOUND;
47 | }
48 |
49 |
50 | if(isset($THROTTLE_LIMIT_INVENTORY)) {
51 | $this->throttleLimit = $THROTTLE_LIMIT_INVENTORY;
52 | }
53 | if(isset($THROTTLE_TIME_INVENTORY)) {
54 | $this->throttleTime = $THROTTLE_TIME_INVENTORY;
55 | }
56 | $this->throttleGroup = 'Inventory';
57 | }
58 | }
59 | ?>
60 |
--------------------------------------------------------------------------------
/includes/classes/AmazonRecommendationCore.php:
--------------------------------------------------------------------------------
1 | Name for the store you want to use.
36 | * This parameter is optional if only one store is defined in the config file.
37 | * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
38 | * This defaults to FALSE.
39 | * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
40 | * @param string $config [optional]
An alternate config file to set. Used for testing.
41 | */
42 | public function __construct($s = null, $mock = false, $m = null, $config = null){
43 | parent::__construct($s, $mock, $m, $config);
44 | include($this->env);
45 | if (file_exists($this->config)){
46 | include($this->config);
47 | } else {
48 | throw new Exception('Config file does not exist!');
49 | }
50 |
51 | if (isset($AMAZON_VERSION_RECOMMEND)){
52 | $this->urlbranch = 'Recommendations/' . $AMAZON_VERSION_RECOMMEND;
53 | $this->options['Version'] = $AMAZON_VERSION_RECOMMEND;
54 | }
55 |
56 | if(isset($THROTTLE_LIMIT_RECOMMEND)) {
57 | $this->throttleLimit = $THROTTLE_LIMIT_RECOMMEND;
58 | }
59 | if(isset($THROTTLE_TIME_RECOMMEND)) {
60 | $this->throttleTime = $THROTTLE_TIME_RECOMMEND;
61 | }
62 |
63 | if (isset($store[$this->storeName]['marketplaceId'])){
64 | $this->setMarketplace($store[$this->storeName]['marketplaceId']);
65 | } else {
66 | $this->log("Marketplace ID is missing", 'Urgent');
67 | }
68 | }
69 |
70 | /**
71 | * Sets the marketplace associated with the recommendations. (Optional)
72 | *
73 | * The current store's configured marketplace is used by default.
74 | * @param string $m
Marketplace ID
75 | * @return boolean FALSE if improper input
76 | */
77 | public function setMarketplace($m){
78 | if (is_string($m)){
79 | $this->options['MarketplaceId'] = $m;
80 | } else {
81 | return false;
82 | }
83 | }
84 |
85 | }
86 |
87 |
--------------------------------------------------------------------------------
/includes/classes/AmazonReportsCore.php:
--------------------------------------------------------------------------------
1 | Name for the store you want to use.
34 | * This parameter is optional if only one store is defined in the config file.
35 | * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
36 | * This defaults to FALSE.
37 | * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
38 | * @param string $config [optional]
An alternate config file to set. Used for testing.
39 | */
40 | public function __construct($s = null, $mock = false, $m = null, $config = null){
41 | parent::__construct($s, $mock, $m, $config);
42 | include($this->env);
43 |
44 | $this->urlbranch = '';
45 | if(isset($AMAZON_VERSION_REPORTS)) {
46 | $this->options['Version'] = $AMAZON_VERSION_REPORTS;
47 | }
48 | }
49 | }
50 | ?>
51 |
--------------------------------------------------------------------------------
/includes/classes/AmazonSellersCore.php:
--------------------------------------------------------------------------------
1 | Name for the store you want to use.
34 | * This parameter is optional if only one store is defined in the config file.
35 | * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
36 | * This defaults to FALSE.
37 | * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
38 | * @param string $config [optional]
An alternate config file to set. Used for testing.
39 | */
40 | public function __construct($s = null, $mock = false, $m = null, $config = null){
41 | parent::__construct($s, $mock, $m, $config);
42 | include($this->env);
43 |
44 | if(isset($AMAZON_VERSION_SELLERS)){
45 | $this->urlbranch = 'Sellers/'.$AMAZON_VERSION_SELLERS;
46 | $this->options['Version'] = $AMAZON_VERSION_SELLERS;
47 | }
48 | }
49 | }
50 | ?>
51 |
--------------------------------------------------------------------------------
/includes/classes/AmazonSubscriptionCore.php:
--------------------------------------------------------------------------------
1 | Name for the store you want to use.
36 | * This parameter is optional if only one store is defined in the config file.
37 | * @param boolean $mock [optional]
This is a flag for enabling Mock Mode.
38 | * This defaults to FALSE.
39 | * @param array|string $m [optional]
The files (or file) to use in Mock Mode.
40 | * @param string $config [optional]
An alternate config file to set. Used for testing.
41 | */
42 | public function __construct($s = null, $mock = false, $m = null, $config = null){
43 | parent::__construct($s, $mock, $m, $config);
44 | include($this->env);
45 | if (file_exists($this->config)){
46 | include($this->config);
47 | } else {
48 | throw new Exception('Config file does not exist!');
49 | }
50 |
51 | if (isset($AMAZON_VERSION_SUBSCRIBE)){
52 | $this->urlbranch = 'Subscriptions/' . $AMAZON_VERSION_SUBSCRIBE;
53 | $this->options['Version'] = $AMAZON_VERSION_SUBSCRIBE;
54 | }
55 |
56 | if(isset($THROTTLE_LIMIT_SUBSCRIBE)) {
57 | $this->throttleLimit = $THROTTLE_LIMIT_SUBSCRIBE;
58 | }
59 | if(isset($THROTTLE_TIME_SUBSCRIBE)) {
60 | $this->throttleTime = $THROTTLE_TIME_SUBSCRIBE;
61 | }
62 |
63 | if (isset($store[$this->storeName]['marketplaceId'])){
64 | $this->setMarketplace($store[$this->storeName]['marketplaceId']);
65 | } else {
66 | $this->log("Marketplace ID is missing", 'Urgent');
67 | }
68 | }
69 |
70 | /**
71 | * Sets the marketplace associated with the subscription or destination. (Optional)
72 | *
73 | * The current store's configured marketplace is used by default.
74 | * @param string $m