<?php
//获取token
function testGetMerchantToken()
{
try {
$res = NuoNuo::instance()
->setAppKey("xxx")
->setAppSecret("xxx")
->getMerchantToken();
$res = json_decode($res, true);
var_dump($res);
} catch (NuonuoException $e) {
var_dump($e->errorMessage());
}
}
//查询开票记录
function testQueryInvoiceQuantity()
{
try {
$senId = md5(uniqid());
$res = NuoNuo::instance()
->setAppKey("SD15125971")
->setAppSecret("SD354602BB0B48D0")
->sendPostSyncRequest(
$senId,
'xxx',
'xxxx',
'nuonuo.electronInvoice.queryInvoiceQuantity',
json_encode([
'taxnum' => 'xxxx',
'invoiceTimeStart' => '2018-03-19 00:00:00',
'invoiceTimeEnd' => '2019-04-23 23:59:59',
])
);
var_dump($res);
} catch (NuonuoException $e) {
var_dump($e->errorMessage());
}
}
组件结构
bin/
build/
docs/
config/
src/
tests/
vendor/
Via Composer
$ composer require topphp/topphp-nuonuo-invoice
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email sleep@kaituocn.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.