unialteri/sellsy-client

此包已被废弃,不再维护。作者建议使用teknoo/sellsy-client包。

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


README

Latest Stable Version Latest Unstable Version Total Downloads License PHPStan

PHP库,用于通过Sellsy API将您的应用程序连接到您的Sellsy账户,并在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返回的错误管理。现在将API抛出的所有错误和异常映射到一个显式的PHP异常
  • 改进结果管理:键/值可以直接从结果对象访问,就像对象的属性一样,归功于voku/arrayy
  • 改进结果对象,错误消息现在可以通过专用获取器访问。
  • 添加异步请求功能
  • 切换到类型属性
  • 删除一些无用的PHP DockBlocks
  • 用"..."运算符替换array_merge
  • 大多数方法已更新,包括适用时的类型提示。请检查您的扩展点,确保函数签名正确。_ 所有文件都使用严格的类型。请确保不要依赖类型转换。
  • 将QA工具切换到PHPStan并禁用PHPMd

特别感谢

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

贡献:)

您欢迎使用此项目。 在Github上分叉它