answear / meest-bundle
为 Symfony 集成 Meest B2B API。
2.0.0
2022-08-18 10:19 UTC
Requires
- php: >=7.4|^8.0
- ext-soap: *
- marc-mabe/php-enum: ^3.0|^4.0
- symfony/http-kernel: ^5.4|^6.0
- webmozart/assert: ^1.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.4
- phpro/grumphp: ^1.5.0
- phpstan/phpstan: ^1.4
- phpstan/phpstan-webmozart-assert: ^1.0
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-master
- symfony/phpunit-bridge: 6.1.*
This package is auto-updated.
Last update: 2024-09-18 14:51:47 UTC
README
为 Symfony 集成 Meest B2B API。
Meest B2B API 的文档可以在以下地址找到: http://dev.meestb2b.com:8090/confluence/。
安装
- 使用 Composer 安装
composer require answear/meest-bundle
Answear\MeestBundle\AnswearMeestBundle::class => ['all' => true],
应该由 Symfony Flex 自动添加到您的 config/bundles.php
文件中。
使用方法
- 获取 Nova Poshta 招收点数组(或任何其他在 DivisionTypeEnum 中找到的支持的部门类型)
use Answear\MeestBundle\Enum\DivisionTypeEnum; use Answear\MeestBundle\Request\SearchDivisions; use Answear\MeestBundle\Response\DTO\DivisionDTO; use Answear\MeestBundle\Response\SearchDivisions as SearchDivisionsResponse; use Answear\MeestBundle\Service\MeestClient; // ... /** * @var MeestClient */ private $meestClient; public function __construct( ... MeestClient $meestClient ) { ... $this->meestClient = $meestClient; } ... public function pickupPoints(): void { /** @var SearchDivisionsResponse $response */ $response = $this->meestClient->request(new SearchDivisions(DivisionTypeEnum::novaPoshtaPoint())); /** @var DivisionDTO $division */ foreach ($response->return as $division) { if ($division->active) { ... } } ... }
最后说明
请随意提交带有新功能、改进或错误修复的 pull request。Answear 团队将感谢任何评论。