定制 answear/overseas-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

answear/overseas-bundle

最新稳定版本:4.1.0

Composer 安装命令:

composer require answear/overseas-bundle

包简介

Symfony bundle for Overseas api.

README 文档

README

Overseas integration for Symfony.
Documentation of the API can be found here: https://api.overseas.hr/apiinfo

Installation

  • install with Composer
composer require git@github.com:answear/overseas-bundle.git

Answear\OverseasBundle\AnswearOverseasBundle::class => ['all' => true],
should be added automatically to your config/bundles.php file by Symfony Flex.

Setup

  • provide required config data: environment and apiKey
# config/packages/answear_overseas.yaml
answear_overseas:
    environment: test|prod
    apiKey: yourApiKey
    logger: yourCustomLoggerService #default: null

Logger service must implement Psr\Log\LoggerInterface interface.

Usage

Get ParcelShops

@see https://api.overseas.hr/apiinfo#parcelshops

/** @var \Answear\OverseasBundle\Service\ParcelShopsService $parcelShopService **/
$parcelShopService->get();

will return \Answear\OverseasBundle\Response\DTO\ParcelShop[] array.

Get Places

@see https://api.overseas.hr/apiinfo#places

$zipCode = 12345;
$name = 'name';
$approx = true;

/** @var \Answear\OverseasBundle\Service\PlacesService $placesService **/
$placesService->get($zipCode, $name, $approx);

will return \Answear\OverseasBundle\Response\DTO\Place[] array narrowed down to params. or simply

$placesService->get();

to get all places.

Error handling

  • Answear\OverseasBundle\Exception\ServiceUnavailableException for all GuzzleException
  • MalformedResponseException for partner other errors
  • Answear\OverseasBundle\Exception\BadRequestException if validation failed or for error response

Final notes

Feel free to open pull requests with new features, improvements or bug fixes. The Answear team will be grateful for any comments.

统计信息

  • 总下载量: 13.93k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-07