PHPackages                             mangdin/thinkphp5.1-weixinpay - 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. mangdin/thinkphp5.1-weixinpay

ActiveLibrary[Payment Processing](/categories/payments)

mangdin/thinkphp5.1-weixinpay
=============================

thinkphp5.1 微信扫码支付

1.3(7y ago)395Apache-2.0PHP

Since Jul 25Pushed 7y agoCompare

[ Source](https://github.com/mangdin/thinkphp5.1-weixinpay)[ Packagist](https://packagist.org/packages/mangdin/thinkphp5.1-weixinpay)[ RSS](/packages/mangdin-thinkphp51-weixinpay/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)DependenciesVersions (5)Used By (0)

thinkphp5.1-weixinpay
=====================

[](#thinkphp51-weixinpay)

thinkphp5.1 微信网站扫码支付

将目录下的weixin\_pc\_pay.php移到config目录，修改对应参数即可。

公共函数：

```
/**
 * 微信扫码支付
 * @param  array $order 订单 必须包含支付所需要的参数 body(产品描述)、total_fee(订单金额)、out_trade_no(订单号)、product_id(产品id)
 */
function weixinpay($order){
    $order['trade_type']='NATIVE';
    $weixinpay = new mangdin\weixinpay\Weixinpay();
    return $weixinpay->pay($order);

}
```

控制器调用支付代码

```
/**
     * 微信PC 扫码支付
     * @param $orderid  订单ID
     */
    public function weixinpay($orderid){
        $order=array(
            'body'=>$subject['goods']['title'], //订单描述
            'total_fee'=>$price*100,  //订单金额
            'out_trade_no'=>$subject['sn'], //订单编号
            'product_id'=>$subject['goods']['id'] //商品ID，可不传
        );
        $url = weixinpay($order); //该URL地址即为扫码支付地址，将此地址转为二维码即可
    }
```

回调控制器代码

```
/**
     * notify_url接收页面
     */
    public function notify(){
        // 导入微信支付sdk
        $wxpay=new \mangdin\weixinpay\Weixinpay();
        $result=$wxpay->notify();
        if ($result) {
            // 验证成功 修改数据库的订单状态等 $result['out_trade_no']为订单号
        }
    }
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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

4

Last Release

2897d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/41657311?v=4)[mangdin](/maintainers/mangdin)[@mangdin](https://github.com/mangdin)

---

Top Contributors

[![mangdin](https://avatars.githubusercontent.com/u/41657311?v=4)](https://github.com/mangdin "mangdin (14 commits)")

### Embed Badge

![Health badge](/badges/mangdin-thinkphp51-weixinpay/health.svg)

```
[![Health](https://phpackages.com/badges/mangdin-thinkphp51-weixinpay/health.svg)](https://phpackages.com/packages/mangdin-thinkphp51-weixinpay)
```

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)

PHPackages © 2026

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