PHPackages                             ooooliu/pay - 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. ooooliu/pay

ActiveLibrary[Payment Processing](/categories/payments)

ooooliu/pay
===========

For easy pay.

5751PHP

Since May 2Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ooooliu/pay)[ Packagist](https://packagist.org/packages/ooooliu/pay)[ RSS](/packages/ooooliu-pay/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

pay
===

[](#pay)

Alipay和WeChat的支付扩展包,后面会持续更新

laravel 扩展包请 [传送至这里](https://github.com/ooooliu/pay)

特点
--

[](#特点)

- 命名不那么乱七八糟
- 隐藏开发者不需要关注的细节
- 根据支付宝、微信最新 API 开发而成
- 高度抽象的类，免去各种拼json与xml的痛苦
- 符合 PSR 标准，你可以各种方便的与你的框架集成
- 文件结构清晰易理解，可以随心所欲添加本项目中没有的支付网关
- 方法使用更优雅，不必再去研究那些奇怪的的方法名或者类名是做啥用的

运行环境
----

[](#运行环境)

- PHP 5.6+
- composer

支持的支付网关
-------

[](#支持的支付网关)

由于各支付网关参差不齐，所以抽象了两个方法 `driver()`，`gateway()`。

两个方法的作用如下：

`driver()` ： 确定支付平台，如 `alipay`,`wechat`;

`gateway()`： 确定支付网关。通过此方法，确定支付平台下的支付网关。例如，支付宝下有 「电脑网站支付」，「手机网站支付」，「APP 支付」三种支付网关，通过传入 `web`,`wap`,`app` 确定。

### 1、支付宝

[](#1支付宝)

- 电脑支付
- 手机网站支付
- APP 支付

SDK 中对应的 driver 和 gateway 如下表所示：

drivergateway描述alipayweb电脑支付alipaywap手机网站支付alipayappAPP 支付alipayscan扫码支付alipaytransfer帐户转账(可用于平台用户提现)### 2、微信

[](#2微信)

- 公众号支付
- H5 支付
- APP 支付

SDK 中对应的 driver 和 gateway 如下表所示：

drivergateway描述wechatmp公众号支付wechatwapH5 支付wechatappAPP 支付wechatscan扫码支付wechattransfer企业付款支持的方法
-----

[](#支持的方法)

所有网关均支持以下方法

- pay(array $config\_biz)
    说明：支付接口
    参数：数组类型，订单业务配置项，包含 订单号，订单金额等
    返回：mixed 详情请看「支付网关配置说明与返回值」一节。
- refund(array|string $config\_biz, $refund\_amount = 0)
    说明：退款接口
    参数：`$config_biz` 为字符串类型仅对`支付宝支付`有效，此时代表订单号，第二个参数为退款金额。
    返回：mixed 退款成功，返回 服务器返回的数组；否则返回 false；
- close(array|string $config\_biz)
    说明：关闭订单接口
    参数：`$config_biz` 为字符串类型时代表订单号，如果为数组，则为关闭订单业务配置项，配置项内容请参考各个支付网关官方文档。
    返回：mixed 关闭订单成功，返回 服务器返回的数组；否则返回 false；
- find(string $out\_trade\_no)
    说明：查找订单接口
    参数：`$out_trade_no` 为订单号。
    返回：mixed 查找订单成功，返回 服务器返回的数组；否则返回 false；
- verify($data, $sign = null)
    说明：验证服务器返回消息是否合法
    参数：`$data` 为服务器接收到的原始内容，`$sign` 为签名信息，当其为空时，系统将自动转化 `$data` 为数组，然后取 `$data['sign']`。
    返回：mixed 验证成功，返回 服务器返回的数组；否则返回 false；

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/16f82b04aa78e86ad49902417f641952e9b3df8a4c8ddf9e3567eafe2621373c?d=identicon)[ooooliu](/maintainers/ooooliu)

---

Top Contributors

[![ooooliu](https://avatars.githubusercontent.com/u/15834565?v=4)](https://github.com/ooooliu "ooooliu (19 commits)")

### Embed Badge

![Health badge](/badges/ooooliu-pay/health.svg)

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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