PHPackages                             beck/saobei - 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. beck/saobei

ActiveLibrary

beck/saobei
===========

saobei

041PHP

Since Dec 16Pushed 7y agoCompare

[ Source](https://github.com/ljh13043434556/saobei)[ Packagist](https://packagist.org/packages/beck/saobei)[ RSS](/packages/beck-saobei/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#安装 php composer require beck/saobei dev-master

```
wap支付

```

```
public function pay()
{
    $url = Pay::wapPay([
        'terminal_trace' => time(),
        'total_fee' => 1,
        'notify_url' => C('HTTP_HOST') . '/wxsite/public/payNotify',
        'token' => 'XXX',
        'merchant_no' => 'XXX',
        'terminal_id' => 'XXX',
    ]);

    echo $url;
}

```

```
     * 刷卡 ， （出示二维码支付）
     * @throws \Exception

```

```
public function pay2()
{

    set_time_limit(80);
    $result_ = Pay::barcodePay([
        'total_fee' => 1,
        'auth_no' => 'XXX',
        'token' => 'XXXXX'
    ]);

    echo '返回数据:';
    var_dump($result_);
    if($result_ === 1) {
        echo 'pay ok';die;
    }

    $i=15;
    while($i>0) {
        $result = Pay::query([
            'out_trade_no' => $result_->out_trade_no,
            'merchant_no' => 'XXXX',
            'terminal_id' => 'XXXX',
            'token' => 'XXXXX',
        ]);
        sleep(5);
        if($result->result_code == '01') {
            echo 'pay ok';die;
        }
        $i--;
    }

    echo 'pay error';

}

```

```
     * 接收支付回调数据

```

```
public function payNotify()
{
    trace(I('post.'), 'post');
    trace(I('put.'), 'put');
    Pay::payOk();
}

```

```
     * 验签支付通知令牌

```

```
public function checksign()
{

    $data = json_decode('[{"attach":"","channel_trade_no":"4200000210201812051300071136","end_time":"20181205201840","key_sign":"478a2b16c06e6073a5c78c511d69b3b3","merchant_name":"2018WebSdk对接专用(勿动)","merchant_no":"812400205000001","out_trade_no":"300516230021318120520183000002","pay_type":"010","receipt_fee":"1","result_code":"01","return_code":"01","return_msg":"支付成功","terminal_id":"30051623","terminal_time":"20181205201810","terminal_trace":"1544012290","total_fee":"1","user_id":"obnG9jnSlF_vh8gP7Mq7Ven6QSJ0"}]');

    $rst = Pay::dealCheckSign($data, 'XXXXX');

}

```

```
     * 查询支付状态

```

```
public function query()
{
    $result = Pay::query([
        'out_trade_no' => 'XXXXX',
        'merchant_no' => 'XXXXX',
        'terminal_id' => 'XXXXX',
        'token' => 'XXXXX',
    ]);

    var_dump($result);

}

```

```
     * 添加终端

```

```
public function addTerminal()
{
    $result = \saobei\Terminal::add([
        'inst_no' => 'XXXXX',
        'merchant_no' => 'XXXXXX',
        'key' => 'XXXXX',
    ]);

    var_dump($result);
}

```

```
         * 二维码支付

```

```
    public function prepay()
    {
        $params = [
            'pay_type' => I('pay_type'),
            'merchant_no' => I('merchant_no'),
            'terminal_id' => I('terminal_id'),
            'terminal_trace' => I('terminal_trace'),
            'total_fee' => intval(I('total_fee')),
            'token' => I('token'),
            'notify_url' => I('notify_url')
        ];

        foreach($params as $key => $val) {
            if(empty($val)) {
                api_return(-1, $key . '不能为空');
            }
        }

        try{
            $result = \saobei\Pay::prepay($params);
        }catch (\Exception $err) {
            api_return(-1, $err->getMessage());
        }

        api_return(1, 'ok', $result);

    }

```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3855291f808d493a6634930780d11ed1e2bf64b267e1b2670843b3779eb037bc?d=identicon)[17316809772](/maintainers/17316809772)

---

Top Contributors

[![ljh13043434556](https://avatars.githubusercontent.com/u/38057992?v=4)](https://github.com/ljh13043434556 "ljh13043434556 (14 commits)")

### Embed Badge

![Health badge](/badges/beck-saobei/health.svg)

```
[![Health](https://phpackages.com/badges/beck-saobei/health.svg)](https://phpackages.com/packages/beck-saobei)
```

PHPackages © 2026

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