| Package Data | |
|---|---|
| Maintainer Username: | jemoker |
| Maintainer Contact: | i@jemoker.me (Jemoker) |
| Package Create Date: | 2016-06-20 |
| Package Last Update: | 2018-09-21 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-06 15:04:45 |
| Package Statistics | |
|---|---|
| Total Downloads: | 35 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 0 |
| Total Watchers: | 1 |
| Total Forks: | 1 |
| Total Open Issues: | 0 |
自用 WeiXin Payment
###Install
"jemoker/wxpay": "dev-master"
"require": {
"jemoker/wxpay": "dev-master"
}
'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';
}