Skip to content

Commit 9dbce77

Browse files
committed
Laravel本地化(中文化)项目模板的支付demo
0 parents  commit 9dbce77

File tree

10,501 files changed

+1264504
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

10,501 files changed

+1264504
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.env.example

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://laravel.test
6+
APP_BEIAN=
7+
8+
LOG_CHANNEL=stack
9+
10+
DB_CONNECTION=mysql
11+
DB_HOST=127.0.0.1
12+
DB_PORT=3306
13+
DB_DATABASE=laravel
14+
DB_USERNAME=root
15+
DB_PASSWORD=root
16+
17+
BROADCAST_DRIVER=log
18+
CACHE_DRIVER=file
19+
QUEUE_CONNECTION=sync
20+
SESSION_DRIVER=file
21+
SESSION_LIFETIME=120
22+
23+
REDIS_HOST=127.0.0.1
24+
REDIS_PASSWORD=null
25+
REDIS_PORT=6379
26+
27+
MAIL_MAILER=smtp
28+
MAIL_HOST=smtp.mailtrap.io
29+
MAIL_PORT=2525
30+
MAIL_USERNAME=null
31+
MAIL_PASSWORD=null
32+
MAIL_ENCRYPTION=null
33+
MAIL_FROM_ADDRESS=null
34+
MAIL_FROM_NAME="${APP_NAME}"
35+
36+
AWS_ACCESS_KEY_ID=
37+
AWS_SECRET_ACCESS_KEY=
38+
AWS_DEFAULT_REGION=us-east-1
39+
AWS_BUCKET=
40+
41+
PUSHER_APP_ID=
42+
PUSHER_APP_KEY=
43+
PUSHER_APP_SECRET=
44+
PUSHER_APP_CLUSTER=mt1
45+
46+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
47+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
48+
49+
#########################################
50+
# 附加配置
51+
#########################################
52+
53+
# 开发配置
54+
SQL_LOGGER_ALL_QUERIES_ENABLED=false
55+
SQL_LOGGER_SLOW_QUERIES_ENABLED=false
56+
57+
# Laravel-Admin 配置
58+
ADMIN_ROUTE_PREFIX=admin
59+
ADMIN_HTTPS=false
60+
61+
# dingo APi配置
62+
API_STANDARDS_TREE=vnd
63+
API_SUBTYPE=laravel
64+
API_PREFIX=api
65+
API_VERSION=v1
66+
API_STRICT=false
67+
API_DEBUG=false
68+
69+
# JWT秘钥
70+
JWT_SECRET=
71+
72+
# alipay 配置
73+
ALI_APP_ID=
74+
ALI_PUBLIC_KEY=
75+
ALI_PRIVATE_KEY=
76+
77+
# wechat 配置
78+
WECHAT_OFFICIAL_ACCOUNT_APPID=
79+
WECHAT_OFFICIAL_ACCOUNT_SECRET=
80+
81+
WECHAT_APP_ID=
82+
WECHAT_MINIAPP_ID=
83+
WECHAT_APPID=
84+
WECHAT_MCH_ID=
85+
WECHAT_KEY=
86+
WECHAT_CERT_CLIENT=
87+
WECHAT_CERT_KEY=
88+
89+
# 企业微信消息推送配置
90+
PUSH_URL=
91+
PUSH_SECRET=

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

.gitignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/node_modules
2+
/public/hot
3+
/public/storage
4+
/storage/*.key
5+
6+
.env
7+
.env.backup
8+
.phpunit.result.cache
9+
Homestead.json
10+
Homestead.yaml
11+
npm-debug.log
12+
yarn-error.log
13+
.phpstorm.meta.php
14+
_ide_helper.php
15+
16+
/.idea
17+
install.lock
18+
resources/lang/*
19+
!resources/lang/en/
20+
!resources/lang/zh-CN/
21+
!resources/lang/zh-CN.json
22+
!resources/lang/zh_CN/
23+
!resources/lang/zh_CN.json
24+
public/uploads
25+
public/vendor

.styleci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
php:
2+
preset: laravel
3+
disabled:
4+
- unused_use
5+
finder:
6+
not-name:
7+
- index.php
8+
- server.php
9+
js:
10+
finder:
11+
not-name:
12+
- webpack.mix.js
13+
css: true

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 asundust
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
![StyleCI build status](https://github.styleci.io/repos/249097655/shield)
2+
3+
## 关于
4+
5+
本项目是基于`本地化(中文化)项目模板`的一个简单收款和管理[Demo](https://pay.leeay.com/pay),带有前台`/pay`和后台`/admin/orders`,由于限制,仅有部分支付功能
6+
7+
同步[github.com](https://github.com/asundust/laravel_pay_demo)[gitee.com](https://gitee.com/asundust/laravel_pay_demo)
8+
9+
关于`Composer源`的声明:由于连接性的问题故使用的是`阿里云Composer源`(本地全局更改,非项目更改),故产生的`composer.lock`文件会有`阿里云Composer源`的链接。
10+
11+
## 关于`本地化(中文化)项目模板`
12+
13+
[Laravel](https://github.com/laravel/laravel)本地化(中文化)项目模板,带[Laravel-Admin](https://github.com/z-song/laravel-admin)[Config](https://github.com/laravel-admin-extensions/config)、一键安装更新命令、[支付宝微信支付](https://github.com/yansongda/laravel-pay)、支付Demo,已安装[dingo/api](https://github.com/dingo/api)扩展包以及部分其他辅助扩展包,目前[Laravel](https://github.com/laravel/laravel)版本是7.x版本。
14+
15+
16+
同步[github.com/asundust/laravel_new](https://github.com/asundust/laravel_new)[gitee.com/asundust/laravel_new](https://gitee.com/asundust/laravel_new)
17+
18+
## 许可证
19+
[MIT](https://opensource.org/licenses/MIT)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace App\Admin\Actions\DemoOrder;
4+
5+
use App\Models\Pay\DemoOrder;
6+
use Encore\Admin\Actions\RowAction;
7+
8+
class RowPayStatusCheck extends RowAction
9+
{
10+
public $name = '支付检查';
11+
12+
public function handle(DemoOrder $order)
13+
{
14+
$result = $order->bill->toPayFind();
15+
if (0 == $result['code']) {
16+
return $this->response()->success($result['msg'])->refresh();
17+
}
18+
19+
return $this->response()->error($result['msg']);
20+
}
21+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace App\Admin\Actions\DemoOrder;
4+
5+
use App\Models\Pay\DemoOrder;
6+
use Encore\Admin\Actions\RowAction;
7+
use Illuminate\Http\Request;
8+
9+
class RowRefund extends RowAction
10+
{
11+
public $name = '退款';
12+
13+
public function handle(DemoOrder $order, Request $request)
14+
{
15+
$refundAmount = $request->input('refund_amount');
16+
// if ((double)$refundAmount > $order->can_refund_amount) {
17+
// return $this->response()->error('最大可退款金额为:' . money_show($order->can_refund_amount));
18+
// }
19+
20+
$result = $order->billed->toRefund($refundAmount);
21+
if (0 == $result['code']) {
22+
return $this->response()->success($result['msg'])->refresh();
23+
}
24+
25+
return $this->response()->error($result['msg']);
26+
}
27+
28+
public function form()
29+
{
30+
$this->text('refunded_amount', '已退款金额')->default(money_show($this->row->refunded_amount))->disable();
31+
$this->text('refunding_amount', '退款中金额')->default(money_show($this->row->refunding_amount))->disable();
32+
$this->text('can_refund_amount', '可退款金额')->default(money_show($this->row->can_refund_amount))->disable();
33+
$this->text('refund_amount', '退款金额')->default(money_show($this->row->can_refund_amount))
34+
->rules('required|numeric|min:0.01|max:'.$this->row->can_refund_amount)
35+
->autofocus();
36+
}
37+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace App\Admin\Actions\DemoOrder;
4+
5+
use App\Models\Pay\DemoOrder;
6+
use Encore\Admin\Actions\RowAction;
7+
8+
class RowRefundClose extends RowAction
9+
{
10+
public $name = '关闭退款中';
11+
12+
public function handle(DemoOrder $order)
13+
{
14+
$order->billed->refundBills()->where('refund_status', 1)->update(['refund_status' => 4]);
15+
16+
return $this->response()->success('已关闭退款中的退款订单')->refresh();
17+
}
18+
19+
public function dialog()
20+
{
21+
$this->confirm('确定关闭正在退款中的订单?', '请确认当前退款中的订单是无效订单后再操作,以免资金损失!');
22+
}
23+
}

0 commit comments

Comments
 (0)