Skip to content

Commit 79bd297

Browse files
committed
Added support for MWSAuthToken
1 parent 95df1b8 commit 79bd297

File tree

4 files changed

+7
-69
lines changed

4 files changed

+7
-69
lines changed

amazon-config.default.php

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
$store['YourAmazonStore']['keyId'] = ''; //Access Key ID
2323
$store['YourAmazonStore']['secretKey'] = ''; //Secret Access Key for this store
2424
$store['YourAmazonStore']['serviceUrl'] = ''; //optional override for Service URL
25+
$store['YourAmazonStore']['MWSAuthToken'] = ''; //token needed for web apps and third-party developers
2526

2627
//Service URL Base
2728
//Current setting is United States

includes/classes/AmazonCore.php

+3
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,9 @@ public function setStore($s=null){
431431
if (!empty($store[$s]['serviceUrl'])) {
432432
$this->urlbase = $store[$s]['serviceUrl'];
433433
}
434+
if (!empty($store[$s]['MWSAuthToken'])) {
435+
$this->options['MWSAuthToken'] = $store[$s]['MWSAuthToken'];
436+
}
434437

435438
} else {
436439
$this->log("Store $s does not exist!",'Warning');

test-cases/includes/classes/AmazonCoreTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public function testGetOptions(){
9898
$this->assertInternalType('array',$o);
9999
$this->assertArrayHasKey('SellerId',$o);
100100
$this->assertArrayHasKey('AWSAccessKeyId',$o);
101+
$this->assertArrayHasKey('MWSAuthToken',$o);
101102
$this->assertArrayHasKey('SignatureVersion',$o);
102103
$this->assertArrayHasKey('SignatureMethod',$o);
103104
$this->assertArrayHasKey('Version',$o);

test-cases/test-config.php

+2-69
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
$store['testStore']['keyId'] = 'key';
99
//Secret Accress Key for this store
1010
$store['testStore']['secretKey'] = 'secret';
11+
//token needed for web apps and third-party developers
12+
$store['testStore']['MWSAuthToken'] = 'secret';
1113

1214
//Fake store
1315
$store['bad']['no'] = 'no';
@@ -16,21 +18,6 @@
1618
//Current setting is United States
1719
$AMAZON_SERVICE_URL = 'https://mws.amazonservices.com/';
1820

19-
//for User-Agent header(?)
20-
$AMAZON_APPLICATION = 'phpAmazonMWS';
21-
$AMAZON_APPVERSION = '1.0';
22-
23-
24-
//Version numbers for cores
25-
$AMAZON_VERSION_FEEDS = '2009-01-01';
26-
$AMAZON_VERSION_INBOUND = '2010-10-01';
27-
$AMAZON_VERSION_INVENTORY = '2010-10-01';
28-
$AMAZON_VERSION_ORDERS = '2011-01-01';
29-
$AMAZON_VERSION_OUTBOUND = '2010-10-01';
30-
$AMAZON_VERSION_PRODUCTS = '2011-10-01';
31-
$AMAZON_VERSION_REPORTS = '2009-01-01';
32-
$AMAZON_VERSION_SELLERS = '2011-07-01';
33-
3421
//Location of log file to use
3522
$logpath = __DIR__.'/log.txt';
3623

@@ -40,58 +27,4 @@
4027
//Turn off normal logging
4128
$muteLog = false;
4229

43-
//Amazon Throttle Values in seconds
44-
//Do not modify unless Amazon changes the values
45-
//Fetching Orders
46-
$THROTTLE_LIMIT_ORDER = 6;
47-
$THROTTLE_TIME_ORDER = 60;
48-
//Fetching Order Lists
49-
$THROTTLE_LIMIT_ORDERLIST = 6;
50-
$THROTTLE_TIME_ORDERLIST = 60;
51-
//Fetching Items
52-
$THROTTLE_LIMIT_ITEM = 30;
53-
$THROTTLE_TIME_ITEM = 2;
54-
//Fetching Service Status
55-
$THROTTLE_LIMIT_STATUS = 2;
56-
$THROTTLE_TIME_STATUS = 300;
57-
//Fetching Sellers Participation
58-
$THROTTLE_LIMIT_SELLERS = 15;
59-
$THROTTLE_TIME_SELLERS = 60;
60-
//Anything in Inbound/Inventory/Outbound
61-
$THROTTLE_TIME_INVENTORY = 30;
62-
$THROTTLE_TIME_INVENTORY = 2;
63-
//Products
64-
$THROTTLE_LIMIT_PRODUCT = 20;
65-
$THROTTLE_TIME_PRODUCTLIST = 5;
66-
$THROTTLE_TIME_PRODUCTMATCH = 1;
67-
$THROTTLE_TIME_PRODUCTID = 4;
68-
$THROTTLE_TIME_PRODUCTPRICE = 2;
69-
//Requesting a Report
70-
$THROTTLE_LIMIT_REPORTREQUEST = 15;
71-
$THROTTLE_TIME_REPORTREQUEST = 60;
72-
//Fetching a Report Request List
73-
$THROTTLE_LIMIT_REPORTREQUESTLIST = 10;
74-
$THROTTLE_TIME_REPORTREQUESTLIST = 45;
75-
//Using a token with a report request
76-
$THROTTLE_LIMIT_REPORTTOKEN = 30;
77-
$THROTTLE_TIME_REPORTTOKEN = 2;
78-
//Fetching a Report List
79-
$THROTTLE_LIMIT_REPORTLIST = 10;
80-
$THROTTLE_TIME_REPORTLIST = 60;
81-
//Fetching a Report
82-
$THROTTLE_LIMIT_REPORT = 15;
83-
$THROTTLE_TIME_REPORT = 60;
84-
//Fetching a Report Request List
85-
$THROTTLE_LIMIT_REPORTSCHEDULE = 10;
86-
$THROTTLE_TIME_REPORTSCHEDULE = 45;
87-
//Submitting a Feed
88-
$THROTTLE_TIME_FEEDSUBMIT = 15;
89-
$THROTTLE_TIME_FEEDSUBMIT = 120;
90-
//Getting a Feed
91-
$THROTTLE_LIMIT_FEEDLIST = 10;
92-
$THROTTLE_TIME_FEEDLIST = 45;
93-
//Getting a Feed
94-
$THROTTLE_LIMIT_FEEDRESULT = 15;
95-
$THROTTLE_TIME_FEEDRESULT = 60;
96-
9730
?>

0 commit comments

Comments
 (0)