ecomlogic/ebay-sdk

PHP 的 eBay SDK。在您的 PHP 项目中使用 eBay API。

11.0.1 2017-10-23 14:56 UTC

This package is auto-updated.

Last update: 2024-09-22 17:34:40 UTC


README

Build Status

此项目允许 PHP 开发者在他们的 PHP 代码中使用 eBay API,并使用如 FindingTradingShopping 等服务构建软件。您可以通过 使用 Composer 安装 SDK 和遵循 基本使用指南 来开始。

这是一个由我,David T. Sadler 开发的个人项目。我决定创建这个项目是为了弥补 PHP 缺乏官方 SDK 的情况。这个项目绝不会被 eBay 官方推荐、赞助或维护。

功能

资源

要求

  • PHP 5.5 或更高版本,以下扩展
    • cURL
    • libxml
  • 建议使用 64 位 PHP 版本,因为在 32 位系统上使用 SDK 时存在一些 问题
  • 在 cURL 扩展中启用 SSL,以便可以发出 https 请求。

安装

SDK 可以通过 Composer 安装。请参阅 用户指南中的安装部分 以了解其他安装方式。

  1. 安装 Composer。

    curl -sS https://getcomposer.org/installer | php
    
  2. 安装 SDK。

    php composer.phar require dts/ebay-sdk-php
    
  3. 通过在代码中添加以下行来要求 Composer 的自动加载器。

    require 'vendor/autoload.php';

示例

获取官方 eBay 时间

<?php

require 'vendor/autoload.php';

use \DTS\eBaySDK\Shopping\Services;
use \DTS\eBaySDK\Shopping\Types;

// Create the service object.
$service = new Services\ShoppingService();

// Create the request object.
$request = new Types\GeteBayTimeRequestType();

// Send the request to the service operation.
$response = $service->geteBayTime($request);

// Output the result of calling the service operation.
printf("The official eBay time is: %s\n", $response->Timestamp->format('H:i (\G\M\T) \o\n l jS Y'));

项目目标

  • 维护良好。
  • 有良好的 文档
  • 有良好的 测试
  • 有良好的 示例 支持。

许可证

根据 Apache Public License 2.0 许可。

版权所有 2016 David T. Sadler