PHPackages                             tailroubin/wechatpay-sdk - 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. tailroubin/wechatpay-sdk

ActiveLibrary[Payment Processing](/categories/payments)

tailroubin/wechatpay-sdk
========================

微信支付第三方 PHP SDK，基于官方最新版本，包含V2和V3两种接口。

1.1.0(4mo ago)025MITPHPPHP &gt;=8.0

Since Sep 5Pushed 4mo agoCompare

[ Source](https://github.com/roumancode/wechatpay-sdk-php)[ Packagist](https://packagist.org/packages/tailroubin/wechatpay-sdk)[ RSS](/packages/tailroubin-wechatpay-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (3)Used By (0)

WeChatPay SDK for PHP
=====================

[](#wechatpay-sdk-for-php)

微信支付第三方 PHP SDK，基于官方最新版本，包含V2和V3两种接口。 forked from [`netcccyun/wechatpay-sdk-php`](https://github.com/netcccyun/wechatpay-sdk-php) 升级到php8.0+

### 功能特点

[](#功能特点)

- 根据微信支付最新API开发，相比官方SDK，功能更完善，代码更简洁
- 支持V2和V3两种接口，支持微信支付服务商模式与电商收付通模式
- 支持Composer安装，无需加载多余组件，可应用于任何平台或框架
- 符合`PSR`标准，你可以各种方便的与你的框架集成
- 基本完善的PHPDoc，可以随心所欲添加本项目中没有的API接口

### 环境要求

[](#环境要求)

`PHP` &gt;= 8.0

### 使用方法

[](#使用方法)

1. Composer 安装。

    ```
    composer require tailroubin/wechatpay-sdk
    ```
2. 创建APIv2配置文件 [`config.php`](./examples/config.php)，或APIv3配置文件 [`config.php`](./examples/V3/config.php)，填写微信支付商户信息。
3. 引入配置文件，构造请求参数，调用PaymentService中的方法发起请求，APIv2参考 [`examples/qrpay.php`](./examples/qrpay.php)，APIv3参考 [`examples/V3/qrpay.php`](./examples/V3/qrpay.php)
4. 更多实例，请移步 [`examples`](examples/) 目录。
5. 类功能说明

    类名说明PaymentService基础支付服务类，所有支付功能都用这个JsApiToolJSAPI支付工具类，用于公众号、小程序登录获取OpenidTransferService微信支付商家转账功能ProfitsharingService微信支付分账功能ComplainService消费者投诉处理功能PartnerPaymentService服务商基础支付服务类，APIv3服务商调用支付功能使用
6. 要对接的API在以上实现类中没有，可根据微信支付官方的文档，使用BaseService类中的execute方法直接调用接口，参考 [`examples/V3/other.php`](./examples/V3/other.php)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance75

Regular maintenance activity

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88% 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 ~165 days

Total

2

Last Release

135d ago

### Community

Maintainers

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

---

Top Contributors

[![netcccyun](https://avatars.githubusercontent.com/u/8541489?v=4)](https://github.com/netcccyun "netcccyun (22 commits)")[![roumancode](https://avatars.githubusercontent.com/u/111675596?v=4)](https://github.com/roumancode "roumancode (3 commits)")

---

Tags

wechatWxpay

### Embed Badge

![Health badge](/badges/tailroubin-wechatpay-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/tailroubin-wechatpay-sdk/health.svg)](https://phpackages.com/packages/tailroubin-wechatpay-sdk)
```

###  Alternatives

[yansongda/pay

可能是我用过的最优雅的 Alipay 和 WeChat 的支付 SDK 扩展包了

5.5k1.3M57](/packages/yansongda-pay)[yansongda/laravel-pay

专注 Alipay/WeChat/Unipay 的 laravel 支付扩展包

1.2k368.7k12](/packages/yansongda-laravel-pay)[lokielse/omnipay-wechatpay

Wechat gateway for Omnipay payment processing library

314225.9k7](/packages/lokielse-omnipay-wechatpay)[yansongda/hyperf-pay

可能是基于 hyperf 的最优雅的支付宝、微信、银联支付 SDK 了

9064.9k1](/packages/yansongda-hyperf-pay)[hyperbolaa/wechatpay

微信支付在laravle5中的封装

481.3k](/packages/hyperbolaa-wechatpay)[cccyun/wechatpay-sdk

微信支付第三方 PHP SDK，基于官方最新版本，包含V2和V3两种接口。

291.1k](/packages/cccyun-wechatpay-sdk)

PHPackages © 2026

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