2017 © Pedro Peláez
 

library laravel-weixinpay

weixin pay for laravel

image

crisen/laravel-weixinpay

weixin pay for laravel

  • Monday, November 6, 2017
  • by crisenchou
  • Repository
  • 2 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

laravel -Weixinpay 微信支付

微信支付, (*1)

安装

使用composer require命令进行安装, (*2)

composer require "crisen/laravel-weixinpay":"1.0.*"

或者在composer.json中添加, (*3)

"require": {
        ....
        "crisen/laravel-weixinpay": "1.0.*"
 },

配置

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

'providers' => [  
    ...
    Crisen\LaravelWeixinpay\WxpayServiceProvider::class,
}

添加门面(Facade), (*5)

'aliases' => [
    ...
    'Wxpay' => Crisen\LaravelWeixinpay\Facades\Wxpay::class
]

配置文件部署, (*6)

php artisan vendor:publish

使用方法

统一下单--扫码支付

 $pay = Wxpay::factory('UnifiedOrder');
 $payment = $pay->options([
     'body' => $order->body,
     'out_trade_no' => $order->orderid,
     'total_fee' => 1
 ])->send();
 if ($payment->isSuccessful()) {
     dump($payment->getCodeUrl());
 }

订单查询

   $payment = Wxpay::factory('OrderQuery')->options([
       'out_trade_no' => 'xxxxxxx'//订单号
   ])->send();
   if ($payment->isSuccessful() && $payment->isPaid()) {
       //do something
   }

异步通知

    $payment = Wxpay::factory('notify')->options($request);
    if ($payment->isSuccessful()) {
        //$outTradeNo = $payment->getOutTradeNo(); //do something with $outTradeNo
        $reply = $payment->reply();
        return response($reply);
    }

License

MIT, (*7)

The Versions

06/11 2017

dev-master

9999999-dev https://github.com/crisenchou/laravel-weixinpay

weixin pay for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar crisenchou

微信支付 扫码支付 weixinpay

06/11 2017

1.0.0

1.0.0.0 https://github.com/crisenchou/laravel-weixinpay

weixin pay for laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar crisenchou

微信支付 扫码支付 weixinpay

02/12 2016

v1.0.0

1.0.0.0 https://github.com/crisenchou/laravel-weixinpay

weixin qrcode pay for laravel

  Sources   Download

MIT

The Requires

 

by Avatar crisenchou

微信支付 扫码支付 weixinpay