PHPackages                             nonfu/payjs-laravel - 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. [API Development](/categories/api)
4. /
5. nonfu/payjs-laravel

ActiveLibrary[API Development](/categories/api)

nonfu/payjs-laravel
===================

基于 PAYJS 的 API 开发的 Composer Laravel Package，可直接用于生产环境 https://payjs.cn

1.6.0(5y ago)010MITPHP

Since Sep 17Pushed 5y agoCompare

[ Source](https://github.com/nonfu/payjs-laravel)[ Packagist](https://packagist.org/packages/nonfu/payjs-laravel)[ Fund](https://payjs.cn/sponsor/dajjxz)[ RSS](/packages/nonfu-payjs-laravel/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (8)Used By (0)

 [![](https://camo.githubusercontent.com/9a6971049b10512b626be6165e3d5dde5112f8db2403317e2746e30538c6da25/68747470733a2f2f7061796a732e636e2f7374617469632f696d616765732f6c6f676f2e706e67)](https://camo.githubusercontent.com/9a6971049b10512b626be6165e3d5dde5112f8db2403317e2746e30538c6da25/68747470733a2f2f7061796a732e636e2f7374617469632f696d616765732f6c6f676f2e706e67)

PAYJS Wechat Payment Laravel Package
------------------------------------

[](#payjs-wechat-payment-laravel-package)

简介
--

[](#简介)

本项目是基于 PAYJS 的 API 开发的 Laravel Package，仅做学习参考，不建议用于生产环境

PAYJS 针对个人主体提供微信/支付宝支付接入能力，是经过检验的正规、安全、可靠的微信支付个人开发接口

其它版本: [PAYJS 通用开发包](https://github.com/nonfu/payjs)

支持Laravel 5.x、Laravel 6.x、Laravel 7.x、Laravel 8.x

安装
--

[](#安装)

通过 Composer 安装

```
$ composer require nonfu/payjs-laravel
```

使用方法
----

[](#使用方法)

### 一、发布并修改配置文件

[](#一发布并修改配置文件)

- 发布配置文件

```
php artisan vendor:publish --provider="Nonfu\Payjs\PayjsServiceProvider"
```

- 编辑配置文件 `config/payjs.php` 配置商户号和通信密钥

```
return [
    'wechat' => [
        'mchid' => '', // 填写商户号
        'key'   => '', // 填写通信KEY
    ],
    'alipay' => [
        'mchid' => '', // 填写商户号
        'key'   => '', // 填写通信KEY
    ]
];
```

### 二、在业务中使用

[](#二在业务中使用)

首先在业务模块中引入门面

```
use Nonfu\Payjs\Facades\Payjs;
```

以扫码支付为例：

```
// 构造订单基础信息
$data = [
    'body' => '订单测试',                                // 订单标题
    'total_fee' => 2,                                   // 订单标题
    'out_trade_no' => time(),                           // 订单号
    'attach' => 'test_order_attach',                    // 订单附加信息(可选参数)
    'notify_url' => 'https://www.baidu.com/notify',     // 异步通知地址(可选参数)
];
Payjs::setPayType('wechat');
return Payjs::native($data);

// 支付宝
$data = [
    'body' => '订单测试',
    'type' => 'alipay',                                 // 支付方式
    'total_fee' => 2,                                   // 订单标题
    'out_trade_no' => time(),                           // 订单号
    'attach' => 'test_order_attach',                    // 订单附加信息(可选参数)
    'notify_url' => 'https://www.baidu.com/notify',     // 异步通知地址(可选参数)
];
Payjs::setPayType('alipay');
return Payjs::native($data);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 83.3% 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 ~132 days

Recently: every ~189 days

Total

7

Last Release

2000d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8003210?v=4)[学院君](/maintainers/nonfu)[@nonfu](https://github.com/nonfu)

---

Top Contributors

[![xhat](https://avatars.githubusercontent.com/u/699357?v=4)](https://github.com/xhat "xhat (15 commits)")[![nonfu](https://avatars.githubusercontent.com/u/8003210?v=4)](https://github.com/nonfu "nonfu (2 commits)")[![xiaohuilam](https://avatars.githubusercontent.com/u/6964962?v=4)](https://github.com/xiaohuilam "xiaohuilam (1 commits)")

### Embed Badge

![Health badge](/badges/nonfu-payjs-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/nonfu-payjs-laravel/health.svg)](https://phpackages.com/packages/nonfu-payjs-laravel)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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