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

ActiveLibrary[Payment Processing](/categories/payments)

kaylyu/laravel-alipay
=====================

支付宝支付SDK

1121[3 PRs](https://github.com/kaylyu/laravel-alipay/pulls)PHP

Since Oct 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/kaylyu/laravel-alipay)[ Packagist](https://packagist.org/packages/kaylyu/laravel-alipay)[ RSS](/packages/kaylyu-laravel-alipay/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (4)Used By (0)

 Alipay
========

[](#-alipay-)

[![Build Status](https://camo.githubusercontent.com/488b927dd41403a788e0312f39b277b1cdcaee8f2182ff8cb00713363bc80a90/68747470733a2f2f7472617669732d63692e6f72672f6b61796c79752f6c61726176656c2d616c697061792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kaylyu/laravel-alipay)[![Latest Stable Version](https://camo.githubusercontent.com/930b0f5bef9732428870b7f3a1d0c46e59b0bdff2bc19d1b2e201d2a29d90fe5/68747470733a2f2f706f7365722e707567782e6f72672f6b61796c79752f6c61726176656c2d616c697061792f762f737461626c65)](https://packagist.org/packages/kaylyu/laravel-alipay)[![Latest Unstable Version](https://camo.githubusercontent.com/ae783c9eca5c83d08c6ab74167407ab11969f2a55b880090597be3b305f895db/68747470733a2f2f706f7365722e707567782e6f72672f6b61796c79752f6c61726176656c2d616c697061792f762f756e737461626c65)](https://packagist.org/packages/kaylyu/laravel-alipay)[![Total Downloads](https://camo.githubusercontent.com/3d48263868ef5d9cbff38e540ef8f4ccfdf5cbeb1b65e2514055e7f94606a75a/68747470733a2f2f706f7365722e707567782e6f72672f6b61796c79752f6c61726176656c2d616c697061792f646f776e6c6f616473)](https://packagist.org/packages/kaylyu/laravel-alipay)[![License](https://camo.githubusercontent.com/967449186afba4dd4573ed810b6efc69e75f2b56d8f4866bccccce48276c834d/68747470733a2f2f706f7365722e707567782e6f72672f6b61796c79752f6c61726176656c2d616c697061792f6c6963656e7365)](https://packagist.org/packages/kaylyu/laravel-alipay)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/828a744691a9dcbd58c60989cd8429dc20f0d81ea0f9caea1b7d96d16e6eaf51/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b61796c79752f6c61726176656c2d616c697061792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kaylyu/laravel-alipay/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/6cecd5156de3d4a34c77114c0f6fea940fe590ca38dc64997d4737b417c957be/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b61796c79752f6c61726176656c2d616c697061792f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kaylyu/laravel-alipay/?branch=master)[![FOSSA Status](https://camo.githubusercontent.com/3afc2888d04cedf8aebb0773a76f5462b173d579fabd9b756f8057983007d030/68747470733a2f2f6170702e666f7373612e636f6d2f6170692f70726f6a656374732f6769742532426769746875622e636f6d2532466b61796c79752532466c61726176656c2d616c697061792e7376673f747970653d736869656c64)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkaylyu%2Flaravel-alipay?ref=badge_shield)

基于Laravel框架的支付宝支付SDK，目前仅支持当面付

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

[](#installation)

```
$ composer require kaylyu/laravel-alipay:~1.0" -vvv
```

Config
------

[](#config)

- 配置 可以拷贝config/kaylu-alipay.php 到 laravel 目录config下面

```
[
    'response_type' => 'collection',//collection array json object
    'log' => [
        'file' => __DIR__ . '/logs/kaylu-alipay.log',
        'level' => 'debug',
    ],
    'http' => [
        'timeout' => 30,
    ],
    //当面付
    'f2fpay' => [
        //签名方式,默认为RSA2(RSA2048)
        'sign_type' => "RSA2",

        //支付宝公钥
        'alipay_public_key' => "",

        //商户私钥
        'merchant_private_key' => "",

        //编码格式
        'charset' => "UTF-8",

        //支付宝网关
        'gateway_url' => "https://openapi.alipaydev.com/gateway.do",

        //应用ID
        'app_id' => "",

        //异步通知地址,只有扫码支付预下单可用
        'notify_url' => "http://www.baidu.com",
    ]
]
```

Usage
-----

[](#usage)

- 注册对应Service Provider

```
    // laravel >= 5.5
    Kaylyu\Alipay\F2fpay\ServiceProvider::class

    // lumen
    $app->register(Kaylyu\Alipay\F2fpay\ServiceProvider::class);
```

- 使用

```
    //统一收单线下交易预创建（扫码支付）
    app('kaylu.alipay.f2fpay')->order->qrPay
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

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/99f389befe02582b9e834bd92a7e6462b1e34792fee68acf41202ba20deb7dc5?d=identicon)[kaylyu](/maintainers/kaylyu)

---

Top Contributors

[![kaylyu](https://avatars.githubusercontent.com/u/10989918?v=4)](https://github.com/kaylyu "kaylyu (1 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/kaylyu-laravel-alipay/health.svg)](https://phpackages.com/packages/kaylyu-laravel-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)
