Giter VIP home page Giter VIP logo

invoiceninjamodule's Introduction

InvoiceNinjaModule

Laminas Module to consume the InvoiceNinja V5 API (https://www.invoiceninja.com).

GitHub release CI Code Coverage Scrutinizer Code Quality Dependency Status Total Downloads Latest Stable Version

Description

Latest release can handle the following api services:

  • Clients
  • Invoices
  • Products
  • Tax rates

Can use basic or digest server authorization.

Known issues

  • Invoice Ninja API V5 is (mostly) returning strings instead of the real data type but wants the real data types in the requests. If you find out about a field which behaves like this please open an issue!
  • Not all endpoints are implemented -> if you need one please send a PR or open an issue.
  • Humbug is deprecated and should be changed to Infection

Installation

The suggested installation method is via composer:

php composer.phar require alexz707/invoiceninja-module

Configure module

  • Copy /vendor/alexz707/invoiceninja-module/config/invoiceninja.global.php.dist into your global autoload folder, remove the dist extension so that Laminas picks it up
  • If you use your own instance of invoice ninja change the host url
  • Replace the token with your generated invoice ninja token
  • If you use basic or digest authorization uncomment the used method and fill in your credentials
    Module::INVOICE_NINJA_CONFIG => [
        Module::API_TIMEOUT     => 100,
        Module::TOKEN           => 'YOURTOKEN',
        Module::HOST_URL        => 'https://ninja.dev/api/v1',

        /*
         * If the api is protected by htaccess uncomment
         * ONE of the following code blocks and use your credentials.
         */
        Module::AUTHORIZATION   => [
            /*
             * BASIC authorization
             * \Zend\Http\Client::AUTH_BASIC => [
             *    Module::AUTH_USER => 'YOURUSER',
             *    Module::AUTH_PASS => 'YOURPASSWORD'
             * ]
             */

            /*
             * DIGEST authorization
             * \Zend\Http\ClientClient::AUTH_DIGEST => [
             *    Module::AUTH_USER => 'YOURUSER',
             *    Module::AUTH_PASS => 'YOURPASSWORD'
             * ]
             */
        ]
    ]

Enable module

Register as Laminas module inside your config/application.config.php file:

    'modules' => [
        'Laminas\Router',
        'InvoiceNinjaModule',
        'YourApplicationModule',
    ],

Use the service managers

        /** @var ClientManager $clientManager */
        $clientManager = $sm->get(ClientManager::class);
        $client = $clientManager->getClientById('1');

invoiceninjamodule's People

Contributors

alexz707 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.