yii2-infakt
Infakt component for Yii 2 framework, (*1)
inFakt API Documentation, (*2)
Installation
The preferred way to install this extension is through composer., (*3)
Run, (*4)
composer require "mrstroz/yii2-infakt" "*"
or add, (*5)
"mrstroz/yii2-infakt": "*"
to the require section of your composer.json
file., (*6)
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., (*7)