PHPackages                             fastgoo/wxpay-car - 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. fastgoo/wxpay-car

ActiveLibrary[Payment Processing](/categories/payments)

fastgoo/wxpay-car
=================

微信支付 车主平台API接口SDK，主要对接停车这块的相关业务

0.7(7y ago)3211MITPHPPHP &gt;=7.0

Since Jan 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/fastgoo/wxpay-car)[ Packagist](https://packagist.org/packages/fastgoo/wxpay-car)[ Docs](https://github.com/fastgoo)[ RSS](/packages/fastgoo-wxpay-car/feed)WikiDiscussions master Synced today

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

 微信支付 ● 车主平台API

对接微信支付车主平台的API接口SDK，主要是为线下停车微信自动扣费提供便捷方式

 [![](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](https://github.com/fastgoo/wxpay-car) [![](https://camo.githubusercontent.com/a7c480ae8cad4fc2673864295714b784a3458ab67df7ef2c169694e2f3dc5f74/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d3e3d372d627269676874677265656e2e737667)](https://github.com/fastgoo/wxpay-car) [![](https://camo.githubusercontent.com/b3610f41affa4d54fee1e982fd7f23bf32dd7d51f6b52d797a9ba4baaf77c53a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652fe5beaee4bfa1e694afe4bb98e69687e6a1a32de69c8de58aa1e595862d3230373766662e737667)](https://pay.weixin.qq.com/wiki/doc/api/pap_sl_jt_v2.php?chapter=20_952&index=1) [![](https://camo.githubusercontent.com/ca7e3c733c51a2b2f5a7ae9d8b5a5063fabde40857caefdfeab170609d8f9063/68747470733a2f2f696d672e736869656c64732e696f2f62616467652fe5beaee4bfa1e694afe4bb98e69687e6a1a32de699aee9809ae59586e5aeb62d3230373766662e737667)](https://pay.weixin.qq.com/wiki/doc/api/pap_jt_v2.php?chapter=20_952&index=1)

---

### 已实现接口

[](#已实现接口)

- 用户状态查询
- 用户签约
- 用户入场通知
- 申请扣款
- 查询订单
- 申请退款
- 查询退款
- 车牌状态变更异步回调
- 扣费接口异步回调

#### 初始化实例

[](#初始化实例)

```
$config = [
    'mch_id' => '',//商户号
    'appid' => '',//商户号所绑定的公众号APPID
    'appsecret' => '',//商户号所绑定的公众号APPSECRET
    'key' => '',//微信支付的 加密key，在商户平台中可以看的到
    //'sub_mch_id' => '',//子商户的商户号，如果不是服务商没有子商户号的话，这个字段则不存在
    //'sub_appid' => '',//子商户绑定的appid，如果不是服务商没有子商户号的话，这个字段则不存在
    //'sub_appsecret' => '',//子商户绑定的appsecret，如果不是服务商没有子商户号的话，这个字段则不存在
    'sign_type' => 'HMAC-SHA256',//签名类型
    'trade_scene' => 'PARKING',//场景值
    'version' => '2.0',//版本号，固定的
    'jump_scene' => 'APP',//跳转场景：H5 | APP
];
$client = \CarPay\CarClient::init($config);
```

#### 用户状态查询

[](#用户状态查询)

说明：这里请求微信的接口需要catch异常错误，所有的非成功的返回结果都是属于异常错误

```
try {
    switch ($client->user()->getState($pnumber)) {
        case "NORMAL"://正常用户，已开通车主服务，且已授权访问
            //do something...
            break;
        case "PAUSED"://已暂停车主服务
            //do something...
            break;
        case "OVERDUE"://用户已开通车主服务，但欠费状态。提示用户还款，请跳转到车主服务
            //do something...
            break;
        case "UNAUTHORIZED"://用户未授权使用当前业务，或未开通车主服务。请跳转到授权接口
            //根据code获取到openid，然后获取授权所需的参数，传给 小程序 | h5 | APP 唤起微信签约
            $code = "";//code是需要授权才可以拿的到的，可以参考微信用户授权相关的流程
            $pnumber = "";
            $openid = $client->user()->getOpenidByCode($code);
            $authInfo = $client->user()->getAuthSign($openid, $pnumber);
            print_r($authInfo);
            break;
        default://异常状态类型
    }
} catch (\CarPay\Core\CarPayException $carPayException) {
    var_dump($carPayException->getMessage());
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity50

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 ~1 days

Total

7

Last Release

2666d ago

### Community

Maintainers

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

---

Top Contributors

[![fastgoo2](https://avatars.githubusercontent.com/u/160373799?v=4)](https://github.com/fastgoo2 "fastgoo2 (2 commits)")

---

Tags

payWXautopaycarpay

### Embed Badge

![Health badge](/badges/fastgoo-wxpay-car/health.svg)

```
[![Health](https://phpackages.com/badges/fastgoo-wxpay-car/health.svg)](https://phpackages.com/packages/fastgoo-wxpay-car)
```

###  Alternatives

[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[omnipay/payfast

PayFast driver for the Omnipay payment processing library

24626.9k3](/packages/omnipay-payfast)

PHPackages © 2026

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