PHPackages                             ledc/wechatpay-profit-sharing - 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. ledc/wechatpay-profit-sharing

ActiveLibrary[Payment Processing](/categories/payments)

ledc/wechatpay-profit-sharing
=============================

微信支付普通直连分账

v7.1.2(5mo ago)0281MITPHPPHP &gt;=7.4

Since Oct 14Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/ledccn/wechatpay-profit-sharing)[ Packagist](https://packagist.org/packages/ledc/wechatpay-profit-sharing)[ RSS](/packages/ledc-wechatpay-profit-sharing/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (15)Used By (1)

微信支付普通直连分账
==========

[](#微信支付普通直连分账)

安装
--

[](#安装)

`composer require ledc/wechatpay-profit-sharing`

使用说明
----

[](#使用说明)

1. 安装完之后，请执行以下命令，安装插件的数据库迁移文件 `php think install:migrate:wechatpay-profit-sharing`
2. 执行数据库迁移 `php think migrate:run`

开箱即用，只需要传入一个配置，初始化一个实例即可：

```
use Ledc\WechatPayProfitSharing\Config;
use Ledc\WechatPayProfitSharing\ProfitService;

$config = [
    'mch_id' => 1360649000,
    'appid' => 1360649000,

    // 商户证书
    'private_key' => __DIR__ . '/certs/apiclient_key.pem',
    'certificate' => __DIR__ . '/certs/apiclient_cert.pem',

     // v3 API 秘钥
    'secret_key' => '43A03299A3C3FED3D8CE7B820Fxxxxx',

    // v2 API 秘钥
    'v2_secret_key' => '26db3e15cfedb44abfbb5fe94fxxxxx',

    // 平台证书：微信支付 APIv3 平台证书，需要使用工具下载
    // 下载工具：https://github.com/wechatpay-apiv3/CertificateDownloader
    'platform_certs' => [
        // 请使用绝对路径
        // '/path/to/wechatpay/cert.pem',
    ],
];

$profitService = new ProfitService(new Config($config));
```

在创建实例后，所有的方法都可以有IDE自动补全；例如：

```
// 添加分账接收方
$profitService->addReceiver();
// 删除分账接收方
$profitService->removeReceiver();
// 请求单次分账（请求需要双向证书）
$profitService->single();
// 请求多次分账（请求需要双向证书）
$profitService->multi();
// 查询分账结果
$profitService->query();
// 完结分账（请求需要双向证书）
$profitService->finish();
// 查询订单待分账金额
$profitService->orderAmountQuery();
// 分账回退（请求需要双向证书）
$profitService->return();
// 回退结果查询
$profitService->returnQuery();
```

官方文档
----

[](#官方文档)

- [https://pay.weixin.qq.com/wiki/doc/api/allocation.php?chapter=26\_1](https://pay.weixin.qq.com/wiki/doc/api/allocation.php?chapter=26_1)

捐赠
--

[](#捐赠)

[![reward](reward.png)](reward.png)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance73

Regular maintenance activity

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

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

Recently: every ~96 days

Total

14

Last Release

153d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4af14254189bc74029cc40f4206f8006872b0cd092c680201f204a85a490f143?d=identicon)[ledccn](/maintainers/ledccn)

---

Top Contributors

[![ledccn](https://avatars.githubusercontent.com/u/53997080?v=4)](https://github.com/ledccn "ledccn (18 commits)")

### Embed Badge

![Health badge](/badges/ledc-wechatpay-profit-sharing/health.svg)

```
[![Health](https://phpackages.com/badges/ledc-wechatpay-profit-sharing/health.svg)](https://phpackages.com/packages/ledc-wechatpay-profit-sharing)
```

###  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)
