Package Data | |
---|---|
Maintainer Username: | crisenchou |
Maintainer Contact: | crisen@crisen.org (crisenchou) |
Package Create Date: | 2016-12-03 |
Package Last Update: | 2017-06-14 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-16 15:02:44 |
Package Statistics | |
---|---|
Total Downloads: | 58 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 1 |
Total Open Issues: | 1 |
支付宝扫码支付
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();
}
MIT