PHPackages                             tuowt/zhifu99 - 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. tuowt/zhifu99

ActiveLibrary[Payment Processing](/categories/payments)

tuowt/zhifu99
=============

网龙支付SDK

1.5.0(7y ago)0191MITPHPPHP &gt;=5.6

Since Jul 3Pushed 7y agoCompare

[ Source](https://github.com/tuowt/zhifu99)[ Packagist](https://packagist.org/packages/tuowt/zhifu99)[ RSS](/packages/tuowt-zhifu99/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (8)Dependencies (7)Versions (9)Used By (0)

zhifu99
=======

[](#zhifu99)

网龙集团统一支付接口

Composer 安装
-----------

[](#composer-安装)

```
composer require tuowt/zhifu99
```

Usage
-----

[](#usage)

### 服务端发起支付请求:

[](#服务端发起支付请求)

```
use Zhifu99\Factory;

// $config = Configure::read('zhifu99');
$config = [
    // 必要配置
    'appId'     => 'xxxx',
    // APP key 密钥
    'key'       => '',
    // 支付的来源 默认其他（0-其他；1-iOS；2-android；3-PC；4-xxx）
    'paySource' => '0',
    // 三位 ISO 货币代码
    'currency'  => 'CNY',
    // 你也可以在下单时单独设置来想覆盖它
    'notifyUrl' => '默认的订单回调地址',
];

$app = Factory::payment($config);

// 发起支付请求
$result = $app->order->unify([
    'userName'       => '用户名',
    'userId'         => '1',
    'orderNO'        => 'O123456',
    'channel'        => 'wx_mini',
    // 支付的来源,如果不设置则会使用配置里的支付来源
    'paySource'      => '0',
    'subject'        => '标题',
    'body'           => '腾讯充值中心-QQ会员充值',
    'expireDateTime' => date('Y-m-d H:i:s', strtotime("+1 day")),
    'amount'         => 88,
    // 支付结果通知网址,如果不设置则会使用配置里的默认地址
    'notifyUrl'      => 'https://pay.weixin.qq.com/wxpay/pay.action',
]);
```

### 服务器异步通知：

[](#服务器异步通知)

> 闭包中返回true 回调响应 success，其他都返回 fail

```
$app = Factory::payment($config);
// 业务处理
try {
    $response = $app->handlePaidNotify(function ($notify, $successful) use ($app) {
        if (!isset($notify['tradeNO']) || !isset($notify['tradeStatus'])) {
            return '订单错误';
        }
        // 查询订单接口，判断订单真实状态
        $wxOrder = $app->order->queryByTradeNo($notify['orderNO'], 'wx_pub_qr');
        if ($wxOrder['errorCode'] != 0 || strtoupper($wxOrder['msg']) != 'OK') {
            return '订单状态错误';
        }
        // 不考虑返回结果的多条，默认读取一条判断
        $orderInfo = json_decode($wxOrder['data']['OrderItems'], true);
        $orderInfo = array_shift($orderInfo);
        if(!in_array($orderInfo['TradeStatus'], [
            'TRADE_FINISHED',
            'TRADE_SUCCESS'
        ])) {
            return '订单状态错误';
        }

        return true;
    });

    // 直接返回回调处理后的结果
    return $response->send();
} catch (\Zhifu99\Kernel\Exceptions\Exception $e) {
    $this->log($e, LOG_DEBUG);
}
```

### 订单查询：

[](#订单查询)

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

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

```
// 订单号查询
$app->order->queryByTradeNo($tradeNo, $channel);
```

#### 订单查询：

[](#订单查询-1)

```
$params = [
    'orderNO'   => '',  // 必填
    'channel'   => '',  // 必填
    'username'  => '',  // 可选
];

$app->order->query($params);
```

### 订单取消：

[](#订单取消)

```
$params = [
    'orderNO'   => '',  // 必填
    'channel'   => '',  // 必填
    'username'  => '',  // 必填
];

$app->order->close($params);
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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 ~0 days

Total

8

Last Release

2916d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24466605?v=4)[cgd](/maintainers/Tuowt)[@tuowt](https://github.com/tuowt)

---

Top Contributors

[![tuowt](https://avatars.githubusercontent.com/u/24466605?v=4)](https://github.com/tuowt "tuowt (25 commits)")

---

Tags

sdkzhifu99

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tuowt-zhifu99/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k532.1M19.4k](/packages/laravel-framework)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M464](/packages/pimcore-pimcore)

PHPackages © 2026

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