partner-it / dinero-php
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-09-19 09:36:33 UTC
README
安装
使用 Composer
composer require partner-it/dinero-php
使用方法
创建新实例
<?php
$Dinero = new \PartnerIT\Dinero\Dinero([
'clientId' => 'clientId',
'clientSecret' => 'xxx',
'apiKey' => 'yyy'
]);
请求新令牌
<?php
$Dinero->requestToken();
获取组织
<?php
$organizations = $Dinero->Organizations->getOrganizations();
$organizationId = $organizations[0]['id'];
创建新账本
<?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);
运行手动调用
<?php
$result = $Dinero->call('/endpoint', 'GET', []);
链接
官方API文档