PHPackages                             dearlicy/afdian-client - 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. [API Development](/categories/api)
4. /
5. dearlicy/afdian-client

ActiveLibrary[API Development](/categories/api)

dearlicy/afdian-client
======================

PHP SDK for interacting with the Afdian API, including order and sponsor information retrieval.

v1.0.0(1y ago)26MITPHPPHP &gt;=7.2

Since Feb 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/DearLicy/AfdianClient)[ Packagist](https://packagist.org/packages/dearlicy/afdian-client)[ Docs](https://github.com/DearLicy/AfdianClient)[ RSS](/packages/dearlicy-afdian-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

爱发电 API SDK
===========

[](#爱发电-api-sdk)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

概述
--

[](#概述)

这是一个用于与爱发电平台API进行交互的PHP SDK。该SDK提供了以下功能：

- 根据订单号查询特定订单信息
- 获取所有订单（通过处理分页）
- 查询赞助者信息

目录
--

[](#目录)

- [安装](#%E5%AE%89%E8%A3%85)
    - [使用 Composer 安装](#%E4%BD%BF%E7%94%A8-composer-%E5%AE%89%E8%A3%85)
    - [手动安装](#%E6%89%8B%E5%8A%A8%E5%AE%89%E8%A3%85)
- [使用方法](#%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95)
    - [初始化客户端](#%E5%88%9D%E5%A7%8B%E5%8C%96%E5%AE%A2%E6%88%B7%E7%AB%AF)
    - [根据订单号查询订单](#%E6%A0%B9%E6%8D%AE%E8%AE%A2%E5%8D%95%E5%8F%B7%E6%9F%A5%E8%AF%A2%E8%AE%A2%E5%8D%95)
    - [获取所有订单](#%E8%8E%B7%E5%8F%96%E6%89%80%E6%9C%89%E8%AE%A2%E5%8D%95)
    - [获取赞助者信息](#%E8%8E%B7%E5%8F%96%E8%B5%9E%E5%8A%A9%E8%80%85%E4%BF%A1%E6%81%AF)
- [联系方式](#%E8%81%94%E7%B3%BB%E6%96%B9%E5%BC%8F)

安装
--

[](#安装)

### 使用 Composer 安装

[](#使用-composer-安装)

如果你使用 Composer 来管理你的 PHP 项目，可以通过以下命令安装此 SDK：

```
composer require dearlicy/afdian-client
```

手动安装
----

[](#手动安装)

1. 下载或克隆此仓库到本地：

```
git clone https://github.com/DearLicy/AfdianClient.git
```

2. 将SDK文件夹复制到你的项目中，并确保自动加载路径正确

使用方法
----

[](#使用方法)

### 初始化客户端

[](#初始化客户端)

首先，你需要实例化`AfdianClient`类并传入你的用户ID和Token：

```
$client = new AfdianClient('your_user_id', 'your_token');
```

### 根据订单号查询订单

[](#根据订单号查询订单)

你可以使用`queryOrderByOutTradeNo`方法来查询特定订单的信息：

```
$result = $client->queryOrderByOutTradeNo('202502140412095756101541924');
header('Content-Type: application/json');
echo json_encode($result, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
```

### 获取所有订单

[](#获取所有订单)

要获取所有订单（通过处理分页），可以使用`getAllOrders`方法：

```
$result = $client->getAllOrders();
header('Content-Type: application/json');
echo json_encode($result, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
```

### 获取赞助者信息

[](#获取赞助者信息)

使用`getSponsors`方法来查询赞助者信息：

```
$result = $client->getSponsors();
header('Content-Type: application/json');
echo json_encode($result, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
```

联系方式
----

[](#联系方式)

如果有任何问题或建议，请通过以下方式联系我：

- GitHub: [DearLicy](https://github.com/DearLicy)
- email: [DearLicy](mailto:DearLicy@gmail.com)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance43

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

451d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1dfd3693fa28409e13329627248fbc45a7b8f0f547ddfce6d6aa94eaf297122?d=identicon)[DearLicy](/maintainers/DearLicy)

---

Top Contributors

[![DearLicy](https://avatars.githubusercontent.com/u/113395685?v=4)](https://github.com/DearLicy "DearLicy (9 commits)")

---

Tags

phpsdkafdian

### Embed Badge

![Health badge](/badges/dearlicy-afdian-client/health.svg)

```
[![Health](https://phpackages.com/badges/dearlicy-afdian-client/health.svg)](https://phpackages.com/packages/dearlicy-afdian-client)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)[octw/aramex

A Library to integrate with Aramex APIs

2925.2k](/packages/octw-aramex)[jeffreyhyer/bamboohr

PHP SDK for the BambooHR API

1077.3k1](/packages/jeffreyhyer-bamboohr)

PHPackages © 2026

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