answear / dpd-pl-pickup-services-bundle
DPD.pl 拉取服务集成于 Symfony。
2.0.2
2024-03-01 10:03 UTC
Requires
- php: ^7.4 || ^8.0
- ext-simplexml: *
- guzzlehttp/guzzle: ^6.0|^7.0
- marc-mabe/php-enum: ^4.3
- 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.*
README
DPD.pl 的 PICKUP 服务 API 集成可通过 mypudo.dpd.com.pl 获取。
安装
- 使用 Composer 安装
composer require answear/dpd-pl-pickup-services-bundle
Answear\DpdPlPickupServicesBundle\AnswearDpdPlPickupServicesBundle::class => ['all' => true],
应该会自动添加到您的 config/bundles.php
文件中,由 Symfony Flex 完成。
配置
以下为组件的完整配置
answear_dpd_pl_pickup_services: key: 'xxxxxx' # your API Key # settings below are set as default, you don't need to provide them url: 'https://mypudo.dpd.com.pl/api/pudo/' # service's URL requestTimeout: 10.0 # time the library will wait for server's response
当在不使用 Symfony 的库中时,您需要将配置放入 \Answear\DpdPlPickupServicesBundle\Service\ConfigProvider
对象的实例中。
使用方法
DPD 的 API 通过自动注册在您的 Symfony 应用程序 DI 容器中的 Answear\DpdPlPickupServicesBundle\Service\PUDOList
提供。PUDO 项目以 Answear\DpdPlPickupServicesBundle\ValueObject\PUDO
对象的形式返回给您。
总结
欢迎提交带有新功能、改进或错误修复的 pull requests。Answear 团队将非常感谢任何评论。