PHPackages                             xubin/wxpayapi - 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. xubin/wxpayapi

ActiveLibrary[Payment Processing](/categories/payments)

xubin/wxpayapi
==============

基于微信官方SDK的微信支付API封装

1.0.22(5y ago)0391MITPHPPHP &gt;=5.6

Since Mar 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/xubin727/wxpayapi)[ Packagist](https://packagist.org/packages/xubin/wxpayapi)[ RSS](/packages/xubin-wxpayapi/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)DependenciesVersions (18)Used By (0)

SDK 体验地址

快速搭建指南 ①、安装配置nginx+phpfpm+php ②、建SDK解压到网站根目录 ③、修改lib/WxPay.Config.php为自己申请的商户号的信息（配置详见说明） ⑤、下载证书替换cert下的文件 ⑥、搭建完成

SDK目录结构 |-- lib |-- logs `-- example

目录功能简介 lib API接口封装代码 WxPay.Api.php 包括所有微信支付API接口的封装 WxPay.Config.Interface.php 商户配置 , 业务需要从这里继承（请注意保管自己的密钥/证书等） WxPay.Data.php 输入参数封装 WxPay.Exception.php 异常类 WxPay.Notify.php 回调通知基类

cert 证书存放路径，证书可以登录商户平台[https://pay.weixin.qq.com/index.php/account/api\_cert下载](https://pay.weixin.qq.com/index.php/account/api_cert%E4%B8%8B%E8%BD%BD)注意: 1.证书文件不能放在web服务器虚拟目录，应放在有访问权限控制的目录中，防止被他人下载； 2.建议将证书文件名改为复杂且不容易猜测的文件名； 3.商户服务器要做好病毒和木马防护工作，不被非法侵入者窃取证书文件。

example 样例程序代码路径

example/phpqrcode 开源二维码php代码

logs 日志文件

※配置指南 MCHID = '1225312702'; 这里填开户邮件中的商户号

APPID = 'wx426b3015555a46be'; 这里填开户邮件中的（公众账号APPID或者应用APPID）

KEY = 'e10adc3949ba59abbe56e057f20f883e' 这里请使用商户平台登录账户和密码登录 平台设置的“API密钥”，为了安全，请设置为32字符串。

APPSECRET = '01c6d59a3f9024db6336662ac95c8e74' 改参数在JSAPI支付（open平台账户不能进行JSAPI支付）的时候需要用来获取用户openid，可使用APPID对应的公众平台登录 的开发者中心获取AppSecret。

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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

Total

17

Last Release

1880d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/929269?v=4)[Mr\_xu](/maintainers/xubin)[@xubin](https://github.com/xubin)

---

Top Contributors

[![xubin727](https://avatars.githubusercontent.com/u/7310942?v=4)](https://github.com/xubin727 "xubin727 (40 commits)")

### Embed Badge

![Health badge](/badges/xubin-wxpayapi/health.svg)

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

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