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

ActiveLibrary

tinymeng/wechatpay-sdk
======================

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

v1.1.0(2y ago)117MITPHPPHP &gt;=7.1

Since May 16Pushed 2y ago1 watchersCompare

[ Source](https://github.com/majiameng/wechatpay-sdk-php)[ Packagist](https://packagist.org/packages/tinymeng/wechatpay-sdk)[ RSS](/packages/tinymeng-wechatpay-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

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

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

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

### 功能特点

[](#功能特点)

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

### 环境要求

[](#环境要求)

`PHP` &gt;= 7.1

### 使用方法

[](#使用方法)

1. Composer 安装。

    ```
    composer require tinymeng/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

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

2

Last Release

1094d ago

### Community

Maintainers

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

---

Top Contributors

[![majiameng](https://avatars.githubusercontent.com/u/24783993?v=4)](https://github.com/majiameng "majiameng (3 commits)")

---

Tags

wechatWxpay

### Embed Badge

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

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

###  Alternatives

[w7corp/easywechat

微信SDK

10.4k761.6k60](/packages/w7corp-easywechat)[yansongda/pay

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

5.3k1.2M53](/packages/yansongda-pay)[overtrue/laravel-wechat

微信 SDK for Laravel

3.0k1.8M53](/packages/overtrue-laravel-wechat)[overtrue/socialite

A collection of OAuth 2 packages.

1.4k5.5M87](/packages/overtrue-socialite)[yansongda/laravel-pay

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

1.1k353.2k9](/packages/yansongda-laravel-pay)[zoujingli/wechat-developer

WeChat and Alipay Platform Development

1.6k136.9k14](/packages/zoujingli-wechat-developer)

PHPackages © 2026

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