caponica / amazonmwscomplete Goto Github PK
View Code? Open in Web Editor NEWName-spaced wrappers for the full set of Amazon MWS client libraries
Name-spaced wrappers for the full set of Amazon MWS client libraries
AmazonMwsComplete/src/AmazonPhpClientLibrary/MarketplaceWebServiceOrders/Model/ResponseHeaderMetadata.php
caponica/amazon-mws-complete/src/AmazonPhpClientLibrary/MarketplaceWebService/Model/ContentType.php:67
Hello,
I have an error with callListOrdersByCreateDate method. When I call it gives me an error 'No Non-Amazon marketplace id known for site code "TR"'. I try to fix and, When I change the value in MwsClientPoolConfig/getNonAmazonMarketplaceIds function. It works. Can you add this please?
MwsCilentPoolConfig.php line 211
I am call submitFeed in MwsFeedAndReportClient and add to request array 'FeedContent' => ['SKU' => $ sku],
.
And I get the answer "Missing stream resource.", Why does this happen? He expects a file from me? Here's the data that I'm passing [ 'MarketplaceId', 'SellerId', 'MWSAuthToken', 'FeedContent' => ['SKU' => $sku], 'FeedType' => '_POST_PRODUCT_DATA_', 'OperationType' => 'Delete', ]
Hello,
The Amazon will come Turkey. Their endpoints is mws.services.amazon.com.tr . Cand you add this config your ClientPoolConfig please.
Regards,
When using this library in a Symfony controller for example.
All the echo
debug functions will mess up the response and output buffer especially if you're expecting a simple JSON response.
e.g.
I'd recommend using a simple Psr\Log\LoggerInterface
or Monolog
to handle all your logging or at least provide the ability to disable logs.
Hi, I want to set MWS Auth token, but it's not present in any config constants or like anywhere, except for original client libraries. Is it possible to set it somehow or I'm missing something?
Hello Caponica,
First, thank you for your great work on this Bundle, it help me a lot.
At the moment i have no problem on the first part of my work (Get better price of products ), but now i start to try push a product on Amazon with callSubmitFeed() and i have this error "Parameter must be an array or an object that implements Countable".
You can show my code below:
`$mwsClientPoolUsa = new MwsClientPool();
$mwsClientPoolUsa->setConfig([
'amazon_site' => MwsClientPoolConfig::SITE_FRANCE,
'access_key' => 'my_access_key',
'secret_key' => 'my_secret_key',
'application_name' => 'testAmazon',
'application_version' => '1.01',
'seller_id' => 'my_seller_id',
]);
$productClientPackUsa = $mwsClientPoolUsa->getFeedAndReportClientPack();
$feed = <<<EOD
$feedHandle = @fopen('php://temp', 'rw+');
fwrite($feedHandle, $feed);
rewind($feedHandle);
$productClientPackUsa->callSubmitFeed('_POST_PRODUCT_DATA_', $feedHandle);
@fclose($feedHandle);`
Can you help me a little bit ?
Thank you.
It seems like the callRequestReport doesn't accept startDate so every request defaults to now() pretty much which doesn't generate any records in the report.
This returns null for most of the time for me. I replaced it with:
$searchResponse->toXML() and it works.
This is the best mws sdk I've seen.
My question is that, If I use "CaponicaAmazonMwsComplete\ClientPool\MwsClientPool" , how to create "FbaInboundClient".
It seems that there is no FbaInboundClientPack in "CaponicaAmazonMwsComplete\ClientPack".
In Methods "getDefaultCurlOptions" and "configureCurlOptions" there are constant which aren't defined:
CURLOPT_POST, CURLOPT_USERAGENT, CURLOPT_PROXY ...
Hi,
I'm getting this error for SubmitFeed request. I suspect this could be because of PHP versions. Any idea how to solve this?
Symfony\Component\Debug\Exception\ContextErrorException: Warning: count(): Parameter must be an array or an object that implements Countable in /home/roopak/Desktop/p5/vendor/caponica/amazon-mws-complete/src/AmazonPhpClientLibrary/MarketplaceWebService/Model/ContentType.php:67
Stack trace:
#0 /home/roopak/Desktop/p5/vendor/caponica/amazon-mws-complete/src/AmazonPhpClientLibrary/MarketplaceWebService/Model/ContentType.php(73): MarketplaceWebService_Model_ContentType->isSetParameters()
#1 /home/roopak/Desktop/p5/vendor/caponica/amazon-mws-complete/src/AmazonPhpClientLibrary/MarketplaceWebService/Client.php(1452): MarketplaceWebService_Model_ContentType->toString()
#2 /home/roopak/Desktop/p5/vendor/caponica/amazon-mws-complete/src/AmazonPhpClientLibrary/MarketplaceWebService/Client.php(379): MarketplaceWebService_Client->convertSubmitFeed(Object(MarketplaceWebService_Model_SubmitFeedRequest))
#3 /home/roopak/Desktop/p5/vendor/caponica/amazon-mws-complete/src/CaponicaAmazonMwsComplete/ClientPack/MwsFeedAndReportC
My code is like below.
$feedHandle = @fopen('/home/roopak/Desktop/p5/web/uploads/documents/' . $file_name, 'r');
$fileOpnenSuccess = true;
if (! $feedHandle) {
$fileOpnenSuccess = false;
}
if ($fileOpnenSuccess) {
$mwsClientPoolIN = new MwsClientPool();
$mwsClientPoolIN->setConfig([
MwsClientPoolConfig::PARAM_AMAZON_SITE => MwsClientPoolConfig::SITE_INDIA,
MwsClientPoolConfig::PARAM_ACCESS_KEY => 'AKIAJKGPNP5IM7Y3W5FA',
MwsClientPoolConfig::PARAM_SECRET_KEY => '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',
MwsClientPoolConfig::PARAM_APP_NAME => 'pimcore',
MwsClientPoolConfig::PARAM_APP_VERSION => '1',
MwsClientPoolConfig::PARAM_SELLER_ID => 'AKW0X0EX07WGD'
]);
$productClientPackIN = $mwsClientPoolIN->getFeedAndReportClientPack();
$mwsResponse = $productClientPackIN->callSubmitFeed(MwsFeedAndReportClientPack::FEED_TYPE_PAI_PRODUCT, $feedHandle);
return new JsonResponse(array(
"success" => true,
"file" => $_FILES
));
}
Please help.
When I call the API it throws the deprecated error in the line 899 in Client.php so I cannot use this
iconv_set_encoding('output_encoding', 'UTF-8');
You should check the PHP Version to something like this
if (PHP_VERSION_ID < 50600) {
iconv_set_encoding('input_encoding', 'UTF-8');
iconv_set_encoding('output_encoding', 'UTF-8');
iconv_set_encoding('internal_encoding', 'UTF-8');
} else {
ini_set('default_charset', 'UTF-8');
}
Thanks
Thanks for your work on this library, Christian!
What are your thoughts on replacing all private method declarations with protected?
We're having a strange issue where some XML responses from Amazon are partially corrupt, like XML tags that are combined with each other, nested incorrectly, etc. Since the Amazon library only returns the parsed XML and not the raw response text we can't log this to see exactly what is getting returned and since it uses private methods we can't easily override the Amazon code to inject our logger code.
const PARAM_DESTINATION_ADDRESS = 'DestinationAddress'; is incorrect. Should be:
const PARAM_DESTINATION_ADDRESS = 'Address';
I don't see any "client packs" for the "FbaOutboundClient". Is it not supported yet?
Hii Friend,
I am integrating this package for ordersList API but it is alway returning null values for "x-mws-quota-max", "x-mws-quota-remaining" and "x-mws-quota-resetsOn" in ResponseHeaderMetadata.
here are request codes:
$todayDate =Carbon::today();
$mwsClientPoolUsa = new MwsClientPool();
$mwsClientPoolUsa->setConfig([
'amazon_site' => MwsClientPoolConfig::SITE_USA,
'access_key' => env('AWS_ACCESS_KEY_ID'),
'secret_key' => env('AWS_SECRET_ACCESS_KEY'),
'application_name' => env('APPLICATION_NAME'),
'application_version' => env('APPLICATION_VERSION'),
'seller_id' => env('SELLER_ID'),
'marketplace_id' => env('MARKETPLACE_ID')
]);
$orderClientPack = $mwsClientPoolUsa->getOrderClientPack();
$mwsResponse = $orderClientPack->callListOrdersByLastUpdatedDate($todayDate,[],['MWSAuthToken'=> env('MWS_AUTH_TOKEN')]);
dd($mwsResponse);
and here are response:
MarketplaceWebServiceOrders_Model_ListOrdersResponse {#306 ▼
#_fields: array:3 [▼
"ListOrdersResult" => array:2 [▶]
"ResponseMetadata" => array:2 [▼
"FieldValue" => MarketplaceWebServiceOrders_Model_ResponseMetadata {#309 ▶}
"FieldType" => "MarketplaceWebServiceOrders_Model_ResponseMetadata"
]
"ResponseHeaderMetadata" => array:2 [▼
"FieldValue" => MarketplaceWebServiceOrders_Model_ResponseHeaderMetadata {#301 ▼
-metadata: array:6 [▼
"x-mws-request-id" => "xxxx-xxxx-xxxx-xxxx-xxxxxxxxx"
"x-mws-response-context" => "T71b8VB2qL4JJSpv1dLxs4doOHt7OUbak7YHfgftggt5Zmic7Nwg5g67jhf46H98F8e1K28+MUA="
"x-mws-timestamp" => "2017-10-25T06:32:58.535Z"
"x-mws-quota-max" => null
"x-mws-quota-remaining" => null
"x-mws-quota-resetsOn" => null
]
}
"FieldType" => "MarketplaceWebServiceOrders_Model_ResponseHeaderMetadata"
]
]
}
and also can you please guide me how to manage throttling flow.
--
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.