hanson / pospal
dev-master
2018-05-16 06:07 UTC
Requires
- hanson/foundation-sdk: ^2.0
- nesbot/carbon: ^1.27
This package is not auto-updated.
Last update: 2024-12-22 07:01:10 UTC
README
银豹收银系统 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', ]);
销售单据 API
单据实例
$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']; } });