Download the PHP package crisen/laravel-alipay without Composer
On this page you can find all versions of the php package crisen/laravel-alipay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel-alipay
laravel-alipay
支付宝扫码支付
安装
composer require "crisen/laravel-alipay":"dev-master"
文档
-
注册服务提供者 config目录下app.php文件
'providers' => [ ... Crisen\LaravelAlipay\AlipayServiceProvider::class, }
-
添加门面
'aliases' => [ ... 'Alipay' => Crisen\LaravelAlipay\Facades\Alipay::class, ]
-
配置文件
php artisan vendor publish
使用方法
扫码支付
$alipay = Alipay::factory('precreate');
$alipay->setBizContent([
'out_trade_no' => $outTradeNo,
'subject' => 'test',
'total_amount' => 1,
'body' => 'test goods',
])->send();
if($alipay->isSuccessful() && $alipay->isTradeStatusOk()){
$codeUrl = $alipay->getCodeUrl();
echo $codeUrl;
}
订单查询
$alipay = Alipay::factory('query');
$bizCOntent = [
'out_trade_no' => 'xxx'//数据库中的订单号
];
$alipay->setBizContent($bizContent)->send();
if($alipay->isSuccessful() && $alipay->isTradeStatusOk()){
//dd($alipay->getRequestData();
}
异步通知
$alipay = Alipay::factory('notify')->options($request->all());
if ($alipay->isPaid()) {
// echo $alipay->getOutTradeNo();
}
License
MIT
All versions of laravel-alipay with dependencies
PHP Build Version
Package Version
Requires
illuminate/support Version
^4.0|^5.0
The package crisen/laravel-alipay contains the following files
Loading the files please wait ....