Download the PHP package tobess/laravel-pingpp without Composer
On this page you can find all versions of the php package tobess/laravel-pingpp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel-pingpp
# laravel-pingpp pingxx基于laravel5的封装
配置方法
-
在
composer.json
里添加如下内容,并运行composer update
: - 在
app/config/app.php
文件里的providers变量下添加Tobess\Pingpp\PingppServiceProvider::class,
- 在
app/config/app.php
文件里的aliases变量下添加'Pingpp' => Tobess\Pingpp\Facades\Pingpp::class,
- 运行
php artisan vendor:publish
生成配置文件 - 修改配置文件里面的2组key
- 若需回调验证,请填写
public_key_path
,注意该处是路径!,这里参考官方已改为路径,同时当前会兼容旧版本配置文件 - 若需要使用商户身份验证,请填写
private_key_path
,注意该处是路径! 线上生产环境建议配置.evn
来配置生产环境
使用方法
错误调用
当Pingpp调用发生错误的时候会return false
,此时调用Pingpp::getError();
返回具体错误内容。
接收 Webhooks 通知
直接调用Pingpp::notice()
,若验证成功,会返回通知的array
结构数据,若失败直接弹出错误回Pingpp。如果需要记录错误,请自行监听系统错误,详见Errors & Logging
感谢
感谢几位forked的同学的改进,当时写的很简单,无入侵式的写法,其实在接收webhooks方面,可以用Laravel自己的Events去监听处理,显得更Laravel风格。
All versions of laravel-pingpp with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4.0
laravel/framework Version 5.*
ext-curl Version *
illuminate/support Version ~5.0
laravel/framework Version 5.*
ext-curl Version *
illuminate/support Version ~5.0
The package tobess/laravel-pingpp contains the following files
Loading the files please wait ....