answear/dpd-pl-pickup-services-bundle

DPD.pl 拉取服务集成于 Symfony。

2.0.2 2024-03-01 10:03 UTC

This package is auto-updated.

Last update: 2024-08-30 11:10:46 UTC


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 团队将非常感谢任何评论。