Coder Social home page Coder Social logo

lamoda / atol-client-bundle Goto Github PK

View Code? Open in Web Editor NEW
7.0 21.0 8.0 17 KB

Bundle for ATOL API v3/v4 client for PHP https://github.com/lamoda/atol-client

License: MIT License

PHP 100.00%
php bundle symfony atol symfony-bundle symfony3 symfony4 fz-54 fiscalization

atol-client-bundle's Introduction

ATOL PHP Client bundle

Bundle for https://github.com/lamoda/atol-client

Build Status Scrutinizer Code Quality Code Coverage Build Status

Installation

Usage is as simple as

  1. Install library

    composer require lamoda/atol-client-bundle
  2. Register bundle and required JMS Serializer Bundle

    // Kernel
    
    public function registerBundles()
    {
    	// ...
    	$bundles[] = new \Lamoda\AtolClientBundle\AtolClientBundle();
    	$bundles[] = new \JMS\SerializerBundle\JMSSerializerBundle();
    	// ...
    }
  3. Configure Guzzle client in services.yaml, for example:

    services:
        guzzle:
            class: \GuzzleHttp\Client
  4. Configure Symfony to enable validator and enable_annotations:

    framework:
        validation:
            enabled: true
            enable_annotations: true
  5. 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
  6. Use @atol_client.v4 to inject atol client as a dependency

atol-client-bundle's People

Contributors

dmitriymatvienko avatar medliii avatar nikulinilya avatar tihonovgn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.