- php >= 7.3
- composer
- laravel || lumen >= 8.0
composer require yansongda/laravel-pay:~3.0.0 -W
$ php artisan vendor:publish --provider="Yansongda\LaravelPay\PayServiceProvider" --tag=laravel-pay
请手动复制配置文件
$app->register(Yansongda\LaravelPay\PayServiceProvider::class);
use Pay;
$order = [
'out_trade_no' => time(),
'total_amount' => '1',
'subject' => 'test subject - 测试',
];
return Pay::alipay()->web($order);
// 下面这个方法也可以
// return Pay::web($order);
use Pay;
$order = [
'out_trade_no' => time(),
'body' => 'subject-测试',
'total_fee' => '1',
'openid' => 'onkVf1FjWS5SBIixxxxxxxxx',
];
$result = Pay::wechat()->mp($order);
具体使用说明请传送至 https://github.com/yansongda/pay
MIT