jemoker / wxpay
微信支付SDK在Laravel5封装包。
dev-master
2018-09-21 08:47 UTC
Requires
- php: >=5.4.0
- illuminate/config: 5.*
- illuminate/events: 5.*
- illuminate/support: 5.*
This package is not auto-updated.
Last update: 2024-11-04 13:24:48 UTC
README
自用 WeiXin Payment
###Install
- 修改composer.json文件,加入
"jemoker/wxpay": "dev-master"
"require": { "jemoker/wxpay": "dev-master" }
- 修改app/config/app.php
'providers' => array( 'Jemoker\Wxpay\WxpayServiceProvider' ) 'aliases' => array( 'Wxpay' => 'Jemoker\Wxpay\Facades\WxpayFacade' )
- 运行
composer update
命令 - 运行
php artisan config:publish jemoker/wxpay
- 如有必要修改支付页面,运行
php artisan view:publish jemoker/wxpay
###Usage
支付调用
$wxpay = app('wxpay'); $params = array( 'body' => 'xxx', 'total_fee' => 'xxx', 'out_trade_no' => 'xxx', 'notify_url' => 'xxx', 'call_back_url' => 'xxx' ); $wxpay->setParams($params);
支付回调
$wxpay = app('wxpay'); $notify = $wxpay->verifyNotify(); if($notify){ //业务逻辑 switch ($wxpay->data['result_code']) { ... } return 'success'; }else{ //业务逻辑 return 'fail'; }