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 1mo ago

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 22% 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

1658d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee87d5b66b94d162b7bbd6cca2152ab9766770422d02a0ce909db881e05dc71d?d=identicon)[leiwenfeng](/maintainers/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

[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)
