mrstroz / yii2-infakt
Infakt component for Yii 2 framework
0.0.1
2018-05-07 08:55 UTC
Requires
- php: >=5.6.0
- yiisoft/yii2: ~2.0.6
Requires (Dev)
- php: >=5.4.0
- yiisoft/yii2: ~2.0.6
This package is auto-updated.
Last update: 2026-02-26 04:52:56 UTC
README
Infakt component for Yii 2 framework
Installation
The preferred way to install this extension is through composer.
Run
composer require "mrstroz/yii2-infakt" "*"
or add
"mrstroz/yii2-infakt": "*"
to the require section of your composer.json file.
Usage
- Add component to your config file
'components' => [ // ... 'infakt' => [ 'class' => 'mrstroz\infakt\Infakt', 'apiKey' => 'xxxxxx', ], ]
- Add new client
/** @var Infakt $inFakt */ $inFakt = Yii::$app->infakt; $response = $inFakt->call('clients', 'POST', ['client' => [ 'company_name' => 'Infakt biuro rachunkowe', 'nip' => '888-888-88-88' ] ] );
- Get client by ID
/** @var Infakt $inFakt */ $inFakt = Yii::$app->infakt; $response = $inFakt->call('clients/xxxxxx', 'GET');
- Add new invoice
/** @var Infakt $inFakt */ $inFakt = Yii::$app->infakt; $response = $inFakt->call('invoices', 'POST', ['invoice' => [ 'payment_method' => 'payu', 'client_id' => 6567050, 'services' => [ [ 'name' => 'Przykładowa Usługa', 'gross_price' => 6623, 'tax_symbol' => 23 ] ] ] ] );
Check inFakt API Documentation for all available options.