PHPackages                             imdao/helei112g\_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. imdao/helei112g\_payment

ActiveLibrary[Payment Processing](/categories/payments)

imdao/helei112g\_payment
========================

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

v4.1.3(8y ago)018MITPHPPHP &gt;=5.6

Since Jun 16Pushed 8y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (38)Used By (0)

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

---

提醒：发现有人将我提供的支付宝测试账号乱修改资料，打广告。请大家不要加上面的任何联系方式。如果再发现，我就把测试账号注销了（怕大家被骗）
--------------------------------------------------------------------

[](#提醒发现有人将我提供的支付宝测试账号乱修改资料打广告请大家不要加上面的任何联系方式如果再发现我就把测试账号注销了怕大家被骗)

- [Payment使用文档](https://helei112g1.gitbooks.io/payment-sdk/content/)
- [Payment使用常见问题汇总](https://helei112g1.gitbooks.io/payment-sdk/content/faq.html)

---

>

Payment 需要 PHP &gt;= 5.6以上的版本，并且同时需要PHP安装以下扩展

```
- cUR extension

- mbstring

- BC Math

- Guzzle

```

guzzle 是一个开源的php http请求lib，[项目地址](https://github.com/guzzle/guzzle)

 **成都本地内推微信公众号，有需要的拿走:**

 [![](https://camo.githubusercontent.com/9f7c62fe9aa2cc0e0e6c3a4d0386cd0c2f1c56f9390a6bfdab841a0f40a78d73/687474703a2f2f6f6c35396e717231692e626b742e636c6f7564646e2e636f6d2f6e6569747569736f6c6f67616e2e6a706567)](https://camo.githubusercontent.com/9f7c62fe9aa2cc0e0e6c3a4d0386cd0c2f1c56f9390a6bfdab841a0f40a78d73/687474703a2f2f6f6c35396e717231692e626b742e636c6f7564646e2e636f6d2f6e6569747569736f6c6f67616e2e6a706567) [![](https://camo.githubusercontent.com/b4ed02179a1f8842921d0d40b6dd58317985fc854ae913de6f338598a070af05/687474703a2f2f6f6c35396e717231692e626b742e636c6f7564646e2e636f6d2f6e656974756971722e6a706567)](https://camo.githubusercontent.com/b4ed02179a1f8842921d0d40b6dd58317985fc854ae913de6f338598a070af05/687474703a2f2f6f6c35396e717231692e626b742e636c6f7564646e2e636f6d2f6e656974756971722e6a706567)

Payment是什么？
===========

[](#payment是什么)

Payment是一个集成了 **支付宝支付**、**微信支付**、**招商支付**的PHP SDK。服务端开发者将它集成到自己的项目中，可以方便的通过相同的操作方式进行各项支付操作。不在需要开发者去单独了解支付宝、微信、招商的接口文档。以发起支付举例，开发者只需要通过：

```
try {
    $str = Charge::run(支付类型, 配置文件, 支付数据);
} catch (PayException $e) {
    echo $e->errorMessage();
    exit;
}

```

就可以得到支付结果返回数据。关心的核心只需要正确了解如何组装**支付数据**，以及如何正确处理返回后的数据即可。

Payment支持所有的PHP项目，只要求PHP版本大于等于5.6即可。同时支持composer与手动引入两种安装方式。

当前支持的接口
=======

[](#当前支持的接口)

当前sdk仅接入了支付宝支付、微信支付、招商支付（支付、退款）。中国现在电子支付的公司巨多，无法一一接入，欢迎各位发扬自己动手、丰衣足食的光荣传统，提交**PR**给我，代码贡献指南 [看这里](CONTRIBUTING.md)

支付宝接口
-----

[](#支付宝接口)

- **APP支付**（接入支付宝SDK，用户支付时唤起支付宝完成支付）
- **手机网站支付**（移动端唤起支付宝钱包或网页收银台完成支付）
- **电脑网站支付**（用户通过支付宝完成支付，交易款项即时到账）-原即时到账
- **当面付**（商户扫码首款或用户扫码付款）
- **单笔转账到支付宝**（支付宝商户向其它支付宝账户单笔转账）
- **交易支付、转账、退款查询接口**
- **交易退款接口**
- 对账单下载（待开发）
- 交易结算接口（待开发）
- 交易关闭接口（待开发）

微信支付接口
------

[](#微信支付接口)

- **刷卡支付**（用户打开微信钱包的刷卡界面，商户扫码后提交完成交易）
- **公众号支付**（用户在微信内进入商家的H5页面，页面内调用JSSDK完成支付）
- **扫码支付**（用户打开扫一扫，扫码商户二维码完成支付）
- **APP支付**（商户APP中集成微信SDK，用户点击后跳转到微信完成支付）
- **H5支付**（用户在微信以外的浏览器请求微信支付的场景唤起微信支付）
- **小程序支付**（用户在微信小程序中使用微信支付）
- **企业付款**（企业向用户付款）
- **交易支付、转账、退款查询接口**
- **交易退款接口**
- 对账单下载（待开发）
- 现金红包（待开发）
- 代金券或立减优惠券（待开发）

招商支付
----

[](#招商支付)

- **用户签约**（首次使用招商支付的用户完成绑卡操作）
- **招商一网通支付**（发起支付请求，招商支付仅此一个接口）
- **交易退款**
- **查询招商公钥**
- **交易支付、退款查询**
- 查询入账明细（待开发）
- 查询协议（待开发）
- 取消协议（待开发）

安装
--

[](#安装)

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

```
    composer require "riverslei/payment:~4.0.0"
```

放入composer.json文件中

```
    "require": {
        "riverslei/payment": "~4.0.0"
    }
```

然后运行

```
composer update

```

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

[](#change-log)

- 接入支付宝电脑网站支付、微信服务商模式支持(from v4.0.0)
- 加入招商一网通支付，加入详细的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）

---

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

[](#联系打赏)

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

 [![](https://camo.githubusercontent.com/b4102df50c87b7301913520678e8abda3185ebe4ce57c92d568f37f350fae5a1/687474703a2f2f6f6c35396e717231692e626b742e636c6f7564646e2e636f6d2f6d702d71722e6a7067)](https://camo.githubusercontent.com/b4102df50c87b7301913520678e8abda3185ebe4ce57c92d568f37f350fae5a1/687474703a2f2f6f6c35396e717231692e626b742e636c6f7564646e2e636f6d2f6d702d71722e6a7067)

个人公众号：icanfo

联系邮箱：dayugog@gmail.com

---

 [![](https://camo.githubusercontent.com/7ebf66f57f14e78054a58cf24080c52170114a2f26bf83a1eae9bfd732999087/687474703a2f2f6f6c35396e717231692e626b742e636c6f7564646e2e636f6d2f7061792d71722e6a70673f696d61676556696577322f322f772f3530302f682f343030)](https://camo.githubusercontent.com/7ebf66f57f14e78054a58cf24080c52170114a2f26bf83a1eae9bfd732999087/687474703a2f2f6f6c35396e717231692e626b742e636c6f7564646e2e636f6d2f7061792d71722e6a70673f696d61676556696577322f322f772f3530302f682f343030)

打赏扫这里，请留下尊姓大名

Contribution
============

[](#contribution)

[Contribution Guide](CONTRIBUTING.md)

License
=======

[](#license)

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

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 98.4% 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 ~12 days

Recently: every ~2 days

Total

37

Last Release

3157d ago

Major Versions

v1.2 → v2.02016-07-27

v2.7.3 → v3.0.02017-03-07

v3.1.1 → v4.0.02017-06-19

v3.1.4 → v4.0.12017-07-05

v3.x-dev → v4.1.32017-09-21

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/f29eecb96c77d751186fafd17f801e31cb8cae628cae2123f8799d6d8cdf182b?d=identicon)[imdao](/maintainers/imdao)

---

Top Contributors

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

---

Tags

sdkalipayweixin

###  Code Quality

TestsCodeception

### Embed Badge

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

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

###  Alternatives

[riverslei/payment

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

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

Wechat and Alipay payment SDK

383.4k](/packages/fantasystudio-easypay)

PHPackages © 2026

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