PHPackages                             zwcway/payments - 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. zwcway/payments

ActiveLibrary[Payment Processing](/categories/payments)

zwcway/payments
===============

08PHP

Since May 5Pushed 11y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

payments
========

[](#payments)

在laravel 4中使用的支付宝（Alipay）等的支付插件

使用方法
====

[](#使用方法)

支付宝
---

[](#支付宝)

```
$pay = Payment::create('alipay');
$pay->setOrderid('订单 ID')
    ->setProductName('产品名')
    ->setProductPrice(0.01);
return Response::make($pay->render());

```

### 同步通知

[](#同步通知)

```
$alipay = Payment::create('alipay');
$verified = $alipay->receive(Input::all());

// 验证参数
if (!$alipay->verified()) {
    Log::error("支付宝异步通知验证失败\n" . json_encode(Input::all()));
    return View::make('pay.fail');
}

// 获取订单号
$orderNo = $alipay->getOrderId();

if (!$order->isPaid()) {
    if (!$verified) {
        Log::warning('支付宝支付失败。');
        ...
    } else {
        Log::warning('支付宝支付成功。');
        ...
    }
}
...

```

### 异步通知

[](#异步通知)

```
$alipay = Payment::create('alipay');
$verified = $alipay->response(Input::all());

// 验证参数
if (!$alipay->verified()) {
    Log::error("支付宝异步通知被异常调用\n" . json_encode(Input::all()));
    return Response::make('fail');
}
$orderNo = $alipay->getOrderId();

if (!$verified) {
    // 支付失败
    return Response::make('fail');
}

return Response::make('success');

```

待增功能
====

[](#待增功能)

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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/01c6d31ed10925edb2eab875115a4afbf9e558729612ad368617d7826f63dec5?d=identicon)[zwcway](/maintainers/zwcway)

### Embed Badge

![Health badge](/badges/zwcway-payments/health.svg)

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

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