hanson/pospal

dev-master 2018-05-16 06:07 UTC

This package is not auto-updated.

Last update: 2024-11-10 06:22:09 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'];
    }
});