PHPackages                             kbit/addons-payment - 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. kbit/addons-payment

ActiveKbit-addons[Payment Processing](/categories/payments)

kbit/addons-payment
===================

微信、支付宝支付工厂

1.1.0(4y ago)014MITPHPPHP &gt;=7.0.0

Since Mar 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/karma617/kbit-addons-payment)[ Packagist](https://packagist.org/packages/kbit/addons-payment)[ RSS](/packages/kbit-addons-payment/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

介绍
--

[](#介绍)

该插件为支付宝和微信支付聚合类，所有的支付只需要new一个对象即可纵享丝滑，接入简单，使用方便。

附带Thinkphp使用例程。

测试运行环境：php &gt;= 7.3

### 已支持的支付驱动

[](#已支持的支付驱动)

> wechat\_qr 微信扫码
>
> wechat\_js 微信jsapi
>
> wechat\_mini 微信小程序
>
> wechat\_mweb 微信H5
>
> wechat\_app 微信app
>
> alipay 支付宝即时到帐
>
> alipay\_app 支付宝app
>
> alipay\_scan 支付宝当面付

### 配置项字段说明

[](#配置项字段说明)

- 支付宝

    > app\_id 应用ID
    >
    > aes AES密钥
    >
    > private\_key 商户私钥
    >
    > public\_key 支付宝公钥
    >
    > notify\_url 异步回调地址
    >
    > return\_url 同步跳转地址
    >
    > payment\_callback 支付回调方法（thinkphp框架内：支付成功后执行，格式：模块/控制器/方法）
    >
    > refund\_callback 退款回调方法（thinkphp框架内：退款成功后执行，格式：模块/控制器/方法）
- 微信

    > appid AppId
    >
    > secret Secret
    >
    > mch\_id 支付商户号
    >
    > key API密钥
    >
    > cert\_pem 证书文件正文（不含头尾）
    >
    > key\_pem 证书秘钥正文（不含头尾）
    >
    > notify\_url 异步回调地址
    >
    > payment\_callback 支付回调方法（thinkphp框架内：支付成功后执行，格式：模块/控制器/方法）
    >
    > refund\_callback 退款回调方法（thinkphp框架内：退款成功后执行，格式：模块/控制器/方法）

### 使用方法

[](#使用方法)

> // new 一个工厂类，传入支付模块名称和配置信息
>
> $options = \[ 'appid' =&gt; '' 'mch\_id' =&gt; '', 'key' =&gt; '', 'cert\_pem' =&gt; '', 'key\_pem' =&gt; '', 'notify\_url' =&gt; '', 'payment\_callback' =&gt; '', 'refund\_callback' =&gt; '', \];
>
> $factory = new \\kbitAddons\\payment\\Factory('wechat\_js', $options);
>
> // 执行对应方法，传入相关参数即可
>
> $rs = $factory-&gt;\_\_call('\_submit', \[
>
> ​ 'out\_trade\_no' =&gt; $param\['order\_no'\],
>
> ​ 'total\_fee' =&gt; $param\['money'\]\*100,
>
> ​ 'body' =&gt; $param\['body'\],
>
> ​ 'detail' =&gt; $param\['subject'\],
>
> ​ 'openid' =&gt; $param\['openid'\],
>
> \]);

### 接口类方法

[](#接口类方法)

> */\* 支付提交接口 \*/*
>
> public function \_submit($param);
>
> */\* 同步通知接口 \*/*
>
> public function \_sync($param);
>
> */\* 异步通知接口 \*/*
>
> public function \_async($param);
>
> */\* 退款提交接口 \*/*
>
> public function \_refundSubmit($param);
>
> */\* 同步退款通知接口 \*/*
>
> public function \_syncRefund($param);
>
> */\* 异步退款通知接口 \*/*
>
> public function \_asyncRefund($param);

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Total

2

Last Release

1521d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3fdf8fab5c253576dbca252a148ee961e073121916690de6f22d378cf937cd4c?d=identicon)[woaitt617](/maintainers/woaitt617)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/kbit-addons-payment/health.svg)

```
[![Health](https://phpackages.com/badges/kbit-addons-payment/health.svg)](https://phpackages.com/packages/kbit-addons-payment)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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