partner-it / dinero-php
dinero php wrapper
1.0.2
2015-11-11 12:30 UTC
Requires
- php: >=5.4
- partner-it/php-curl-wrapper: ~1.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-12-19 10:06:03 UTC
README
Installation
Using Composer
composer require partner-it/dinero-php
Usage
Create a new instance:
<?php
$Dinero = new \PartnerIT\Dinero\Dinero([
'clientId' => 'clientId',
'clientSecret' => 'xxx',
'apiKey' => 'yyy'
]);
Request a new token:
<?php
$Dinero->requestToken();
Get the Organizations
<?php
$organizations = $Dinero->Organizations->getOrganizations();
$organizationId = $organizations[0]['id'];
Create a new ledger:
<?php
$nextVoucherNumber = $Dinero->LedgerItems->getNextVoucherNumber($organizationId);
$data = [
[
"Amount" => -500,
"Description" => "produkt, lille",
"BalancingAccountVatCode" => null,
"AccountNumber" => 1000,
"BalancingAccountNumber" => null,
"VoucherDate" => "2015-05-27",
"VoucherNumber" => $nextVoucherNumber,
"AccountVatCode" => "I25"
]
];
$Dinero->LedgerItems->createLedgeritems($organizationId, $data);
Run a manual call:
<?php
$result = $Dinero->call('/endpoint', 'GET', []);
Links
Official API documentation: