setono / post-nord-php-sdk
PostNord API 的 PHP SDK
v2.0.0-alpha.3
2024-06-10 12:47 UTC
Requires
- php: >=8.1
- cuyz/valinor: ^1.10
- php-http/discovery: ^1.14
- psr/http-client: ^1.0
- psr/http-client-implementation: ^1
- psr/http-factory: ^1.0
- psr/http-factory-implementation: ^1
- psr/http-message: ^1.0
- psr/log: ^1.1 || ^2.0 || ^3.0
Requires (Dev)
- infection/infection: ^0.27.11
- kriswallsmith/buzz: ^1.2
- nyholm/psr7: ^1.8
- phpspec/prophecy-phpunit: ^2.0
- phpunit/phpunit: ^9.6
- psalm/plugin-phpunit: ^0.18
- setono/code-quality-pack: ^2.7
This package is auto-updated.
Last update: 2024-09-10 13:24:56 UTC
README
一个用于 PostNord API 的 PHP SDK。
安装
打开命令行,进入你的项目目录,并执行以下命令以下载此库的最新稳定版本
composer require setono/post-nord-php-sdk
用法
以下是一个示例,展示如何获取最近的服务点。
use Setono\PostNord\Client\Client; use Setono\PostNord\Request\Query\ServicePoints\NearestByAddressQuery; require_once __DIR__ . '/../vendor/autoload.php'; $client = new Client('b09ff56c6a0344768d5afaaec595b2fb'); $servicePoints = $client->servicePoints()->getNearestByAddress(NearestByAddressQuery::create( 'Street name', 'Street number', 'Postal code', 'City', 'Country code', numberOfServicePoints: 10, ));
框架集成
- 有一个集成此库的 Symfony 模块: Symfony Post Nord Bundle