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

ActiveQt-extend[Payment Processing](/categories/payments)

hxc/qt-pay
==========

支付

1.0.1(6y ago)0464MITPHPPHP &gt;=7.0.0

Since Jul 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/developer-hxc/qt-pay)[ Packagist](https://packagist.org/packages/hxc/qt-pay)[ RSS](/packages/hxc-qt-pay/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

桥通天下支付
======

[](#桥通天下支付)

使用要求
----

[](#使用要求)

```
php >= 7.0.0
ThinkPHP 5.0.*

```

安装
--

[](#安装)

```
$ composer require hxc/qt-pay
```

安装后将在`APP_PATH/app/controller/Qtpay.php`中生成代码，文件已存在则不覆盖。

配置文件
----

[](#配置文件)

配置文件位于`APP_PATH/extra/pay.php`，详细说明查看文件内注释。重点关注以下配置项。

```
'env' => 'production' //值：dev，production；dev开发环境：不走微信/支付宝支付，直接支付成功；production线上环境：走微信/支付宝支付
```

也可以在控制器初始化的时候传入配置，优先级高于配置文件。

```
protected function _initialize()
{
    $this->wx_config = [];//自定义微信支付所需参数，优先级高于配置文件
    $this->ali_config = [];//自定义支付宝所需参数，优先级高于配置文件
    $this->validate = '';  //自定义验证器，需填写完整类名
    $this->getConfig();//读取配置
}
```

如何使用
----

[](#如何使用)

- 只需要关心生成订单和支付成功回调的逻辑即可
- ```
    支付接口：/app/qtpay/pay
    * 参数：
    * 【tpye】：wechat，alipay
    * 【func】:app（app支付，微信/支付宝）,mp（公众号支付，微信）,wap（手机网站支付，微信/支付宝）,mini（小程序支付，微信/支付宝）,web（网页支付，支付宝）

    ```

**必须实现以下方法**

- getOrder($type)
    说明：获取订单参数 参数：`$type`为`wechat`、`alipay`或`dev`，标记支付方式
    返回：返回订单所需参数数组，参考支付宝或微信支付文档。
- notify($data, $flag)
    说明：处理支付回调
    参数：`$data`为回调数据；`$flag`为`wx`、`ali`或`dev`，标记支付方式
    返回：处理成功时必须返回布尔值`true`，其他值认为回调处理失败。支付平台将会按照他们的规则重试。

同时，提供以下方法

- queryOrder(array/string $order\_sn, string $type)
    说明：查询订单接口
    参数：`$order` 为 `string` 类型时，请传入系统订单号，对应支付宝或微信中的 `out_trade_no`； `array` 类型时，参数请参考支付宝或微信官方文档。`$type`请传入'wechat'或'alipay'。
    返回：查询成功，返回 `Yansongda\Supports\Collection` 实例，可以通过 `$colletion->xxx` 或 `$collection['xxx']` 访问服务器返回的数据。
    异常：`GatewayException` 或 `InvalidSignException`
- refund(array $order, $type)
    说明：退款接口
    参数：`$order` 数组格式，退款参数。`$type`请传入'alipay'或'wechat'。
    返回：退款成功，返回 `Yansongda\Supports\Collection` 实例，可以通过 `$colletion->xxx` 或 `$collection['xxx']` 访问服务器返回的数据。
    异常：`GatewayException` 或 `InvalidSignException`

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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.

###  Release Activity

Cadence

Every ~80 days

Total

2

Last Release

2429d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1bcb8fbaa18a32baca71997f5bdfa6c24621b21248bd32a47d24ce4fcce2c69f?d=identicon)[developer-hxc](/maintainers/developer-hxc)

---

Top Contributors

[![lvzhao1995](https://avatars.githubusercontent.com/u/17199728?v=4)](https://github.com/lvzhao1995 "lvzhao1995 (11 commits)")

### Embed Badge

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

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

###  Alternatives

[yansongda/laravel-pay

专注 Alipay/WeChat/Unipay 的 laravel 支付扩展包

1.1k353.2k9](/packages/yansongda-laravel-pay)[yansongda/hyperf-pay

可能是基于 hyperf 的最优雅的支付宝、微信、银联支付 SDK 了

8959.8k1](/packages/yansongda-hyperf-pay)[guanguans/yii-pay

适配于 Yii 的 alipay 和 wechat 的支付扩展包

515.5k](/packages/guanguans-yii-pay)[ibrand/pay

ibrand pay component

1316.0k1](/packages/ibrand-pay)

PHPackages © 2026

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