2017 © Pedro Peláez
 

library wxpay-for-laravel

wxpay for laravel

image

kaer/wxpay-for-laravel

wxpay for laravel

  • Friday, January 20, 2017
  • by jl945
  • Repository
  • 1 Watchers
  • 0 Stars
  • 40 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 5 % Grown

The README.md

kaer-wxpay

微信支付 app 支付, (*1)

目标

快速的接入微信app支付, (*2)

安装

composer require kaer/wxpay-for-laravel, (*3)

使用

注册服务提供者, (*4)

找到 config/app.php 配置文件中,keyproviders 的数组,在数组中添加服务提供者。, (*5)

'providers' => [
        // ...
    Kaer\WxpayForLaravel\WxpayServiceProvider::class,
]

运行 php artisan vendor:publish 命令,发布配置文件到你的项目中。, (*6)

说明

配置文件kaer-wxpay-app.php为app 微信支付, (*7)

例子🌰

app下单, (*8)

$wxpay = app('wxpay.app');
$wxpay->setBody("app在线支付")
      ->setTradeNo($trade_no)
      ->setTotalFee(($order->money * 100));
$result = $wxpay->unifiedOrder();//统一下单结果
if ($result['return_code'] === 'SUCCESS' &&$result['result_code'] == 'SUCCESS') {
   $prepay_id = $result['prepay_id'];
   $rst = $wxpay->getAppPayParams($prepay_id);
   return $rst;
} else {
 //统一下单失败
}

回调通知, (*9)


$WXPay = app('wxpay.app'); $data = $WXPay->getNotifyData(); // 验证请求。 if (!$WXPay->verify()) { //验证失败 return $WXPay->replyFailNotify(); } if ($data['result_code'] == "SUCCESS") { $money = ($data['total_fee'] / 100); $out_trade_no = $data['out_trade_no']; $wx_trade_no = $data['transaction_id']; //你的业务 } return $WXPay->replySuccessNotify();

The Versions

20/01 2017

dev-master

9999999-dev

wxpay for laravel

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by kaer

20/01 2017

1.1.0

1.1.0.0

wxpay for laravel

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by kaer

25/11 2016

1.0.7

1.0.7.0

wxpay for laravel

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by kaer

24/11 2016

1.0.6

1.0.6.0

wxpay for laravel

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by kaer

24/11 2016

1.0.5

1.0.5.0

wxpay for laravel

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by kaer

24/11 2016

1.0.3

1.0.3.0

wxpay for laravel

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by kaer

24/11 2016

1.0.2

1.0.2.0

wxpay for laravel

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by kaer

24/11 2016

1.0.1

1.0.1.0

wxpay for laravel

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by kaer

24/11 2016

1.0.0

1.0.0.0

wxpay for laravel

  Sources   Download

by kaer