PHPackages                             tobess/laravel-pingpp - 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. tobess/laravel-pingpp

ActiveLibrary[Payment Processing](/categories/payments)

tobess/laravel-pingpp
=====================

Pingpp wrapper for Laravel 5

1.0.1(8y ago)09MITPHPPHP &gt;=5.4.0

Since Sep 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Tobess/laravel-pingpp)[ Packagist](https://packagist.org/packages/tobess/laravel-pingpp)[ Docs](https://github.com/tobess/laravel-pingpp)[ RSS](/packages/tobess-laravel-pingpp/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

laravel-pingpp
==============

[](#laravel-pingpp)

pingxx基于laravel5的封装

[![Latest Stable Version](https://camo.githubusercontent.com/1566c74235bf9e2fc71a184e4fa2a4647413da57b3f21f6fae49136e8435df06/68747470733a2f2f706f7365722e707567782e6f72672f746f626573732f6c61726176656c2d70696e6770702f762f737461626c65)](https://packagist.org/packages/tobess/laravel-pingpp) [![Total Downloads](https://camo.githubusercontent.com/5bd28517e9c6e15f5536a10cdfb86bbc2532973343f7d537c0902c4d85b3f406/68747470733a2f2f706f7365722e707567782e6f72672f746f626573732f6c61726176656c2d70696e6770702f646f776e6c6f616473)](https://packagist.org/packages/tobess/laravel-pingpp) [![Latest Unstable Version](https://camo.githubusercontent.com/ada801c3c7be98018911d0109044947aae5bce5dee4dc1e054a51d7aef1ddc6c/68747470733a2f2f706f7365722e707567782e6f72672f746f626573732f6c61726176656c2d70696e6770702f762f756e737461626c65)](https://packagist.org/packages/tobess/laravel-pingpp) [![License](https://camo.githubusercontent.com/c396f8d0ee220e9dfdab9a56a93ce2341125aab810c548426d4e1f0fd59f0d4f/68747470733a2f2f706f7365722e707567782e6f72672f746f626573732f6c61726176656c2d70696e6770702f6c6963656e7365)](https://packagist.org/packages/tobess/laravel-pingpp)

配置方法
====

[](#配置方法)

1. 在`composer.json`里添加如下内容，并运行`composer update`:

```
{
    "require": {
        "tobess/laravel-pingpp": "dev-master"
    }
}
```

1. 在`app/config/app.php`文件里的providers变量下添加`Tobess\Pingpp\PingppServiceProvider::class,`
2. 在`app/config/app.php`文件里的aliases变量下添加`'Pingpp' => Tobess\Pingpp\Facades\Pingpp::class,`
3. 运行`php artisan vendor:publish`生成配置文件
4. 修改配置文件里面的2组key
5. 若需回调验证，请填写`public_key_path`，**注意该处是路径！**，这里参考官方已改为路径，同时当前会兼容旧版本配置文件
6. 若需要使用商户身份验证，请填写`private_key_path`，**注意该处是路径！**线上生产环境建议配置`.evn`来配置生产环境

使用方法
====

[](#使用方法)

```
use Pingpp;

class SomeClass extends Controller {

    public function someFunction()
    {
    	\Pingpp\Charge::create(
            array(
                // 请求参数字段规则，请参考 API 文档：https://www.pingxx.com/api#api-c-new
                'subject'   => 'Your Subject',
                'body'      => 'Your Body',
                'amount'    => $amount,                 // 订单总金额, 人民币单位：分（如订单总金额为 1 元，此处请填 100）
                'order_no'  => $orderNo,                // 推荐使用 8-20 位，要求数字或字母，不允许其他字符
                'currency'  => 'cny',
                'extra'     => $extra,
                'channel'   => $channel,                // 支付使用的第三方支付渠道取值，请参考：https://www.pingxx.com/api#api-c-new
                'client_ip' => $_SERVER['REMOTE_ADDR'], // 发起支付请求客户端的 IP 地址，格式为 IPV4，如: 127.0.0.1
                'app'       => array('id' => APP_ID)
            )
        );
    }
}
```

```
use Pingpp;

class SomeClass extends Controller {

    public function someFunction()
    {
    	Pingpp::RedEnvelope()->create([
            'order_no'  => '123456789',
	        'app'       => array('id' => 'APP_ID'),
	        'channel'   => 'wx_pub',
	        'amount'    => 100,
	        'currency'  => 'cny',
	        'subject'   => 'Your Subject',
	        'body'      => 'Your Body',
	        'extra'     => array(
	            'nick_name' => 'Nick Name',
	            'send_name' => 'Send Name'
	        ),
	        'recipient'   => 'Openid',
	        'description' => 'Your Description'
        ]);
    }
}
```

错误调用
====

[](#错误调用)

当Pingpp调用发生错误的时候会`return false`，此时调用`Pingpp::getError();`返回具体错误内容。

接收 Webhooks 通知
==============

[](#接收-webhooks-通知)

直接调用`Pingpp::notice()`，若验证成功,会返回通知的`array`结构数据,若失败直接弹出错误回Pingpp。如果需要记录错误，请自行监听系统错误，详见[Errors &amp; Logging](https://laravel.com/docs/5.5/errors)

感谢
==

[](#感谢)

感谢几位forked的同学的改进，当时写的很简单，无入侵式的写法，其实在接收webhooks方面，可以用Laravel自己的[Events](https://laravel.com/docs/5.5/events)去监听处理，显得更Laravel风格。

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity59

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3197d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12328610?v=4)[Tobess](/maintainers/Tobess)[@Tobess](https://github.com/Tobess)

---

Tags

laravellaravel 5pingppPingxx

### Embed Badge

![Health badge](/badges/tobess-laravel-pingpp/health.svg)

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

###  Alternatives

[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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