sandiloka / tunai
Tunai 客户端 SDK
v0.0.3
2015-10-31 01:35 UTC
Requires
- php: >=5.3.0
- dflydev/hawk: *
- guzzlehttp/guzzle: 3.8.1
Requires (Dev)
- phpunit/phpunit: 3.7.14
This package is not auto-updated.
Last update: 2024-09-28 18:16:02 UTC
README
这是一个针对 PHP 的 Tunai.id 库。
安装
此库可以使用 Composer 安装。请将以下定义添加到您的 composer.json
{
"require": {
"sandiloka/tunai": "*"
}
}
与发票对象交互
use Sandiloka\Tunai\Invoice; $invoice = new Invoice('key', `secret`); $invoiceData = array ( 'refId' => '1234567', 'expired' => time() . '000', // to match JS new Date().valueOf() 'customer' => array ( "name": "Joni Iskandar", "phone": "08122039966", "address": "Jalan Senandung Raya No. 1" ), 'items' => array( array( "id": "123456", "description": "Sepatu Warna Merah Jambu", "qty": 1, "price": 100000 ) ) ); $res = $invoice.create($invoiceData); $statusCode = $res.getStatusCode(); $json = $res.getBody();
许可证
MIT