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

ActiveLibrary[Payment Processing](/categories/payments)

ccob/omnipay-alipay
===================

Alipay gateway for Omnipay payment processing library

v1.4.7(10y ago)041MITPHP

Since Jun 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Ccob-x/omnipay-alipay)[ Packagist](https://packagist.org/packages/ccob/omnipay-alipay)[ Docs](https://github.com/lokielse/omnipay-alipay)[ RSS](/packages/ccob-omnipay-alipay/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (9)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/df3db6af8d6d535dea5b5e92cb55b022c18c6a1b5ba8539691a8b14ff5f8fcbe/68747470733a2f2f706f7365722e707567782e6f72672f6c6f6b69656c73652f6f6d6e697061792d616c697061792f76657273696f6e2e706e67)](https://packagist.org/packages/lokielse/omnipay-alipay)[![Total Downloads](https://camo.githubusercontent.com/c4fa1f26afd3d9de52d504491f4e981bcc3efe445db8349c5ac850c38041c42b/68747470733a2f2f706f7365722e707567782e6f72672f6c6f6b69656c73652f6f6d6e697061792d616c697061792f642f746f74616c2e706e67)](https://packagist.org/packages/lokielse/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.

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

[](#installation)

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

```
{
    "require": {
        "ccob/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 Express Checkout) 支付宝即时到账接口
- Alipay\_Secured (Alipay Secured Checkout) 支付宝担保交易接口
- Alipay\_Dual (Alipay Dual Function Checkout) 支付宝双功能交易接口
- Alipay\_WapExpress (Alipay Wap Express Checkout) 支付宝WAP客户端接口
- Alipay\_MobileExpress (Alipay Mobile Express Checkout) 支付宝无线支付接口
- Alipay\_Bank (Alipay Bank 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'=> $_REQUEST,
];

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

if ($response->isSuccessful() && $response->isTradeStatusOk()) {

   // 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-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 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 62.2% 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 ~12 days

Total

8

Last Release

3892d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/926a68c66d0fff45e103f936b670798b295acc94970f2a2bc9bbab43fbaa3288?d=identicon)[Cobb](/maintainers/Cobb)

---

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 (68 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)")[![ballytaro](https://avatars.githubusercontent.com/u/5902421?v=4)](https://github.com/ballytaro "ballytaro (3 commits)")[![TomasKit](https://avatars.githubusercontent.com/u/13846988?v=4)](https://github.com/TomasKit "TomasKit (3 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)")[![johnkary](https://avatars.githubusercontent.com/u/135607?v=4)](https://github.com/johnkary "johnkary (2 commits)")[![rlerdorf](https://avatars.githubusercontent.com/u/54641?v=4)](https://github.com/rlerdorf "rlerdorf (2 commits)")[![steveneaston](https://avatars.githubusercontent.com/u/242405?v=4)](https://github.com/steveneaston "steveneaston (2 commits)")[![justinjones](https://avatars.githubusercontent.com/u/14925?v=4)](https://github.com/justinjones "justinjones (1 commits)")[![kinosang](https://avatars.githubusercontent.com/u/4987102?v=4)](https://github.com/kinosang "kinosang (1 commits)")[![cfreear](https://avatars.githubusercontent.com/u/619726?v=4)](https://github.com/cfreear "cfreear (1 commits)")[![maclof](https://avatars.githubusercontent.com/u/4358583?v=4)](https://github.com/maclof "maclof (1 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)")[![brunogaspar](https://avatars.githubusercontent.com/u/2285372?v=4)](https://github.com/brunogaspar "brunogaspar (1 commits)")

---

Tags

paymentgatewaypaymerchantomnipaypurchasealipay

### Embed Badge

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

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

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

587421.0k11](/packages/lokielse-omnipay-alipay)[lokielse/omnipay-global-alipay

Alipay global gateway for Omnipay payment processing library

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

PHPackages © 2026

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