PHPackages                             jinzhisu/ali-pay-sdk-for-php - 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. jinzhisu/ali-pay-sdk-for-php

ActiveLibrary[Payment Processing](/categories/payments)

jinzhisu/ali-pay-sdk-for-php
============================

ali-pay

v0.3(7y ago)029MITPHPPHP &gt;=5.6

Since Nov 12Pushed 7y agoCompare

[ Source](https://github.com/endwiki/AliPayForPHP)[ Packagist](https://packagist.org/packages/jinzhisu/ali-pay-sdk-for-php)[ RSS](/packages/jinzhisu-ali-pay-sdk-for-php/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

支付宝支付接入SDK(PHP)
===============

[](#支付宝支付接入sdkphp)

前言
--

[](#前言)

这个 SDK 是基于支付宝官方的 PHP 版本的 SDK(版本为3.3.1) 改写的。做了如下改变:

1. 去除 lotusphp\_runtime 框架。
2. 兼容 PHP 7。
3. 支持 Psr4 规范。

> 此类金融、支付相关的接口，建议使用官方的SDK。如果要是用第三方的 SDK，务必审查所有的代码，确认安全之后才能投入正式使用。

所有的接口以及其参数都与官方文档一致，并未更改。

安装
--

[](#安装)

建议使用 Composer 安装。

使用
--

[](#使用)

下面以移动支付接口为例。

```
$aop = new JinZhiSu\AliPay\AopClient ();
$aop->gatewayUrl = 'https://openapi.alipaydev.com/gateway.do';
$aop->appId = '应用ID';
$aop->rsaPrivateKey = '应用私钥';
$aop->alipayrsaPublicKey= '应用公钥';
$aop->apiVersion = '1.0';
$aop->signType = 'RSA2';
$aop->postCharset='UTF-8';
$aop->format='json';
$request = new JinZhiSu\AliPay\request\AlipayTradeAppPayRequest();
$request->setBizContent(json_encode([
    'out_trade_no' => date('YmdHis') . mt_rand(10000,99999),
    'body' => 'XXX',
    'subject' => 'XXX',
    'goods_type' => 0,
]));
$result = $aop->sdkExecute($request);
var_dump($result);

```

其他接口参考支付宝开发者中心的API文档。

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

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

Total

2

Last Release

2736d ago

PHP version history (2 changes)v0.1PHP &gt;=5.4

v0.3PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/06ef375e1202b627d47f834048a80f43fa011d6a816a37186ff31ee67a1f2193?d=identicon)[JinZhiSu](/maintainers/JinZhiSu)

---

Top Contributors

[![endwiki](https://avatars.githubusercontent.com/u/30104730?v=4)](https://github.com/endwiki "endwiki (5 commits)")

### Embed Badge

![Health badge](/badges/jinzhisu-ali-pay-sdk-for-php/health.svg)

```
[![Health](https://phpackages.com/badges/jinzhisu-ali-pay-sdk-for-php/health.svg)](https://phpackages.com/packages/jinzhisu-ali-pay-sdk-for-php)
```

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