PHPackages                             18y/wechatpay - 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. 18y/wechatpay

ActiveLibrary

18y/wechatpay
=============

Just for fun

1.0.0(8y ago)1482MITPHPPHP &gt;=5.5.38

Since Apr 26Pushed 6y agoCompare

[ Source](https://github.com/18y/wechatpay)[ Packagist](https://packagist.org/packages/18y/wechatpay)[ Docs](https://github.com/18y)[ RSS](/packages/18y-wechatpay/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

项目介绍
====

[](#项目介绍)

这是一个根据微信支付官方demo (wxpayapi\_php\_v3) 所制作的 namespace 版

如果没看过支付文档，建议先看看[https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7\_1](https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_1 "支付文档")

官方的支付 sdk 已经很久未更新了，获取共享地址 editAddress 也早已废弃，

但是SDk 里面还有，因此踩了不少坑.. 共享地址[最新使用方式 JS SDK](https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_8&index=7)

此 SDK 里面将官方的 SDK 调整为命名空间, 方便学习使用

使用方式

> 使用 Composer 安装

```
composer require 18y/wechatpay

```

composer 安装之后将 /vendor/18y/wechatpay/example 目录复制到与 /vendor 同一目录下即可运行

> example 目录说明

`native.php` 刷卡支付(生成支付二维码)，不能使用localhost，使用ip打开，可以看到效果

`jsapi.php` 公众号支付(js唤起支付)，需要openid, 需要使用自己的正确配置

`notify.php` 支付成功回调地址，标志该笔订单支付成功。

配置文件所在位置

```
/vendor/18y/wechatpay/src/WxPayConfig.php

```

> 其他注意

微信支付目录填写规则

```
如支付页面为 http://127.0.0.1/wechat/pay.html
则支付目录为 http://127.0.0.1/wechat/
最后一个斜杠不能省略

使用tp框架时如 http://127.0.0.1/index/wechat/pay.html
则支付目录为 http://127.0.0.1/index/wechat/
最后一个斜杠不能省略

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

2935d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ffcee4b82bde4a845d1c3e31794220d4369d5fb04f3f92d4f339a9781cbfcdb2?d=identicon)[18y](/maintainers/18y)

---

Top Contributors

[![18y](https://avatars.githubusercontent.com/u/22790765?v=4)](https://github.com/18y "18y (8 commits)")

---

Tags

wechatpay18y

### Embed Badge

![Health badge](/badges/18y-wechatpay/health.svg)

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

###  Alternatives

[zoujingli/wechat-developer

WeChat and Alipay Platform Development

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

\[A\]Sync Chainable WeChatPay v2&amp;v3's OpenAPI SDK for PHP

589355.9k28](/packages/wechatpay-wechatpay)[wechatpay/wechatpay-guzzle-middleware

WechatPay API V3 Guzzle Middleware

208182.8k15](/packages/wechatpay-wechatpay-guzzle-middleware)[iwechatpay/openapi

为 wechatpay/wechatpay 增加IDE提示的接口描述包。

406.7k](/packages/iwechatpay-openapi)[glennraya/xendivel

A Laravel package to easily integrate Xendit payment gateway. It supports credit and debit cards, and e-wallet payments and custom invoices, queued notifications, webhook listeners and more.

412.3k](/packages/glennraya-xendivel)

PHPackages © 2026

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