PHPackages                             davidxu/yii2-alipay - 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. davidxu/yii2-alipay

ActiveLibrary[Payment Processing](/categories/payments)

davidxu/yii2-alipay
===================

an Alipay Composer Package

1.0.7(6y ago)348MITPHPPHP &gt;5.5

Since Apr 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/davidxuuts/yii2-alipay)[ Packagist](https://packagist.org/packages/davidxu/yii2-alipay)[ RSS](/packages/davidxu-yii2-alipay/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (11)Used By (0)

The Alipay Composer Package
===========================

[](#the-alipay-composer-package)

a Alipay Composer Package

Description
-----------

[](#description)

This is for alipay app pay purpose.

Based on Alipay-SDK-PHP-4.9.0

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require davidxu/yii2-alipay "*"

```

or add

```
"davidxu/yii2-alipay": "*"

```

to the require section of your `composer.json` file.

Usage Example for App Pay Order Generation Request
--------------------------------------------------

[](#usage-example-for-app-pay-order-generation-request)

```
use davidxu\alipay\Alipay;
use davidxu\alipay\request\AlipayTradeAppPayRequest;

$notifyUrl = 'https:///alipay/notify';

$alipay = new Alipay();

$alipay->gatewayUrl = "https://openapi.alipay.com/gateway.do";
$alipay->appId = "";
$alipay->rsaPrivateKey = '' ;
$alipay->format = "json";
$alipay->charset = "UTF-8";
$alipay->signType = "RSA2";
$alipay->alipayrsaPublicKey = '';

$request = new AlipayTradeAppPayRequest();

$bizcontent = json_encode([
                  'body' => 'Body of test data',
                  'subject' => 'App Pay Test',
                  'out_trade_no' => '2020012511013510000',
                  'timeout_express' => '30m',
                  'total_amount' => '0.01',
                  'product_code' => 'QUICK_MSECURITY_PAY',
              ]);

$request->setNotifyUrl($notifyUrl);
$request->setBizContent($bizcontent);

$orderString = $alipay->sdkExecute($request);

// Client side can use this string for orderString directly.
echo $orderString;

```

Usage Example for App Pay Async Notification
--------------------------------------------

[](#usage-example-for-app-pay-async-notification)

```

Http Method: POST
Request URL: https:///alipay/notify

```

```
use davidxu\alipay\Alipay;

$alipay = new Alipay();
$alipay->alipayrsaPublicKey = ;

$flag = $alipay->rsaCheckV1($request, null, 'RSA2');

// Other code such as deal with business logic and etc

// Response ali post request
echo 'success';

```

Contact
-------

[](#contact)

If anything please contact at

Have fun.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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

Recently: every ~255 days

Total

9

Last Release

2263d ago

Major Versions

0.1 → 1.02017-04-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/59e94d6d1e147e3ed702e4f3dcbeb3eca9a9b228ad58dc014530212e0a3f3ba5?d=identicon)[davidxuuts](/maintainers/davidxuuts)

---

Top Contributors

[![davidxuuts](https://avatars.githubusercontent.com/u/1892196?v=4)](https://github.com/davidxuuts "davidxuuts (10 commits)")

---

Tags

yii2extensionalipay

### Embed Badge

![Health badge](/badges/davidxu-yii2-alipay/health.svg)

```
[![Health](https://phpackages.com/badges/davidxu-yii2-alipay/health.svg)](https://phpackages.com/packages/davidxu-yii2-alipay)
```

###  Alternatives

[bryglen/yii2-omnipay

thephpleague/omnipay for Yii 2

107.1k](/packages/bryglen-yii2-omnipay)

PHPackages © 2026

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