PHP code example of wenhsing / tongtu-sdk-php
1. Go to this page and download the library: Download wenhsing/tongtu-sdk-php library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wenhsing / tongtu-sdk-php example snippets
app('tongtu')->ordersQuery()->reuqest(['body' => [
'accountCode' => 'test',
// 可以不需要,扩展包会自动添加
// 'merchantId' => '000XXX',
'orderStatus' => 'waitPacking',
'pageNo' => '1',
'pageSize' => '100',
'payDateFrom' => '2018-01-01 00:00:00',
'payDateTo' => '2018-01-01 00:00:00',
]]);
// 引入自动加载文件
,并传入配置
$c = new Wenhsing\Tongtu\Tongtu(new Wenhsing\Tongtu\Config([
'enable' => true,
'app_key' => '82b76df24da14895b21ed5efa80d35b8',
'app_secret' => '096ab7aa62af4b308098c4ada5fb24435382508794c849cdb6f67517793c9b9d',
'log' => [
'name' => 'wenhsing',
'outpath' => './',
'level' => \Monolog\Logger::DEBUG,
],
]));
// 获取app token
var_dump($c->appToken()->request());
$c->getConfig()->set('enable', false);
var_dump($c->appToken()->request());
var_dump($c->setConfig(new Wenhsing\Tongtu\Config(['enable' => false]))->appToken()->request());
sh
php artisan vendor:publish --tag="wenhsing-tongtu"