Overseas integration for Symfony.
Documentation of the API can be found here: https://api.overseas.hr/apiinfo
- install with Composer
composer require [email protected]:answear/overseas-bundle.git
Answear\OverseasBundle\AnswearOverseasBundle::class => ['all' => true],
should be added automatically to your config/bundles.php
file by Symfony Flex.
- provide required config data:
environment
andapiKey
# config/packages/answear_overseas.yaml
answear_overseas:
environment: test|prod
apiKey: yourApiKey
logger: yourCustomLoggerService #default: null
Logger service must implement Psr\Log\LoggerInterface
interface.
@see https://api.overseas.hr/apiinfo#parcelshops
/** @var \Answear\OverseasBundle\Service\ParcelShopsService $parcelShopService **/
$parcelShopService->get();
will return \Answear\OverseasBundle\Response\DTO\ParcelShop[]
array.
@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.
Answear\OverseasBundle\Exception\ServiceUnavailableException
for allGuzzleException
MalformedResponseException
for partner other errorsAnswear\OverseasBundle\Exception\BadRequestException
if validation failed or for error response
Feel free to open pull requests with new features, improvements or bug fixes. The Answear team will be grateful for any comments.