autocustoms / amazon-mws-merchant-fulfillment
该包最新版本(v1.0.0)没有提供许可信息。
Amazon 商家配送 API PHP 客户端库
v1.0.0
2016-11-21 20:10 UTC
Requires
- php: >=5.4
This package is not auto-updated.
Last update: 2024-09-23 14:15:58 UTC
README
-
打开
/Samples/.config.inc.php -
编辑以下行,将
<>值替换为您的凭证define('AWS_ACCESS_KEY_ID', '<Your Access Key ID>'); define('AWS_SECRET_ACCESS_KEY', '<Your Secret Key>'); define('APPLICATION_NAME', '<Your Application Name>'); define('APPLICATION_VERSION', '<Your Application Version or Build Number>'); define('MERCHANT_ID', '<Your Merchant Id>'); // If you are making calls on another seller's behalf, put their merchantID here. define('MARKETPLACE_ID', '<Your Marketplace Id>');
编辑示例
在 /Samples 文件夹中,您可以找到与特定 Amazon 市场服务(Amazon MWS)操作对应的文件。这些文件作为示例,说明进行该特定操作的所需代码。我们将使用 Feeds API 部分的 SubmitFeed 操作作为示例。
-
打开
/Samples/SubmitFeedSample.php -
取消注释适当的
$serviceURL,以选择您想要在该市场上销售的商场。示例$serviceUrl = "https://mws.amazonservices.com"; -
将
$feed变量填充为馈送内容。示例// From a string $feed = "Feed content"; // From a file $feed = file_get_contents("feed.txt"); -
取消注释
$marketplaceIdArray并填充包含您要提交馈送到其位置的 MarketplaceId 值的数组。 -
在 126-170 行之间取消注释两种 Amazon MWS 请求构建方法之一。
-
取消注释以下行
invokeSubmitFeed($service, $request); @fclose($feedHandle); -
启动您的服务器并导航到脚本的地址以运行它。
常见问题解答
为什么 cURL 返回 Error Response Status Code: 0?
如果您在尝试使用 cURL 向 Amazon MWS 发送请求时收到 Error Response Status Code: 0 错误,请找到并将 CURLOPT_SSL_VERIFYPEER 设置为 false。
为什么 FeedSubmissionResult 被截断?
当服务器响应保存到内存中时会发生这种情况。为了避免这种情况,将响应保存到文件中。
$responseFile = fopen("response.xml", "w");
fwrite($responseFile, $dom->saveXML());
fclose($responseFile);
/Mock 文件夹中有什么?
模拟文件夹包含模拟 Amazon MWS 响应的 canned 响应。模拟响应对于在不实际向 Amazon MWS 发送请求的情况下进行测试非常有用。