PHPackages                             antcool/easy-feieyun - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. antcool/easy-feieyun

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

antcool/easy-feieyun
====================

PHP SDK for Feieyun, 飞鹅云, 飞鹅开放平台

1.0.0(3y ago)213MITPHPPHP ^8.0.2

Since Apr 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/lonquan/easy-feieyun)[ Packagist](https://packagist.org/packages/antcool/easy-feieyun)[ RSS](/packages/antcool-easy-feieyun/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

 EasyFeieyun - Feieyun PHP SDK
===============================

[](#-easyfeieyun---feieyun-php-sdk-)

 PHP SDK for 飞鹅云

Overtrue! Respect!

文档链接
----

[](#文档链接)

- [飞鹅云开发文档](http://help.feieyun.com/document.php)

安装
--

[](#安装)

```
$ composer require antcool/easy-feieyun -vvv
```

使用
--

[](#使用)

### 配置项

[](#配置项)

```
$config = [
    'default'  => 'default',
    'accounts' => [
        'default' => [
            'user'           => 'xxx@xxx.com',
            'key'            => '.....',
            'notify_url'     => '', // 打印状态回调地址
            'valid_duration' => 60 * 60 * 2, // 打印订单有效时长, 最大 24 小时
        ],

        // 可配置多个账号
        'test' => [
            'user'           => 'xxx@xxx.com',
            'key'            => '.....',
            // 其他参数非必须
        ],
    ],

    'public_key' => '', // 飞鹅云公钥文件路径或内容

    'debug'        => true, // 开启将会在 runtime_path 下生成请求日志文件
    'runtime_path' => __DIR__ . '/_runtime',

    'http' => [
        'base_uri' => 'http://api.feieyun.cn/Api/Open/', // 飞鹅云 API 请求 URL
        'timeout'  => 30,
        'verify'   => false,
    ],
];
```

### 创建实例

[](#创建实例)

```
$app = new \AntCool\Feieyun\Application($config);
// 使用其他账号配置
$app->getConfig()->withAccount('test');

$config = $app->getConfig();
$client = $app->getClient();
$server = $app->getServer();
```

### API 调用示范

[](#api-调用示范)

```
// 添加打印机
$client->addPrinter(['111111111#xxxxx#测试4G', '22222222#xxxxxx#测试WIFI',])

// 小票打印
$client->printOrder(sn: '', content: '', items: 1, notifyUrl: false, duration: false);

// 标签打印
$client->printLabelOrder(sn: '', content: '', img: '', items: 1, notifyUrl: false, duration: false)

// 批量移除打印机
$client->deletePrinter(sn: 'string|array');

// 编辑打印机信息
$client->editPrinter(sn: '', name: '', phoneNum: '');

// 清除打印机队列
$client->clearPrinterSqs(sn: '');

// 查询订单打印状态
$client->queryOrderStatus(orderId: '');

// 查询指定打印机某天的订单统计数
$client->queryOrderCountByDate(sn: '', date: 'yyyy-mm-dd');

// 获取某台打印机状态
$client->queryPrinterStatus(sn: '');
```

### 打印状态回调

[](#打印状态回调)

```
$server = $app->getServer();

// 通知内容处理逻辑, 可多次调用
$server->with(function (array $message) {
    // $message 为经过签名验证的通知内容

    // $message['orderId'] 订单ID，由接口Open_printMsg返回。
    // $message['status'] 订单状态 	1：打印成功
    // $message['stime'] 订单状态变更UNIX时间戳，10位，精确到秒。
    // $message['sign'] 数字签名
});

// Laravel 内可以直接 return $response
$response = $server->serve();

// 其他需要自己创建响应内容的, 可以参考下面代码
$statusCode = $response->getStatusCode();
foreach ($response->getHeaders() as $name => $values) {
    header(sprintf('%s: %s', $name, implode(', ', $values)), true, $statusCode);
}
echo $response->getBody();
```

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. ...
2. ...

License
-------

[](#license)

MIT

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1115d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/473d9234b25803aa72515f11bb87e5a093ca4ff1eac5952ecdf0dfc09e46c0ec?d=identicon)[lonquan](/maintainers/lonquan)

### Embed Badge

![Health badge](/badges/antcool-easy-feieyun/health.svg)

```
[![Health](https://phpackages.com/badges/antcool-easy-feieyun/health.svg)](https://phpackages.com/packages/antcool-easy-feieyun)
```

###  Alternatives

[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)[roach-php/core

A complete web scraping toolkit for PHP

1.5k352.4k3](/packages/roach-php-core)[glhd/conveyor-belt

14797.0k](/packages/glhd-conveyor-belt)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[uspdev/replicado

Classes PHP que consome dados do Replicado USP

136.2k7](/packages/uspdev-replicado)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
