Home

Awesome

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:

Can use basic or digest server authorization.

Known issues

Installation

The suggested installation method is via composer:

php composer.phar require alexz707/invoiceninja-module

Configure module

    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');