PHPackages                             zfcaolei/pay - 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. zfcaolei/pay

ActiveLibrary

zfcaolei/pay
============

wxpay &amp;&amp; alipay

110PHP

Since Feb 7Pushed 6y agoCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

pay
===

[](#pay)

**//支付宝支付创建支付订单参数**

```
 $alipay  = new AliPay();

 $alipay -> alipay_gatewayUrl = "https://openapi.alipay.com/gateway.do"; //网关网址

 $alipay -> $alipay_appId = 'alipay_appId';  //appId

 $alipay -> $alipay_rsaPrivateKey = '' //私有密钥;

$alipay->alipay_rsaPublicKey = ''; //共有密钥

//$orderInfo    = $alipay->tradeAppPay($orderBody, $orderTitle, $out_trade_no, (float)$price,$return_url);

//将获取的参数返回给app端 jsonReturn是自定义的方法
jsonReturn(1, 2101003, ['payinfo'=>$orderInfo], '操作成功');

```

//支付成功回调回调

```
public function AliPayNotify()
{

    $request    = input('post.');

    //写入文件做日志 调试用
    $log = "\r\n\r\n".'==================='."\r\n".date("Y-m-d H:i:s")."\r\n".json_encode($request);
    @file_put_contents('upload/alipay.html', $log, FILE_APPEND);

    $signType = $request['sign_type'];
    $alipay = new AliPayApp();
    $flag = $alipay->rsaCheck($request, $signType);

    if ($flag) {
        //支付成功:TRADE_SUCCESS   交易完成：TRADE_FINISHED
        if ($request['trade_status'] == 'TRADE_SUCCESS' || $request['trade_status'] == 'TRADE_FINISHED') {
            //这里根据项目需求来写你的操作 如更新订单状态等信息 更新成功返回'success'即可
            $object =  json_decode(($request['fund_bill_list']),true);
            $trade_type     =   $object[0]['fundChannel'];
            $data    =    [
                'pay_status'        =>   1,
                'pay_type'          =>   1,
                'trade_type'        =>   $trade_type,
                'pay_time'          =>   strtotime($request['gmt_payment'])
            ];
            $buyer_pay_amount = $request['buyer_pay_amount'];
            $out_trade_no   =   $request['out_trade_no'];
            $saveorder      =   model('orders')->successPay($out_trade_no,$buyer_pay_amount,$data);
            if ($saveorder==1) {
                exit('success'); //成功处理后必须输出这个字符串给支付宝
            } else {
                exit('fail');
            }
        } else {
            exit('fail');
        }
    } else {
        exit('fail');
    }
}

```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

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/553c013bc5eac8fd938fade736f7cf340d89941317ff849bdb69a1c1482a6607?d=identicon)[zfcaolei](/maintainers/zfcaolei)

---

Top Contributors

[![zfcaolei](https://avatars.githubusercontent.com/u/28525349?v=4)](https://github.com/zfcaolei "zfcaolei (22 commits)")

### Embed Badge

![Health badge](/badges/zfcaolei-pay/health.svg)

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

PHPackages © 2026

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