Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yansongda/laravel-pay
可能是我用过的最优雅的 Alipay/WeChat/Unipay 的 laravel 支付扩展包了
https://github.com/yansongda/laravel-pay
alipay laravel pay payment unipay wechat yansongda
Last synced: 22 days ago
JSON representation
可能是我用过的最优雅的 Alipay/WeChat/Unipay 的 laravel 支付扩展包了
- Host: GitHub
- URL: https://github.com/yansongda/laravel-pay
- Owner: yansongda
- License: mit
- Created: 2017-08-20T06:25:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-15T13:20:32.000Z (3 months ago)
- Last Synced: 2024-10-01T22:42:52.675Z (about 1 month ago)
- Topics: alipay, laravel, pay, payment, unipay, wechat, yansongda
- Language: PHP
- Homepage:
- Size: 43.9 KB
- Stars: 1,075
- Watchers: 30
- Forks: 184
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-payment - laravel-pay
README
Pay
## 依赖
- php >= 8.0
- composer
- laravel || lumen >= 8.0## 安装
```Shell
composer require yansongda/laravel-pay:~3.7.0
```### laravel 用户
#### 配置文件
```Shell
php artisan vendor:publish --provider="Yansongda\LaravelPay\PayServiceProvider" --tag=laravel-pay
```### lumen 用户
#### 配置文件
请手动复制配置文件
#### service provider
```PHP
$app->register(Yansongda\LaravelPay\PayServiceProvider::class);
```## 使用方法
### 支付宝
```PHP
use Yansongda\LaravelPay\Facades\Pay;$order = [
'out_trade_no' => time(),
'total_amount' => '1',
'subject' => 'test subject - 测试',
];return Pay::alipay()->web($order);
// 下面这个方法也可以
// return Pay::web($order);
```### 微信
```PHP
use Yansongda\LaravelPay\Facades\Pay;$order = [
'out_trade_no' => time(),
'body' => 'subject-测试',
'total_fee' => '1',
'openid' => 'onkVf1FjWS5SBIixxxxxxxxx',
];$result = Pay::wechat()->mp($order);
```
### 抖音支付
```PHP
use Yansongda\LaravelPay\Facades\Pay;$order = [
'out_order_no' => date('YmdHis').mt_rand(1000, 9999),
'total_amount' => 1,
'subject' => '闫嵩达 - test - subject - 01',
'body' => '闫嵩达 - test - body - 01',
'valid_time' => 600,
'expand_order_info' => json_encode([
'original_delivery_fee' => 15,
'actual_delivery_fee' => 10
])
];$result = Pay::douyin()->mini($order);
```
### 江苏银行(e融支付)
```PHP
use Yansongda\LaravelPay\Facades\Pay;$order = [
'outTradeNo' => time().'',
'proInfo' => 'subject-测试',
'totalFee'=> 1,
];$result = Pay::jsb()->scan($order);
```
具体使用说明请传送至 [https://github.com/yansongda/pay](https://github.com/yansongda/pay)
## License
MIT