PHPackages                             guoguo882010/wecaht-pay - 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. guoguo882010/wecaht-pay

ActiveLibrary

guoguo882010/wecaht-pay
=======================

A WeChat Pay SDK and helper for seamless payment integration

1.0.2(9mo ago)00MITPHPPHP &gt;=7.1

Since Aug 15Pushed 9mo agoCompare

[ Source](https://github.com/guoguo882010/wecaht-pay)[ Packagist](https://packagist.org/packages/guoguo882010/wecaht-pay)[ RSS](/packages/guoguo882010-wecaht-pay/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

微信支付
====

[](#微信支付)

---

**安装**

```
composer require guoguo882010/wecaht-pay
```

**使用方法**

```
$config = [

    //商户号
    'mch_id'      => 1111,

    // 商户API证书
    'private_key' => __DIR__ . '/test_key.pem',
    'certificate' => __DIR__ . '/test_cert.pem',

    // v3 API 秘钥
    'secret_key'  => 'xxxxx',
];

$pay = new \RSHDSDK\WechatPay\WechatPay($config);

//获取调取小程序支付所需参数
$body = [
    'appid'        => 'wxd333333',
    'mchid'        => '333333',//商户号
    'description'  => 'Image形象店-深圳腾大-QQ公仔',
    'out_trade_no' => '121775250128',//商户订单号
    'notify_url'   => 'https://www.weixin.qq.com/wxpay/pay.php',//回调地址
    'amount'       => [
        'total'    => 100,//金额
        'currency' => 'CNY',//货币固定是CNY
    ],
    'payer'        => [
        'openid' => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o'//用户微信openid
    ]
];
$pay->miniPayJSAPI('小程序appid', $body);

//申请退款
$body = [
    //transaction_id 和 out_trade_no 二选一
    'transaction_id' => '微信订单号',
    'out_trade_no'   => '商户订单号',
    'out_refund_no'  => '商户系统内部的退款单号',
    'notify_url'     => '回调地址',
    'amount' => [
            'total'=>100//退款金额
            'currency'=>'CNY'//货币固定是CNY
        ],
];
$pay->refund($body);

//根据商户订单号查询订单
$pay->OrderQueryByOutTradeNo('商户订单号');

//根据微信订单号查询订单
$pay->OrderQueryByTransactionId('微信订单号');

//根据商户订单号查询退款状态
$pay->QueryRefundByOutRefundNo('商户订单号');

//根据商户订单号关闭订单，无返回值
$pay->CloseOrder('商户订单号');

//支付回调获取解密
$pay->PaymentCallback('待解密数据数组');

//退款回调获取解密数据
$pay->RefundCallback('待解密数据数组');
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance58

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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

3

Last Release

270d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b57028d0ae01c0a3e0a63cf818bff6b9d6ec8f8b92c506ac6a344d42e1dfea8?d=identicon)[gk](/maintainers/gk)

---

Top Contributors

[![guoguo882010](https://avatars.githubusercontent.com/u/3445260?v=4)](https://github.com/guoguo882010 "guoguo882010 (10 commits)")

### Embed Badge

![Health badge](/badges/guoguo882010-wecaht-pay/health.svg)

```
[![Health](https://phpackages.com/badges/guoguo882010-wecaht-pay/health.svg)](https://phpackages.com/packages/guoguo882010-wecaht-pay)
```

PHPackages © 2026

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