@@ -19,6 +19,7 @@ class MWSClient
1919 protected $ sellerId ;
2020 protected $ client ;
2121 protected $ marketPlaces ;
22+ protected $ mwsAuthToken ;
2223
2324 protected $ marketplaceIds = [
2425 'A2Q3Y263D00KWC ' => 'mws.amazonservices.com ' ,
@@ -38,7 +39,7 @@ class MWSClient
3839 'A19VAU5U5O7RUS ' => 'mws-fe.amazonservices.com ' ,
3940 'A39IBJ37TRP1C6 ' => 'mws.amazonservices.com.au ' ,
4041 'A1VC38T7YXB528 ' => 'mws.amazonservices.jp ' ,
41- 'A1805IZSGTT6HS ' => 'mws-eu.amazonservices.com '
42+ 'A1805IZSGTT6HS ' => 'mws-eu.amazonservices.com ' ,
4243 ];
4344
4445 protected $ countries = [
@@ -67,6 +68,7 @@ public function __construct(Client $client = null)
6768 $ this ->accessKeyId = config ('amazon-mws.access_key_id ' );
6869 $ this ->secretKey = config ('amazon-mws.secret_key ' );
6970 $ this ->sellerId = config ('amazon-mws.seller_id ' );
71+ $ this ->mwsAuthToken = config ('amazon-mws.mws_auth_token ' );
7072 $ this ->marketPlaces = ['DE ' ];
7173 $ this ->client = $ client ?: new Client (['timeout ' => 60 ]);
7274 }
@@ -111,6 +113,11 @@ public function setSellerId($id)
111113 return $ this ;
112114 }
113115
116+ public function getMWSAuthToken ()
117+ {
118+ return $ this ->mwsAuthToken ;
119+ }
120+
114121 public function getSignatureMethod ()
115122 {
116123 return self ::SIGNATURE_METHOD ;
@@ -175,7 +182,6 @@ public function post($action, $path, $version, $params = [], $body = null)
175182 $ response = $ this ->client ->post ($ uri , $ requestOptions );
176183 $ xmlResponse = simplexml_load_string ($ response ->getBody ()->getContents ());
177184 $ json = json_encode ($ xmlResponse );
178-
179185 return json_decode ($ json , true );
180186 }
181187
@@ -186,6 +192,7 @@ public function getDefaultQueryParams($action, $version, $params = [])
186192 'Timestamp ' => $ this ->getTimeStamp (),
187193 'AWSAccessKeyId ' => $ this ->getAccessKeyId (),
188194 'SellerId ' => $ this ->getSellerId (),
195+ 'MWSAuthToken ' => $ this ->getMWSAuthToken (),
189196 'SignatureMethod ' => $ this ->getSignatureMethod (),
190197 'SignatureVersion ' => $ this ->getSignatureVersion (),
191198 'Version ' => $ version ,
0 commit comments