aleahy / saasu-connect
连接并使用 Saasu API
0.1
2022-03-20 05:52 UTC
Requires
- php: ^7.4|^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.3
- kamermans/guzzle-oauth2-subscriber: ^1.0
- spatie/guzzle-rate-limiter-middleware: ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-20 11:30:53 UTC
README
概览
这个 PHP 包允许连接到 Saasu,从而对 Saasu API 进行请求。
它支持搜索、插入和更新操作。
它使用 spatie/guzzle-rate-limiter-middleware 来满足 API 限制中的每秒1个请求的限制。
安装包
使用 composer 安装此包。
composer require aleahy/saasu-connect
使用方法
为了连接到 Saasu 文件,你需要一个 用户名
、密码
和 文件 ID
。
连接
$client = SaasuAPI::createClient($username, $password); $connection = new SaasuAPI($client, $fileID);
然后可以使用连接进行请求。
use Aleahy\SaasuConnect\Entities\Invoice as SaasuInvoice; $connection->findEntity(SaasuInvoice::class, [ 'AmountOwed' => 490.0 ]);
可用方法
目前存在以下方法
findEntity
- 通过搜索属性查找提供的实体。返回实体集合。
insertEntity
- 对给定实体进行带有关联属性的 POST 请求。
getEntity
- 返回具有给定 ID 的特定实体。
getAllEntities
- 以单个数组返回所有实体。
可用实体
- 公司
- 联系人
- 发票