jhoffland/natec-php-sdk
最新稳定版本:1.0.0
Composer 安装命令:
composer require jhoffland/natec-php-sdk
包简介
Natec Klantportaal API Client Library for PHP
README 文档
README
Usage
use NatecSdk\Client; use NatecSdk\Resources\Types\AssortmentUpdateType; use NatecSdk\Resources\AssortmentUpdate; use NatecSdk\Resources\Invoice; use NatecSdk\Resources\Shipment; $apiToken = 'xxx'; $client = new Client($apiToken); // Get an iterator with all resources, matching the filter (query). $assortmentUpdates = AssortmentUpdate::get($client, [ 'type' => AssortmentUpdateType::PRODUCT_EXPECTED_ARRIVAL->value ]); foreach($assortmentUpdates as $assortmentUpdate) { var_dump($assortmentUpdate); } // Get one resource, by the primary key value (id). The primary key for e.g. invoices is documentNo. var_dump(Invoice::find($client, 'GVFN22-12345')); // Save an order confirmation PDF file. $confirmationFile = fopen(__DIR__ . sprintf('/confirmation-%s.pdf', $order->no), 'w+'); $order->confirmation($client, $confirmation); // Make an API request var_dump($client->get(Shipment::endpoint())); var_dump($client->post('/orders', [ 'reference' => 'Example order' ]));
Contributing
Feel free to contribute to this library. Contribute by forking the GitHub repository and opening a pull request. When opening a pull request, please make sure that:
- The pull request has a clear title;
- The pull request does not consist of too many (unnecessary/small) commits;
- Tests are added or updated to test the added/improved functionality;
- The code complies to the coding standard, passes the code analysis and passes all the tests (
composer run-tests):- PHP_CodeSniffer (
vendor/bin/phpcs); - PHPStan (
vendor/bin/phpstan); - PHPUnit (
vendor/bin/phpunit).
- PHP_CodeSniffer (
ToDo's
- Give every assertion in the tests a descriptive message.
- Add a test for
NatecSdk\Client::getPdf()andNatecSdk\Resources\Order::confirmation() - Add a test for every resource?
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-11