PHPackages                             youhujun/bs-pay-sdk - 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. youhujun/bs-pay-sdk

ActiveLibrary[Payment Processing](/categories/payments)

youhujun/bs-pay-sdk
===================

hui fu dou gong Quick Payment sdk

1.0.0(3y ago)142MITPHP

Since Oct 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/youhujun/bs-pay-sdk)[ Packagist](https://packagist.org/packages/youhujun/bs-pay-sdk)[ RSS](/packages/youhujun-bs-pay-sdk/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

一安装
===

[](#一安装)

```
 composer require youhujun/bs-pay-sdk

```

二使用
===

[](#二使用)

```
 require_once __DIR__."/../vendor/autoload.php";

```

三定义常量
=====

[](#三定义常量)

```
 ini_set('date.timezone', 'Asia/Shanghai');
if (!defined("SDK_BASE")) {
    define("SDK_BASE", __DIR__);
}

# sdk 版本号
if (!defined("SDK_VERSION")) {
    define("SDK_VERSION", "php#v2.0.0");
}

# api 接口版本号
if (!defined("API_VERSION")) {
    define("API_VERSION", "2.0.0");
}

# 设置是否调试模式
if (!defined("DEBUG")) {
    define("DEBUG", false);
}

# 设置调试日志路径
if (!defined("LOG")) {
    define("LOG", dirname(SDK_BASE) . "/log");
}

# 设置生产模式
if (!defined("PROD_MODE")) {
    define("PROD_MODE", true);
}

```

四使用示例
=====

[](#四使用示例)

```
use YouHuJun\BsPaySdk\core\BsPay;

use YouHuJun\BsPaySdk\request\V2MerchantBusiOpenRequest;
use YouHuJun\BsPaySdk\core\BsPayClient;

BsPay::init('./config/config.json');

$request = new V2MerchantBusiOpenRequest();

$param = array(
"funcCode" => $request->getFunctionCode(),
"params" => array(
    "req_seq_id" => date("YmdHis").mt_rand(),
    "req_date" => date("Ymd"),
    "huifu_id" => "6666000104778898",
    "upper_huifu_id" => "6666000003080000",
    "balance_pay_config" => json_encode(array(
        "fee_rate" =>"2",
        "fee_fix_amt" =>"1",
    ),JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES),
));

$client = new BsPayClient();

$result = $client->postRequest($param);

// p($result);die;

    if (!$result || $result->isError())
    {  //失败处理
        p($result -> getErrorInfo());
    }
    else
    {    //成功处理
        p($result);
    }

if(function_exists('p'))
{
    function p($param)
    {
        echo "";
        print_r($param);
        echo "";
    }
}

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

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

Unknown

Total

1

Last Release

1346d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34862444?v=4)[游鹄君](/maintainers/youhujun)[@youhujun](https://github.com/youhujun)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/youhujun-bs-pay-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/youhujun-bs-pay-sdk/health.svg)](https://phpackages.com/packages/youhujun-bs-pay-sdk)
```

###  Alternatives

[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)

PHPackages © 2026

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