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

ActiveLibrary[Payment Processing](/categories/payments)

lwfdeveloper/wxpay
==================

1.0.4(4y ago)14MITPHPPHP &gt;=5.6

Since Nov 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/lwfdeveloper/wxpay)[ Packagist](https://packagist.org/packages/lwfdeveloper/wxpay)[ RSS](/packages/lwfdeveloper-wxpay/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

PHP-WeChatPay
=============

[](#php-wechatpay)

微信支付类

安装
--

[](#安装)

> composer require lwfdeveloper/wxpay

示例
--

[](#示例)

```
$options = [
    'appid' => 'you wechat appid',
    'key' => 'you key',
    'mch_id' => 'you wechat mch_id'
];

$weChatPay = \lwfdeveloper\wxpay\WeChatPay::getInstance($options);//实例化单例类

/** 订单号*/
$orderId = rand(000000, 999999) . date('YmdHisu') . rand(000000, 999999);
$openid = 'create wechat pay openid';
$reason = "create wechat pay order";

/** 支付金额*/
$amount = 100;
$callbackUrl = "http://api.develop.cn/api/wechat/callback";

#H5，微信小程序内发起支付
$response = $weChatPay->CreateWeChatOrder($orderId, $reason, $amount, $openid, $callbackUrl);
var_dump($response);

#App内发起微信支付
$responseApp = $weChatPay->CreateWeChatAppOrder($orderId, $reason, $amount, $callbackUrl);
var_dump($responseApp);
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Total

3

Last Release

1703d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16012785?v=4)[leiwenfeng](/maintainers/leiwenfeng)[@leiwenfeng](https://github.com/leiwenfeng)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)

PHPackages © 2026

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