PHPackages                             xplwechat/weixin - 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. xplwechat/weixin

ActiveYii2-extension[Payment Processing](/categories/payments)

xplwechat/weixin
================

yii2微信支付组件

v0.1(8y ago)526MITPHP

Since Apr 1Pushed 8y ago1 watchersCompare

[ Source](https://github.com/q490880/yii2-wxpay)[ Packagist](https://packagist.org/packages/xplwechat/weixin)[ RSS](/packages/xplwechat-weixin/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

yii2-wxpay
==========

[](#yii2-wxpay)

yii2微信支付组件

[CHANGE LOG](CHANGELOG.md)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require xplwechat/weixin

```

or add

```
"xplwechat/weixin": "*"
```

to the `require` section of your composer.json.

Configuration
-------------

[](#configuration)

To use this extension, simply add the following code in your application configuration:

```
return [
    //....
    'components' => [
        'wxpay'=>[
            'class'=>'xplwechat\weixin\Wxpay',
            'back_url'=> '回调地址',
            'app_id'=>'APPID',
            'mch_id'=>'MCHID',
            'key'=>'KEY',
            'app_secret'=>'APPSECRET',
            'ssl_cert_path'=>'../cert/apiclient_cert.pem',
            'ssl_key_path'=>'../cert/apiclient_key.pem',
            'curl_proxy_host'=>'0.0.0.0',
            'curl_proxy_port'=>0,
            'report_level'=>1,
        ],
    ],
];

[生成支付信息]
$result = \Yii::$app->wxpay->unifiedOrder([
                'attach'=>'扩展字段',
                'out_trade_no'=>'订单号',
                'price'=>'价格(分)',
                'body'=>'商品描述',
                'tag'=>'商品标签',
                'id'=>'商品ID',
            ])
将result通过json形式返给客户端即可

[回调代码]
--------------------
$result = false;
if($notifyData = \Yii::$app->wxpay->notify()){
	$result = "回调逻辑";
}
if($result){
	echo '';
}else{
	echo '';
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

2961d ago

### Community

Maintainers

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

---

Tags

yii2wechatWxpay

### Embed Badge

![Health badge](/badges/xplwechat-weixin/health.svg)

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

###  Alternatives

[hyperbolaa/wechatpay

微信支付在laravle5中的封装

471.3k](/packages/hyperbolaa-wechatpay)[guanguans/yii-pay

适配于 Yii 的 alipay 和 wechat 的支付扩展包

515.5k](/packages/guanguans-yii-pay)

PHPackages © 2026

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