cblink/feieyun-sdk

v1.0.3 2020-04-14 04:34 UTC

This package is auto-updated.

Last update: 2024-09-14 14:18:34 UTC


README

feieyun 选项.

安装

$ composer require cblink/feieyun-sdk -vvv

使用方法

use Cblink\Feieyun\Application;

$config = [
    'debug' => 0,
    
    'user' => 'your-feieyun-user',
    'ukey' => 'your-feieyun-ukey',
    
    'log' => [
      'name' => 'feieyun',
    ],
    'http' => [
      'timeout' => 3,
      'base_uri' => 'http://api.feieyun.cn/Api/Open',
      'http_errors' => false,
      'headers' => [
          'content-type' => 'application/x-www-form-urlencoded',
          'accept' => 'application/json',
      ],
    ],
    'cache' => [
      'namespace' => 'feieyun',
    ],
];

$app = new Application($config);

// 添加打印机
$app->printer->addPrinter($sn, $key, $alias, $phone)

// 从账号下终端打印机
$app->printer->removePrinter($sn);

// 创建文本打印任务
$app->printer->createPrinterTask($sn, $content, $times = 1);

// 创建标签打印任务
$app->printer->createPrinterLabelTask($sn, $content, $img = '', $times = 1);

// 修改打印机信息
$app->printer->editPrinterInfo($sn, $name, $phone = '');

// 取消终端所有未打印任务
$app->printer->cancelUnprintTaskBySn($sn);

// 获取终端状态
$app->printer->queryPrinterStatusBySn($sn);

// 查询指定打印机某天的订单统计数
$app->printer->queryOrderInfoBySnAndDate($machine_code);

贡献

你可以通过以下三种方式之一进行贡献

  1. 使用 问题追踪器 提交错误报告。
  2. 问题追踪器 上回答问题或修复错误。
  3. 贡献新功能或更新维基。

代码贡献过程并不非常正式。你只需确保遵循 PSR-0、PSR-1 和 PSR-2 编码规范。任何新的代码贡献都必须附带适用的单元测试。

许可证

MIT