PHPackages                             ddliu/wxpay - 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. ddliu/wxpay

ActiveLibrary[Payment Processing](/categories/payments)

ddliu/wxpay
===========

Weixin pay SDK

v0.0.3(10y ago)4633MITPHP

Since Sep 23Pushed 10y ago2 watchersCompare

[ Source](https://github.com/ddliu/php-wxpay)[ Packagist](https://packagist.org/packages/ddliu/wxpay)[ RSS](/packages/ddliu-wxpay/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (4)Used By (0)

php-wxpay
=========

[](#php-wxpay)

微信支付PHP SDK

安装
--

[](#安装)

```
composer require ddliu/wxpay

```

使用
--

[](#使用)

### 配置

[](#配置)

```
use ddliu\wxpay\Config;

// 全局配置
Config::setGlobal([
    'APPID' => 'wx426b3015555a46be',
    'MCHID' => '1225312702',
    'KEY' => 'e10adc3949ba59abbe56e057f20f883e',
    'APPSECRET' => '01c6d59a3f9024db6336662ac95c8e74',
]);

```

### 通知示例

[](#通知示例)

```
use ddliu\wxpay\Notify;

$notify = new Notify();
$data = $notify->checkNotifyData();
if (!$data) {
    // 检查通知数据失败
    $notify->replyFail();
} elseif ($data['result_code'] == 'SUCCESS') {
    // 支付成功
    $orderNo = $data['out_trade_no'];

    // 查询数据库取得订单信息
    // $order = query_my_order($orderNo);

    // 处理成功逻辑

    // 响应通知
    $notify->replySuccess();
} else {
    // 处理失败逻辑
    // 检查通知数据失败
    $notify->replyFail();
}
```

关于
--

[](#关于)

本库基于[微信官方PHP SDK](https://pay.weixin.qq.com/wiki/doc/api/app.php?chapter=11_1)，使用的代码版权归原作者所有

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

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

Total

3

Last Release

3933d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b7cb651132ee314761f02f60a02dede47d7a94577923f742b4c79556434beeee?d=identicon)[ddliu](/maintainers/ddliu)

---

Top Contributors

[![ddliu](https://avatars.githubusercontent.com/u/797146?v=4)](https://github.com/ddliu "ddliu (8 commits)")

### Embed Badge

![Health badge](/badges/ddliu-wxpay/health.svg)

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

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18579.5k1](/packages/omnipay-coinbase)[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)[binkode/laravel-paystack

A description for laravel-paystack.

112.1k](/packages/binkode-laravel-paystack)

PHPackages © 2026

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