teknoo/sellsy-client

PHP 库,用于通过 Sellsy API 将您的应用程序连接到您的 Sellsy 账户,并在 Sellsy 技术上构建您的网站和平台。


README

Latest Stable Version Latest Unstable Version Total Downloads License PHPStan

PHP 库,用于通过 Sellsy 账户 使用 Sellsy API 连接到您的应用程序,并在 Sellsy 技术上构建您的网站和平台。

简单示例

    <?php

    use GuzzleHttp\Client;
    use Teknoo\Sellsy\Guzzle6\Transport\Guzzle6;
    use Teknoo\Sellsy\Sellsy;
    
    include 'vendor/autoload.php';
    
    //Create the HTTP client
    $guzzleClient = new Client();
    
    //Create the transport bridge
    $transportBridge = new Guzzle6($guzzleClient);
    
    //Create the front object
    $sellsy = new Sellsy(
        'https://apifeed.sellsy.com/0/',
        $userToken,
        $userSecret,
        $consumerKey,
        $consumerSecret
    );
    
    $sellsy->setTransport($transportBridge);
    
    //Example of request, follow the API documentation of Sellsy API.
    print $sellsy->infos()->getInfos()->getResponse()['consumerdatas']['id'];
    //Show your ConsumerDatas id, like 9001
    
    print $sellsy->Infos()->getInfos()->consumerdatas->id;
    //Show again your ConsumerDatas id, like 9001
    
    $sellsy->Infos()->async()->getInfos()->then(function (\Teknoo\Sellsy\Client\ResultInterface $result) {
        print $result->consumerdatas->id.PHP_EOL;
    })->wait();
    //Show again your ConsumerDatas id, like 9001
    
    print $sellsy->AccountPrefs()->getCorpInfos()->getResponse()['email'];
    //Show your email, like contact@teknoo.software
    
    print $sellsy->AccountPrefs()->getCorpInfos()->email;
    //Show your email, like contact@teknoo.software
    
    $sellsy->AccountPrefs()->async()->getCorpInfos()->then(function (\Teknoo\Sellsy\Client\ResultInterface $result) {
        print $result->email.PHP_EOL;
    })->wait();
    //Show your email, like contact@teknoo.software
    
    $sellsy->AccountDatas()->deleteTaxe();
    //Thrown an exception : Teknoo\Sellsy\Client\Exception\ParameterMissingException: id is missing

如何使用

快速了解如何使用此库的指南: 启动。管理 Sellsy 速率限制: 速率限制

支持此项目

此项目是免费的,并将保持免费。它完全由 EIRL 的活动支持。如果您喜欢它,并帮助我维护和改进它,请毫不犹豫地在 PatreonGithub 上支持我。

谢谢 :) Richard.

致谢

EIRL Richard Déloge - https://deloge.io - 主要开发者。SASU Teknoo Software - https://teknoo.software

关于 Teknoo Software

Teknoo Software 是一家 PHP 软件编辑公司,由 Richard Déloge 创立,作为 EIRL Richard Déloge 的一部分。Teknoo Software 的目标:为我们的合作伙伴和社区提供一套高质量的服务或软件,分享知识和技能。

许可证

Space 采用 MIT 许可证授权 - 详细信息请参阅许可证文件夹。

安装 & 要求

要使用 composer 安装此库,请运行以下命令

composer require teknoo/sellsy-client

要使用内嵌的 Guzzle 传输

composer require guzzlehttp/guzzle

此库需要

* PHP 8.1+ (7.4 and 8.0 can works, but there are not supported)
* A PHP autoloader (Composer is recommended)
* Teknoo/Immutable.
* A PSR-7 implementation

Teknoo Sellsy Client 3.0 的新闻

此库需要 PHP 7.4 或更高版本。一些更改导致 bc 断开连接

  • PHP 7.4 是最低要求
  • 改进错误管理:API 返回的所有错误和异常现在都映射到显式的 PHP 异常
  • 改进结果管理:键/值可以直接从结果对象访问,作为对象的属性,归功于 voku/arrayy
  • 改进结果对象:错误消息现在可以通过专用获取器访问。
  • 添加异步请求功能
  • 切换到类型属性
  • 删除一些无用的 PHP DockBlocks
  • 将 array_merge 替换为 "..." 运算符
  • 大多数方法都已更新,包括适用时的类型提示。请检查您的扩展点,以确保函数签名正确。_ 所有文件都使用严格类型。请确保不要依赖类型强制。
  • 切换到 PHPStan 在 QA 工具中,并禁用 PHPMd

特别感谢

Julien Herr julien@herr.fr:RateLimitTransport 和关于 Sellsy API 中速率限制的文档。

贡献:)

欢迎您为此项目做出贡献。 在 Github 上创建分支