银豹收银系统 SDK
composer require hanson/pospal:dev-master
$pospal = new \Hanson\Pospal\Pospal([
'url' => 'your-url',
'app_id' => 'your-app-id',
'app_key' => 'your-app-key',
]);
$ticket = $pospal->ticket;
$result = $ticket->allPayMethod();
$result = $ticket->query($sn);
$result = $ticket->paginate([
'startTime' => '2017-09-25 01:59:59',
'endTime' => '2017-09-25 23:59:59',
]);
此 API 需要传入匿名函数
// 默认查询昨天
$result = $ticket->all([], function ($tickets) {
foreach($tickets as $ticket) {
echo $ticket['sn'];
}
});