jemoker / wxpay by jemoker

微信支付SDK在Laravel5封装包。
35
0
2
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: 2024-04-22 15:01:16
Package Statistics
Total Downloads: 35
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 1
Total Open Issues: 0

wxpay

自用 WeiXin Payment

###Install

  1. 修改composer.json文件,加入"jemoker/wxpay": "dev-master"
  "require": {
    "jemoker/wxpay": "dev-master"
  }
  1. 修改app/config/app.php
'providers' => array(
  		'Jemoker\Wxpay\WxpayServiceProvider'
)


'aliases' => array(
		'Wxpay' => 'Jemoker\Wxpay\Facades\WxpayFacade'
)
  1. 运行composer update 命令
  2. 运行php artisan config:publish jemoker/wxpay
  3. 如有必要修改支付页面,运行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';
  }