PHPackages                             luzhuqun/omnipay-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. luzhuqun/omnipay-alipay

ActiveLibrary[Payment Processing](/categories/payments)

luzhuqun/omnipay-alipay
=======================

Alipay gateway for Omnipay payment processing library

v1.4.10(9y ago)019MITPHP

Since Jun 23Pushed 9y agoCompare

[ Source](https://github.com/luzhuqun/omnipay-alipay)[ Packagist](https://packagist.org/packages/luzhuqun/omnipay-alipay)[ Docs](https://github.com/lokielse/omnipay-alipay)[ RSS](/packages/luzhuqun-omnipay-alipay/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (12)Used By (0)

Omnipay: Alipay
===============

[](#omnipay-alipay)

**Alipay driver for the Omnipay PHP payment processing library**

[![Build Status](https://camo.githubusercontent.com/49ef54b95da70f59f3250ea67ab095edaff2c5e6d58451b9fb762dcfa4476bf5/68747470733a2f2f7472617669732d63692e6f72672f6c6f6b69656c73652f6f6d6e697061792d616c697061792e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/lokielse/omnipay-alipay)[![Latest Stable Version](https://camo.githubusercontent.com/f5ac4dff52237bfe0053fdcaf8b6c2b5ea64b6e31b2ca3ac263239b101b638ff/68747470733a2f2f706f7365722e707567782e6f72672f6c757a687571756e2f6f6d6e697061792d616c697061792f76657273696f6e2e706e67)](https://packagist.org/packages/luzhuqun/omnipay-alipay)[![Total Downloads](https://camo.githubusercontent.com/ebe584d4384528394d57c329c41b7075a53baeecc2379e0714651eb584967b53/68747470733a2f2f706f7365722e707567782e6f72672f6c757a687571756e2f6f6d6e697061792d616c697061792f642f746f74616c2e706e67)](https://packagist.org/packages/luzhuqun/omnipay-alipay)

[Omnipay](https://github.com/omnipay/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Alipay support for Omnipay.

> Cross-border Alipay payment please use [`lokielse/omnipay-global-alipay`](https://github.com/lokielse/omnipay-global-alipay)

Improtant
---------

[](#improtant)

This is based on Alipay api 2.0. Visit [Alipay Api](https://doc.open.alipay.com/doc2/apiList?docType=4) for help.

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

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file:

```
{
    "require": {
        "luzhuqun/omnipay-alipay": "dev-master"
    }
}
```

And run composer to update your dependencies:

```
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

```

Basic Usage
-----------

[](#basic-usage)

The following gateways are provided by this package:

- Alipay\_Express (Alipay faceTofacePay) 当面付（二维码支付）
- Alipay\_WapExpress (Alipay Wap Express Checkout) 手机网站支付

Usage
-----

[](#usage)

### Purchase

[](#purchase)

```
$gateway = Omnipay::create('Alipay_Express');
$gateway->setPartner('8888666622221111');
$gateway->setKey('your**key**here');
$gateway->setSellerEmail('merchant@example.com');
$gateway->setReturnUrl('http://www.example.com/return');
$gateway->setNotifyUrl('http://www.example.com/notify');

//For 'Alipay_MobileExpress', 'Alipay_WapExpress'
//$gateway->setPrivateKey('/such-as/private_key.pem');

$options = [
    'out_trade_no' => date('YmdHis') . mt_rand(1000,9999), //your site trade no, unique
    'subject'      => 'test', //order title
    'total_fee'    => '0.01', //order total fee
];

$response = $gateway->purchase($options)->send();

$response->getRedirectUrl();
$response->getRedirectData();

//For 'Alipay_MobileExpress'
//Use the order string with iOS or Android SDK
$response->getOrderString();
```

### Return/Notify

[](#returnnotify)

```
$gateway = Omnipay::create('Alipay_Express');
$gateway->setPartner('8888666622221111');
$gateway->setKey('your**key**here');
$gateway->setSellerEmail('merchant@example.com');

//For 'Alipay_MobileExpress', 'Alipay_WapExpress'
//$gateway->setAlipayPublicKey('/such-as/alipay_public_key.pem');

$options = [
    'request_params'=> array_merge($_POST, $_GET), //Don't use $_REQUEST for may contain $_COOKIE
];

$response = $gateway->completePurchase($options)->send();

if ($response->isPaid()) {

   // Paid success, your statements go here.

   //For notify, response 'success' only please.
   //die('success');
} else {

   //For notify, response 'fail' only please.
   //die('fail');
}
```

For general usage instructions, please see the main [Omnipay](https://github.com/omnipay/omnipay)repository.

Related
-------

[](#related)

- [Laravel-Omnipay](https://github.com/ignited/laravel-omnipay)
- [Omnipay-GlobalAlipay](https://github.com/lokielse/omnipay-global-alipay)
- [Omnipay-WechatPay](https://github.com/lokielse/omnipay-wechatpay)
- [Omnipay-UnionPay](https://github.com/lokielse/omnipay-unionpay)

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/lokielse/omnipay-alipay/issues), or better yet, fork the library and submit a pull request.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 59% 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 ~44 days

Recently: every ~95 days

Total

11

Last Release

3586d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ade5e6de0c2bae20b79831232de0e89969097bf8eaec5d8e3c04c512d9a9e23d?d=identicon)[luzhuqun](/maintainers/luzhuqun)

---

Top Contributors

[![amacneil](https://avatars.githubusercontent.com/u/637671?v=4)](https://github.com/amacneil "amacneil (207 commits)")[![lokielse](https://avatars.githubusercontent.com/u/1573211?v=4)](https://github.com/lokielse "lokielse (81 commits)")[![aderuwe](https://avatars.githubusercontent.com/u/1125184?v=4)](https://github.com/aderuwe "aderuwe (17 commits)")[![pilot](https://avatars.githubusercontent.com/u/28564?v=4)](https://github.com/pilot "pilot (11 commits)")[![AIRootUser](https://avatars.githubusercontent.com/u/22089688?v=4)](https://github.com/AIRootUser "AIRootUser (6 commits)")[![TomasKit](https://avatars.githubusercontent.com/u/13846988?v=4)](https://github.com/TomasKit "TomasKit (3 commits)")[![rlerdorf](https://avatars.githubusercontent.com/u/54641?v=4)](https://github.com/rlerdorf "rlerdorf (2 commits)")[![johnkary](https://avatars.githubusercontent.com/u/135607?v=4)](https://github.com/johnkary "johnkary (2 commits)")[![steveneaston](https://avatars.githubusercontent.com/u/242405?v=4)](https://github.com/steveneaston "steveneaston (2 commits)")[![winzou](https://avatars.githubusercontent.com/u/702928?v=4)](https://github.com/winzou "winzou (2 commits)")[![asaph](https://avatars.githubusercontent.com/u/760071?v=4)](https://github.com/asaph "asaph (2 commits)")[![michael2h4ng](https://avatars.githubusercontent.com/u/5486783?v=4)](https://github.com/michael2h4ng "michael2h4ng (2 commits)")[![michaeldoe](https://avatars.githubusercontent.com/u/1436773?v=4)](https://github.com/michaeldoe "michaeldoe (1 commits)")[![mtudor](https://avatars.githubusercontent.com/u/1683723?v=4)](https://github.com/mtudor "mtudor (1 commits)")[![nedmas](https://avatars.githubusercontent.com/u/842280?v=4)](https://github.com/nedmas "nedmas (1 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")[![ruudk](https://avatars.githubusercontent.com/u/104180?v=4)](https://github.com/ruudk "ruudk (1 commits)")[![maclof](https://avatars.githubusercontent.com/u/4358583?v=4)](https://github.com/maclof "maclof (1 commits)")[![benjamindavid](https://avatars.githubusercontent.com/u/2911900?v=4)](https://github.com/benjamindavid "benjamindavid (1 commits)")[![billwang22](https://avatars.githubusercontent.com/u/6038689?v=4)](https://github.com/billwang22 "billwang22 (1 commits)")

---

Tags

paymentgatewaypaymerchantomnipaypurchasealipay

### Embed Badge

![Health badge](/badges/luzhuqun-omnipay-alipay/health.svg)

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

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

586422.8k10](/packages/lokielse-omnipay-alipay)[lokielse/omnipay-global-alipay

Alipay global gateway for Omnipay payment processing library

3051.3k](/packages/lokielse-omnipay-global-alipay)

PHPackages © 2026

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