PHPackages                             cyd622/payment - 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. [Payment Processing](/categories/payments)
4. /
5. cyd622/payment

ActiveLibrary[Payment Processing](/categories/payments)

cyd622/payment
==============

支付宝支付、微信支付、招商一网通支付php SDK。方便快速接入，最完整的开源支付 php sdk

v3.1.3(8y ago)020MITPHPPHP &gt;=5.6

Since Jun 16Pushed 8y agoCompare

[ Source](https://github.com/cyd622/payment)[ Packagist](https://packagist.org/packages/cyd622/payment)[ Docs](https://helei112g.github.io/categories/payment-3/)[ RSS](/packages/cyd622-payment/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (30)Used By (0)

[![Software license](https://camo.githubusercontent.com/3b83d6d1b3b377ba8f41c1e4ac197ad0dc056a760ec10c1f6484aa7b617fcc5a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f68656c6569313132672f7061796d656e742e737667)](LICENSE)[![Latest development](https://camo.githubusercontent.com/fbd0d64a834c65c0454f037d9012c00c63a4c836819b10a576b9273deac8923d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f7269766572736c65692f7061796d656e742e737667)](https://packagist.org/packages/cyd622/payment)[![Monthly installs](https://camo.githubusercontent.com/3535208b5d71d3a0168e83449a3dcc2e05763097b6efa38a72cbe8a864048c10/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f7269766572736c65692f7061796d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cyd622/payment/stats)

---

所有的支付接入请看文档操作。如果文档遇到问题可通过后面提供的方式联系到我。

- [Payment3.x 使用教程](https://helei112g.github.io/categories/payment-3/) (推荐的版本)
- [Payment2.x 使用教程](https://helei112g.github.io/categories/payment/)

---

当前支持 `微信`、`支付宝`、`招商一网通` 三个渠道：

- **微信支付**：刷卡支付、公众号支付、扫码支付、APP支付、H5支付、小程序支付全部支持；
- **支付宝支付**：手机网站支付、APP支付、扫码支付、条码支付、电脑网站支付（即时到账）全部支持；
- **招商一网通**：app支付、手机网站支付（实际上是同一种支付，但是可用于该两种场景）。

支持所有第三方的支付订单查询、退款操作、退款订单状态查询。同时支持支付宝与微信的转账操作。

安装Payment
=========

[](#安装payment)

`Payment` 需要 `PHP >= 5.6`，并且需要安装以下扩展：

```
- cURL extension

- mbstring

- BC Math

```

- **安装方式一**

通过composer，这是推荐的方式，可以使用composer.json 声明依赖，或者直接运行下面的命令。

```
    composer require "cyd622/payment:~3.1"
```

放入composer.json文件中

```
    "require": {
        "cyd622/payment": "~3.1"
    }
```

然后运行

```
composer update

```

- **安装方式二**

直接下载放入自己的项目中，通过 `require` 的方式引用代码。极度不推荐

Change Log
==========

[](#change-log)

- 加入招商一网通支付，加入详细的demo(from v3.1.0)
- 支付宝密钥支持字符串、文件两种方式配置，微信支持HMAC-SHA256加密（from v3.0.1）
- 支持支付宝rsa2签名 加入支付宝当面付-条码支付(条码与声波两种模式) 微信加入刷卡支付、小程序支付、H5支付 提供客户端静态调用类 不再兼容支付宝老版本接口（from v3.0.0）
- 支持支付宝新版本支付接口（from v2.7.0）
- 配置文件控制权限由使用者控制（from v2.0.0）

---

Payment 能够做什么
=============

[](#payment-能够做什么)

Paymeng 主要帮助 php 开发者在服务端快速接入主流的支付平台(支付宝支付、微信支付等)。节省时间少走弯路。

Payment 针对不同支付平台，提供了统一的调用方式，开发者无需再一个平台一个平台的去阅读文档、调试。所有的支付平台后台服务统一用一套代码，在支付对接模块的代码维护量大大减少，可以把更多的时间和精力花在自身产品的核心业务上

为什么要用Payment SDK
----------------

[](#为什么要用payment-sdk)

所有的支付官方都提供了demo，方便开发者学习使用。但是其中每一个支付 demo 都不尽相同，并且不少 官方 demo 还有不少错误，让开发者使用的时候莫名其妙。

针对不同的支付，官方demo写法各异，很多还使用了老旧的 php 语法。

而 **Payment SDK** 针对不同服务商的支付功能，都提供统一的调用方式，大大降低学习与使用成本。

与其他聚合支付服务的对比
------------

[](#与其他聚合支付服务的对比)

这里最主要的对比对象是ping++。当然我这个个人开发者肯定没法与之相比。首先ping++服务更多，接入的支付种类更多。开放出来的接口也更多。

但是本sdk的优势也非常明显。

- 使用项目自己部署，只需向第三方支付服务提供者付费（阿里、腾讯）。
- 项目开源，遵循 **MIT** 许可证，大家可自由更改。
- 根据自己需求，可以自己动手定义个性化。
- 通过composer安装管理，方便升级。
- 就算我以后不维护升级了，也保证你代码可用，如果用第三方聚合的支付，与第三方就有了强关联。

联系&amp;打赏
=========

[](#联系打赏)

如果真心觉得项目帮助到你，为你节省了成本，欢迎鼓励一下。

如果有什么问题，可通过以下方式联系我。提供有偿技术服务。

也希望更多朋友可用提供代码支持。欢迎交流与大赏。

感谢朋友们的支持：[支持名单](SUPPORT.md)

License
=======

[](#license)

The code for Payment is distributed under the terms of the MIT license (see [LICENSE](LICENSE)).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity69

Established project with proven stability

 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

Every ~15 days

Recently: every ~30 days

Total

29

Last Release

3188d ago

Major Versions

v1.2 → v2.02016-07-27

v2.7.3 → v3.0.02017-03-07

PHP version history (3 changes)v1.0PHP &gt;=5.5

v1.2PHP &gt;=5.4

v2.7.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/02c55ee9be8de95608e5ed6d9bcefff86f3c5a15f49da5b9aa9ce8a4a28f85cc?d=identicon)[tonywang](/maintainers/tonywang)

---

Top Contributors

[![helei112g](https://avatars.githubusercontent.com/u/10877127?v=4)](https://github.com/helei112g "helei112g (228 commits)")

---

Tags

sdkalipayweixin

### Embed Badge

![Health badge](/badges/cyd622-payment/health.svg)

```
[![Health](https://phpackages.com/badges/cyd622-payment/health.svg)](https://phpackages.com/packages/cyd622-payment)
```

###  Alternatives

[riverslei/payment

支付宝支付、微信支付、招商一网通支付php SDK。方便快速接入，最完整的开源支付 php sdk

2.4k155.5k2](/packages/riverslei-payment)

PHPackages © 2026

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