Package Data | |
---|---|
Maintainer Username: | yansongda |
Maintainer Contact: | me@yansongda.cn (yansongda) |
Package Create Date: | 2017-08-20 |
Package Last Update: | 2024-08-15 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-17 03:05:40 |
Package Statistics | |
---|---|
Total Downloads: | 285,636 |
Monthly Downloads: | 2,671 |
Daily Downloads: | 33 |
Total Stars: | 1,079 |
Total Watchers: | 30 |
Total Forks: | 185 |
Total Open Issues: | 0 |
该文档为 v2.x 版本,如果您想找 v1.x 版本文档,请点击https://github.com/yansongda/laravel-pay/tree/v1.0.3
$ composer require yansongda/laravel-pay
// laravel < 5.5
Yansongda\LaravelPay\PayServiceProvider::class,
// lumen
$app->register(Yansongda\LaravelPay\PayServiceProvider::class);
'Pay' => Yansongda\LaravelPay\Facades\Pay::class,
$ php artisan vendor:publish --provider="Yansongda\LaravelPay\PayServiceProvider" --tag=laravel-pay
lumen 用户请手动复制
随后,请在 config
文件夹中完善配置信息。
.env
文件里面配置
// alipay 配置
ALI_APP_ID=
ALI_PUBLIC_KEY=
ALI_PRIVATE_KEY=
// wechat 配置
WECHAT_APP_ID=
WECHAT_MINIAPP_ID=
WECHAT_APPID=
WECHAT_MCH_ID=
WECHAT_KEY=
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