Skip to content

Commit

Permalink
Laravel本地化(中文化)项目模板的支付demo
Browse files Browse the repository at this point in the history
  • Loading branch information
asundust committed Jul 4, 2021
0 parents commit 9dbce77
Show file tree
Hide file tree
Showing 10,501 changed files with 1,264,504 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
91 changes: 91 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://laravel.test
APP_BEIAN=

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=root

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

#########################################
# 附加配置
#########################################

# 开发配置
SQL_LOGGER_ALL_QUERIES_ENABLED=false
SQL_LOGGER_SLOW_QUERIES_ENABLED=false

# Laravel-Admin 配置
ADMIN_ROUTE_PREFIX=admin
ADMIN_HTTPS=false

# dingo APi配置
API_STANDARDS_TREE=vnd
API_SUBTYPE=laravel
API_PREFIX=api
API_VERSION=v1
API_STRICT=false
API_DEBUG=false

# JWT秘钥
JWT_SECRET=

# alipay 配置
ALI_APP_ID=
ALI_PUBLIC_KEY=
ALI_PRIVATE_KEY=

# wechat 配置
WECHAT_OFFICIAL_ACCOUNT_APPID=
WECHAT_OFFICIAL_ACCOUNT_SECRET=

WECHAT_APP_ID=
WECHAT_MINIAPP_ID=
WECHAT_APPID=
WECHAT_MCH_ID=
WECHAT_KEY=
WECHAT_CERT_CLIENT=
WECHAT_CERT_KEY=

# 企业微信消息推送配置
PUSH_URL=
PUSH_SECRET=
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/node_modules
/public/hot
/public/storage
/storage/*.key

.env
.env.backup
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.phpstorm.meta.php
_ide_helper.php

/.idea
install.lock
resources/lang/*
!resources/lang/en/
!resources/lang/zh-CN/
!resources/lang/zh-CN.json
!resources/lang/zh_CN/
!resources/lang/zh_CN.json
public/uploads
public/vendor
13 changes: 13 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
php:
preset: laravel
disabled:
- unused_use
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 asundust

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
![StyleCI build status](https://github.styleci.io/repos/249097655/shield)

## 关于

本项目是基于`本地化(中文化)项目模板`的一个简单收款和管理[Demo](https://pay.leeay.com/pay),带有前台`/pay`和后台`/admin/orders`,由于限制,仅有部分支付功能

同步[github.com](https://github.com/asundust/laravel_pay_demo)[gitee.com](https://gitee.com/asundust/laravel_pay_demo)

关于`Composer源`的声明:由于连接性的问题故使用的是`阿里云Composer源`(本地全局更改,非项目更改),故产生的`composer.lock`文件会有`阿里云Composer源`的链接。

## 关于`本地化(中文化)项目模板`

[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版本。


同步[github.com/asundust/laravel_new](https://github.com/asundust/laravel_new)[gitee.com/asundust/laravel_new](https://gitee.com/asundust/laravel_new)

## 许可证
[MIT](https://opensource.org/licenses/MIT)
21 changes: 21 additions & 0 deletions app/Admin/Actions/DemoOrder/RowPayStatusCheck.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace App\Admin\Actions\DemoOrder;

use App\Models\Pay\DemoOrder;
use Encore\Admin\Actions\RowAction;

class RowPayStatusCheck extends RowAction
{
public $name = '支付检查';

public function handle(DemoOrder $order)
{
$result = $order->bill->toPayFind();
if (0 == $result['code']) {
return $this->response()->success($result['msg'])->refresh();
}

return $this->response()->error($result['msg']);
}
}
37 changes: 37 additions & 0 deletions app/Admin/Actions/DemoOrder/RowRefund.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace App\Admin\Actions\DemoOrder;

use App\Models\Pay\DemoOrder;
use Encore\Admin\Actions\RowAction;
use Illuminate\Http\Request;

class RowRefund extends RowAction
{
public $name = '退款';

public function handle(DemoOrder $order, Request $request)
{
$refundAmount = $request->input('refund_amount');
// if ((double)$refundAmount > $order->can_refund_amount) {
// return $this->response()->error('最大可退款金额为:' . money_show($order->can_refund_amount));
// }

$result = $order->billed->toRefund($refundAmount);
if (0 == $result['code']) {
return $this->response()->success($result['msg'])->refresh();
}

return $this->response()->error($result['msg']);
}

public function form()
{
$this->text('refunded_amount', '已退款金额')->default(money_show($this->row->refunded_amount))->disable();
$this->text('refunding_amount', '退款中金额')->default(money_show($this->row->refunding_amount))->disable();
$this->text('can_refund_amount', '可退款金额')->default(money_show($this->row->can_refund_amount))->disable();
$this->text('refund_amount', '退款金额')->default(money_show($this->row->can_refund_amount))
->rules('required|numeric|min:0.01|max:'.$this->row->can_refund_amount)
->autofocus();
}
}
23 changes: 23 additions & 0 deletions app/Admin/Actions/DemoOrder/RowRefundClose.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace App\Admin\Actions\DemoOrder;

use App\Models\Pay\DemoOrder;
use Encore\Admin\Actions\RowAction;

class RowRefundClose extends RowAction
{
public $name = '关闭退款中';

public function handle(DemoOrder $order)
{
$order->billed->refundBills()->where('refund_status', 1)->update(['refund_status' => 4]);

return $this->response()->success('已关闭退款中的退款订单')->refresh();
}

public function dialog()
{
$this->confirm('确定关闭正在退款中的订单?', '请确认当前退款中的订单是无效订单后再操作,以免资金损失!');
}
}
21 changes: 21 additions & 0 deletions app/Admin/Actions/DemoOrder/RowRefundResend.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace App\Admin\Actions\DemoOrder;

use App\Models\Pay\DemoOrder;
use Encore\Admin\Actions\RowAction;

class RowRefundResend extends RowAction
{
public $name = '退款中再次发起';

public function handle(DemoOrder $order)
{
$refundBills = $order->billed->refundBills->where('refund_status', 1);
foreach ($refundBills as $refundBill) {
$result = $order->billed->toRefundResend($refundBill);
}

return $this->response()->success('已发起再次退款申请')->refresh();
}
}
9 changes: 9 additions & 0 deletions app/Admin/Controllers/AuthController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace App\Admin\Controllers;

use Encore\Admin\Controllers\AuthController as BaseAuthController;

class AuthController extends BaseAuthController
{
}
Loading

0 comments on commit 9dbce77

Please sign in to comment.