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

ActiveLibrary[Payment Processing](/categories/payments)

xe001/omnipay-global-alipay
===========================

Alipay global gateway for Omnipay payment processing library

v3.0.2(1y ago)019MITPHP

Since May 27Pushed 1y agoCompare

[ Source](https://github.com/xe001/omnipay-global-alipay)[ Packagist](https://packagist.org/packages/xe001/omnipay-global-alipay)[ Docs](https://github.com/lokielse/omnipay-global-alipay)[ RSS](/packages/xe001-omnipay-global-alipay/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Omnipay: Alipay (Global)
========================

[](#omnipay-alipay-global)

由于原库不更新了，所以自己fork一个来维护

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

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

> This package only support global Alipay service

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

[](#installation)

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

```
{
    "require": {
        "xe001/omnipay-global-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:

- GlobalAlipay\_Web (Alipay Global Web Gateway) 支付宝国际版Web支付宝接口
- GlobalAlipay\_Wap (Alipay Global Wap Gateway) 支付宝国际版Wap支付宝接口
- GlobalAlipay\_App (Alipay Global App Gateway) 支付宝国际版App支付宝接口

Usage
-----

[](#usage)

- Sandbox information: [SANDBOX.md](SANDBOX.md)
- Documentation: [Alipay Global Guid](https://ds.alipay.com/fd-ij9mtflt/home.html)

### Purchase

[](#purchase)

```
/**
 * @var Omnipay\GlobalAlipay\WebGateway $gateway
 */
//gateways: GlobalAlipay_Web, GlobalAlipay_Wap, GlobalAlipay_App
$gateway = Omnipay::create('GlobalAlipay_Web');
$gateway->setPartner('8888666622221111');
$gateway->setKey('your**key**here'); //for sign_type=MD5
$gateway->setPrivateKey($privateKeyPathOrData); //for sign_type=RSA
$gateway->setReturnUrl('http://www.example.com/return');
$gateway->setNotifyUrl('http://www.example.com/notify');
$gateway->setEnvironment('sandbox'); //for Sandbox Test (Web/Wap)

$params = [
    '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
    'currency'     => 'USD', //default is 'USD'
];

/**
 * @var Omnipay\GlobalAlipay\Message\WebPurchaseResponse $response
 */
$response = $gateway->purchase($params)->send();

//$response->redirect();
var_dump($response->getRedirectUrl());
var_dump($response->getRedirectData());
var_dump($response->getOrderString()); //for GlobalAlipay_App
```

### Return/Notify

[](#returnnotify)

```
/**
 * @var Omnipay\GlobalAlipay\WebGateway $gateway
 */
$gateway = Omnipay::create('GlobalAlipay_Web');
$gateway->setPartner('8888666622221111');
$gateway->setKey('your**key**here'); //for sign_type=MD5
$gateway->setPrivateKey($privateKeyPathOrData); //for sign_type=RSA
$gateway->setEnvironment('sandbox'); //for Sandbox Test (Web/Wap)

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

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

/**
 * @var Omnipay\GlobalAlipay\Message\CompletePurchaseResponse $response
 */
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.

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 announcements, 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.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.1% 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 ~30 days

Total

3

Last Release

656d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e7ee38c42925ea6a24d43feabd29901de5040d5706993fddf319af043c65485?d=identicon)[xe001](/maintainers/xe001)

---

Top Contributors

[![lokielse](https://avatars.githubusercontent.com/u/1573211?v=4)](https://github.com/lokielse "lokielse (50 commits)")[![506400117](https://avatars.githubusercontent.com/u/21166269?v=4)](https://github.com/506400117 "506400117 (25 commits)")[![chris-ss](https://avatars.githubusercontent.com/u/18467476?v=4)](https://github.com/chris-ss "chris-ss (1 commits)")[![chuangbo](https://avatars.githubusercontent.com/u/179978?v=4)](https://github.com/chuangbo "chuangbo (1 commits)")[![liuaix](https://avatars.githubusercontent.com/u/30791785?v=4)](https://github.com/liuaix "liuaix (1 commits)")

---

Tags

paymentgatewaypaymerchantomnipayinternationalpurchasealipayglobalcross-border

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[lokielse/omnipay-global-alipay

Alipay global gateway for Omnipay payment processing library

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

Alipay gateway for Omnipay payment processing library

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

PHPackages © 2026

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