PHPackages                             linyuee/ali - 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. linyuee/ali

ActiveLibrary[Payment Processing](/categories/payments)

linyuee/ali
===========

支付宝支付

1.0.3(8y ago)044MITPHPPHP &gt;=5.5

Since Jan 2Pushed 8y ago1 watchersCompare

[ Source](https://github.com/linyuee/ali)[ Packagist](https://packagist.org/packages/linyuee/ali)[ RSS](/packages/linyuee-ali/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

阿里工具包，包括支付宝支付
=============

[](#阿里工具包包括支付宝支付)

### 一、支付

[](#一支付)

#### 1、app支付

[](#1app支付)

```
$pay = new \Linyuee\AliPay('appid');
$biz_content = array('subject'=>'标题','out_trade_no'=>'订单号','total_amount'=>'金额单位分');
$pay->setFormat($biz_content);
$pay->setAppPrivateKey('app密钥');
$pay->setAliPayPublicKey('支付宝公钥');
$pay->setNotifyUrl('回调地址');
$res = $pay->unifiedorder();

```

返回示例：

"alipay\_sdk=alipay-sdk-php-20161101&amp;app\_id=20020302550&amp; biz\_content=%7B%22subject%22%3A%22%5Cu9510%5Cu516c%5Cu8003%5Cu8bfe%5Cu7a0b%5Cu8d2d%5Cu4e70%22%2C%22out\_trade\_no%22%3A14885469%2C%22total\_amount%22%3Anull%7D&amp; charset=UTF-8&amp;format=json&amp;method=alipay.trade.app.pay&amp; notify\_url=api.test.com%2Fapi%2Ftest&amp;sign\_type=RSA2&amp; timestamp=2017-12-21+15%3A14%3A51&amp;version=1.0&amp; sign=vPmIQUNxzYKDqb24udR2RNERpr6J8Kvd12XNc7i0q3iSv8l9QY12dWp3cVym4w6QA3rhDJesPcZw94I4s%2BA%3D%3D"

无需处理直接作为APP的请求参数直接请求支付宝的sdk

#### 2、手机网站支付

[](#2手机网站支付)

```
$pay = new \Linyuee\AliPay('appid');
        $biz_content = array(
            'subject'=>'课程购买',
            'out_trade_no'=>121256465846,
            'total_amount'=>0.01,

        );
$pay->setPayFormat($biz_content);
$pay->setAppPrivateKey('app密钥');
$pay->setAliPayPublicKey('支付宝公钥');
$pay->setNotifyUrl('回调地址');
$pay->setReturnUrl('支付后跳转地址');
$res = $pay->wapPay();

```

#### 3、电脑网站支付

[](#3电脑网站支付)

```
$pay = new \Linyuee\AliPay('appid');
        $biz_content = array(
            'subject'=>'课程购买',
            'out_trade_no'=>121256465846,
            'total_amount'=>0.01,

        );
$pay->setPayFormat($biz_content);
$pay->setAppPrivateKey('app密钥');
$pay->setAliPayPublicKey('支付宝公钥');
$pay->setNotifyUrl('回调地址');
$pay->setReturnUrl('支付后跳转地址');
$res = $pay->pagePay();

```

#### 4、退款

[](#4退款)

```
$pay = new \Linyuee\AliPay('appid');
$biz_content = array('out_trade_no'=>121256465846,'refund_amount'=>0.01）;
$pay->setRefundFormat($biz_content);
$pay->setAppPrivateKey('app密钥');
$pay->setAliPayPublicKey('支付宝公钥');
$res = $pay->refund();

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

3067d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20659595?v=4)[linyueb](/maintainers/linyueb)[@linyueb](https://github.com/linyueb)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/linyuee-ali/health.svg)

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

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)

PHPackages © 2026

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