lamoda / atol-client-bundle
Symfony Bundle for integration with lamoda/atol-client
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 22
Forks: 8
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.2
- guzzlehttp/guzzle: ^6.2 || ^7.3
- jms/serializer-bundle: ^3.3
- lamoda/atol-client: ^1.6.3
- symfony/config: ^4.0 || ^5.0
- symfony/dependency-injection: ^4.0 || ^5.0
- symfony/http-kernel: ^4.0 || ^5.0
- symfony/yaml: ^4.0 || ^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.11
- phpunit/phpunit: ^7.5.20
- symfony/symfony: ^4.2.9 || 5.4
This package is auto-updated.
Last update: 2024-12-04 10:48:59 UTC
README
Bundle for https://github.com/lamoda/atol-client
Installation
Usage is as simple as
-
Install library
composer require lamoda/atol-client-bundle
-
Register bundle and required JMS Serializer Bundle
// Kernel public function registerBundles() { // ... $bundles[] = new \Lamoda\AtolClientBundle\AtolClientBundle(); $bundles[] = new \JMS\SerializerBundle\JMSSerializerBundle(); // ... }
-
Configure Guzzle client in
services.yaml
, for example:services: guzzle: class: \GuzzleHttp\Client
-
Configure Symfony to enable
validator
andenable_annotations
:framework: validation: enabled: true enable_annotations: true
-
Add config for any clients you need:
atol_client: clients: v3: # Version 3 of ATOL API. Currently deprecated and will not be supported by ATOL since 01.01.2019 version: !php/const Lamoda\AtolClientBundle\AtolClientBundle::API_CLIENT_VERSION_3 guzzle_client: guzzle # Link to the service that is guzzle guzzle_client_options: [] # Options for guzzle client (optional) base_url: 'http://atol_v3_url' # Base url of ATOL server callback_url: '' # Callback url for ATOL (see docs) default: version: !php/const Lamoda\AtolClientBundle\AtolClientBundle::API_CLIENT_VERSION_4 guzzle_client: guzzle # Link to the service that is guzzle guzzle_client_options: [] # Options for guzzle client (optional) base_url: 'http://atol_v4_url' # Base url of ATOL server
-
Use
@atol_client.v4
to inject atol client as a dependency