loganhuskins/ebay-sdk-php

PHP 的 eBay SDK。基于 dts/ebay-sdk-php,支持 PHP 8。

dev-master 2024-05-30 01:50 UTC

This package is not auto-updated.

Last update: 2024-10-03 03:33:50 UTC


README

这是 David T. Sadler 的原始项目 dts/ebay-sdk-php 的分支,支持 PHP 7.3、PHP 7.4 和 PHP 8,并兼容 Guzzle 7。

原始项目已于 2020 年 2 月正式放弃。

我计划在短期内维护这个分支。 目标不是使其与最新的 eBay API 版本保持同步,而是为现有应用程序平滑升级到 PHP 8 提供解决方案。新用户应寻找更好的 PHP SDK。

Build Status Latest Stable Version Total Downloads License

此项目使 PHP 开发者能够在他们的 PHP 代码中使用 eBay API,并使用 Finding、Trading、Shopping 等服务构建软件。

这是一个个人项目,最初由 David T. Sadler 开发,他决定创建此项目以弥补官方 PHP SDK 的缺失。此项目在任何情况下均未得到 eBay 的认可、赞助或维护。

特性

要求

  • PHP 7.2+ 或 PHP 8.0+,以下扩展必须可用:
    • curl
    • libxml
  • 64 位版本
  • 在 cURL 扩展中启用 SSL,以便可以执行 https 请求。

安装

SDK 可以使用 Composer 安装

composer require benmorel/ebay-sdk-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')
);

更多示例可以在 ebay-sdk-examples 存储库中找到。

许可

Apache Public License 2.0 下授权。

版权所有 2016 David T. Sadler。