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

ActiveLibrary[Payment Processing](/categories/payments)

robote/alipay
=============

Alipay In Laravel5

014PHP

Since Sep 14Pushed 10y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Alipay
======

[](#alipay)

Alipay 移动支付 for Laravel5

安装
--

[](#安装)

```
composer require "robote/alipay": "dev-master"

```

更新你的依赖包 `composer update` 或者全新安装 `composer install`。

使用
--

[](#使用)

`config/app.php` 添加 providers

```
    'providers' => [
        // ...
        'Robote\Alipay\AlipayServiceProvider',
    ]
```

运行 `php artisan vendor:publish` 命令，发布配置文件到你的项目中。

配置文件 `config/robote-alipay-wap.php` 为移动版支付宝配置， `config/robote-alipay-mobile.php` 为手机端支付宝配置。

在`config` 文件夹中新增 `robote-alipay` 文件夹，在该文件夹下放入 rsa\_private\_key.pem ,alipay\_public\_key.pem 两个文件

例子
--

[](#例子)

### 支付申请

[](#支付申请)

#### 手机网页

[](#手机网页)

```
	// 创建支付单。
	$alipay = app('alipay.web');

	// 跳转到支付页面。其中 $show_url,$subject,$body 三个参数可为空
    return $alipay->payment($order_id,$amount,$show_url,$subject,$body);
```

### 结果通知

[](#结果通知)

#### 网页

[](#网页)

```
	/**
	 * 异步通知
	 */
	public function webNotify()
	{
		// 验证请求。
		if (! app('alipay.web')->verify()) {
			Log::notice('Alipay notify post data verification fail.', [
				'data' => Request::instance()->getContent()
			]);
			return 'fail';
		}

		// 判断通知类型。
		switch (Input::get('trade_status')) {
			case 'TRADE_SUCCESS':
			case 'TRADE_FINISHED':
				// TODO: 支付成功，取得订单号进行其它相关操作。

				break;
		}

		return 'success';
	}

	/**
	 * 同步通知
	 */
	public function webReturn()
	{
		// 验证请求。
		if (! app('alipay.web')->verify()) {
			Log::notice('Alipay return query data verification fail.', [
				'data' => Request::getQueryString()
			]);
			return view('alipay.fail');
		}

		// 判断通知类型。
		switch (Input::get('trade_status')) {
			case 'TRADE_SUCCESS':
			case 'TRADE_FINISHED':
				// TODO: 支付成功，取得订单号进行其它相关操作。

				break;
		}

		return view('alipay.success');
	}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/01ff16c6cf7bc763e8204e98881a728ae34278bcac44bd9ac385059fb74f86f1?d=identicon)[robote](/maintainers/robote)

---

Top Contributors

[![robote](https://avatars.githubusercontent.com/u/7510362?v=4)](https://github.com/robote "robote (6 commits)")

### Embed Badge

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

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

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