Amazon Marketplace Web Services (MWS) API 的 PHP 客户端

v0.8.2 2016-08-26 03:23 UTC

This package is auto-updated.

Last update: 2024-09-27 22:43:11 UTC


README

GitHub release Travis Packagist

Amazon MWS 工具包

Amazon MWS 工具包使开发者能够轻松地将 Amazon 的 Marketplace Webservices 集成到他们的 PHP 代码中,并使用诸如 订单入站履约报告 等服务构建强大的应用程序。您可以通过通过 Composer 安装工具包或下载最新版本来在几分钟内开始使用。

目前该项目处于 BETA 版,不推荐用于生产环境,但您仍然可以尝试使用它。(我知道您会的!)

资源

  • 工具包文档 - 了解如何使用此工具包的详细信息
  • API 文档 - 了解操作、参数和响应的详细信息

安装

通过 Composer 显然

composer require sellerworks/amazon-mws

您也可以通过注册自动加载函数在不使用 Composer 的情况下使用 Amazon MWS 工具包

spl_autoload_register(function($class) {
    $prefix = 'SellerWorks\\Amazon\\';

    if (!substr($class, 0, 18) === $prefix) {
        return;
    }

    $class = substr($class, strlen($prefix));
    $location = __DIR__ . 'path/to/sellerworks-amazon/src/' . str_replace('\\', '/', $class) . '.php';

    if (is_file($location)) {
        require_once($location);
    }
});

现在您已经准备好开始使用了。

示例

获取服务状态。

<?php

require 'vendor/autoload.php';

use SellerWorks\Amazon\Credentials\Credentials;
use SellerWorks\Amazon\Orders\Client;

// Create the API client.
$credentials = new Credentials('Seller Id', 'Access Key', 'Secret Key');
$client = new Client($credentials);

// Send request to the API.
$status = $client->GetServiceStatus();

// Output service level information.
printf("The current service level for the Orders Service is: %s\n", $status->Status);

项目目标

  • 维护良好。
  • 文档齐全。
  • 测试良好。

享受吧!