Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
c360c3be
ShopXO
项目概览
jcy2004x
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
c360c3be
编写于
6月 16, 2019
作者:
G
gongfuxiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
钱包支付
上级
1dc1d4b7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
207 addition
and
17 deletion
+207
-17
application/service/NavigationService.php
application/service/NavigationService.php
+16
-16
application/service/OrderService.php
application/service/OrderService.php
+1
-1
application/service/PluginsAdminService.php
application/service/PluginsAdminService.php
+8
-0
extend/payment/WalletPay.php
extend/payment/WalletPay.php
+182
-0
public/static/upload/.gitignore
public/static/upload/.gitignore
+0
-0
未找到文件。
application/service/NavigationService.php
浏览文件 @
c360c3be
...
@@ -736,6 +736,22 @@ class NavigationService
...
@@ -736,6 +736,22 @@ class NavigationService
],
],
]
]
],
],
'property'
=>
[
'name'
=>
'财产中心'
,
'is_show'
=>
1
,
'icon'
=>
'am-icon-trophy'
,
'is_system'
=>
1
,
'item'
=>
[
[
'name'
=>
'我的积分'
,
'url'
=>
MyUrl
(
'index/userintegral/index'
),
'contains'
=>
[
'userintegralindex'
],
'is_show'
=>
1
,
'icon'
=>
'am-icon-fire'
,
'is_system'
=>
1
,
],
]
],
'base'
=>
[
'base'
=>
[
'name'
=>
'资料管理'
,
'name'
=>
'资料管理'
,
'is_show'
=>
1
,
'is_show'
=>
1
,
...
@@ -792,22 +808,6 @@ class NavigationService
...
@@ -792,22 +808,6 @@ class NavigationService
],
],
]
]
],
],
'property'
=>
[
'name'
=>
'财产中心'
,
'is_show'
=>
1
,
'icon'
=>
'am-icon-trophy'
,
'is_system'
=>
1
,
'item'
=>
[
[
'name'
=>
'我的积分'
,
'url'
=>
MyUrl
(
'index/userintegral/index'
),
'contains'
=>
[
'userintegralindex'
],
'is_show'
=>
1
,
'icon'
=>
'am-icon-fire'
,
'is_system'
=>
1
,
],
]
],
'logout'
=>
[
'logout'
=>
[
'name'
=>
'安全退出'
,
'name'
=>
'安全退出'
,
'url'
=>
MyUrl
(
'index/user/logout'
),
'url'
=>
MyUrl
(
'index/user/logout'
),
...
...
application/service/OrderService.php
浏览文件 @
c360c3be
...
@@ -390,7 +390,7 @@ class OrderService
...
@@ -390,7 +390,7 @@ class OrderService
* @datetime 2018-10-05T23:02:14+0800
* @datetime 2018-10-05T23:02:14+0800
* @param [array] $params [输入参数]
* @param [array] $params [输入参数]
*/
*/
p
rivate
static
function
OrderPayHandle
(
$params
=
[])
p
ublic
static
function
OrderPayHandle
(
$params
=
[])
{
{
// 订单信息
// 订单信息
if
(
empty
(
$params
[
'order'
]))
if
(
empty
(
$params
[
'order'
]))
...
...
application/service/PluginsAdminService.php
浏览文件 @
c360c3be
...
@@ -925,6 +925,14 @@ php;
...
@@ -925,6 +925,14 @@ php;
{
{
return
DataReturn
(
'应用images目录没有操作权限'
.
'['
.
$app_static_images_dir
.
']'
,
-
3
);
return
DataReturn
(
'应用images目录没有操作权限'
.
'['
.
$app_static_images_dir
.
']'
,
-
3
);
}
}
// 应用upload目录
$app_upload_dir
=
ROOT
.
'public'
.
DS
.
'static'
.
DS
.
'upload'
;
if
(
!
is_writable
(
$app_upload_dir
))
{
return
DataReturn
(
'应用upload目录没有操作权限'
.
'['
.
$app_upload_dir
.
']'
,
-
3
);
}
return
DataReturn
(
'权限正常'
,
0
);
return
DataReturn
(
'权限正常'
,
0
);
}
}
...
...
extend/payment/WalletPay.php
0 → 100644
浏览文件 @
c360c3be
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace
payment
;
use
think\Db
;
use
app\service\PaymentService
;
use
app\service\OrderService
;
use
app\plugins\wallet\service\WalletService
;
/**
* 钱包支付
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-06-16
* @desc description
*/
class
WalletPay
{
// 插件配置参数
private
$config
;
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-09-17
* @desc description
* @param [array] $params [输入参数(支付配置参数)]
*/
public
function
__construct
(
$params
=
[])
{
$this
->
config
=
$params
;
}
/**
* 配置信息
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-06-16
* @desc description
*/
public
function
Config
()
{
// 基础信息
$base
=
[
'name'
=>
'钱包'
,
// 插件名称
'version'
=>
'0.0.1'
,
// 插件版本
'apply_version'
=>
'1.5.0'
,
// 适用系统版本描述
'desc'
=>
'钱包余额支付'
,
// 插件描述(支持html)
'author'
=>
'Devil'
,
// 开发者
'author_url'
=>
'http://shopxo.net/'
,
// 开发者主页
];
// 配置信息
$element
=
[];
return
[
'base'
=>
$base
,
'element'
=>
$element
,
];
}
/**
* 钱包校验
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @datetime 2019-06-16T17:17:58+0800
* @param [array] $params [输入参数]
*/
private
function
Check
(
$params
=
[])
{
// 钱包校验
$wallet
=
Db
::
name
(
'Plugins'
)
->
where
([
'plugins'
=>
'wallet'
])
->
find
();
if
(
empty
(
$wallet
))
{
return
DataReturn
(
'请先安装钱包插件[ Wallet ]'
,
-
1
);
}
return
DataReturn
(
'钱包正常'
,
0
);
}
/**
* 支付入口
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-06-16
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Pay
(
$params
=
[])
{
// 校验
$ret
=
$this
->
Check
(
$params
);
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 获取用户钱包校验
$user_wallet
=
WalletService
::
UserWallet
(
$params
[
'user'
][
'id'
]);
if
(
$user_wallet
[
'code'
]
!=
0
)
{
return
$user_wallet
;
}
// 余额校验
if
(
$user_wallet
[
'data'
][
'normal_money'
]
<
$params
[
'total_price'
])
{
return
DataReturn
(
'钱包余额不足'
,
-
10
);
}
// 处理支付
$ret
=
WalletService
::
UserWalletMoneyUpdate
(
$params
[
'user'
][
'id'
],
$params
[
'total_price'
],
0
,
'normal_money'
,
3
,
'钱包余额支付[订单'
.
$params
[
'order_no'
]
.
']'
);
if
(
$ret
[
'code'
]
==
0
)
{
// 支付方式
$payment
=
PaymentService
::
PaymentList
([
'where'
=>
[
'payment'
=>
'wallet'
]]);
// 获取订单信息
$order
=
Db
::
name
(
'Order'
)
->
find
(
$params
[
'order_id'
]);
// 支付处理
$pay_params
=
[
'order'
=>
$order
,
'payment'
=>
$payment
[
0
],
'pay'
=>
[
'trade_no'
=>
'钱包支付'
,
'subject'
=>
$params
[
'name'
],
'buyer_user'
=>
$params
[
'user'
][
'user_name_view'
],
'pay_price'
=>
$params
[
'total_price'
],
],
];
$ret
=
OrderService
::
OrderPayHandle
(
$pay_params
);
if
(
$ret
[
'code'
]
==
0
)
{
return
DataReturn
(
'支付成功'
,
0
,
MyUrl
(
'index/order/respond'
,
[
'appoint_status'
=>
0
]));
}
}
return
$ret
;
}
/**
* 支付回调处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-06-16
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Respond
(
$params
=
[])
{
return
DataReturn
(
'处理成功'
,
0
,
$params
);
}
/**
* 退款处理
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-06-16
* @desc description
* @param [array] $params [输入参数]
*/
public
function
Refund
(
$params
=
[])
{
return
DataReturn
(
'请选择退至钱包'
,
-
1
);
}
}
?>
\ No newline at end of file
public/static/upload/.gitignore
100644 → 100755
浏览文件 @
c360c3be
文件模式从 100644 更改为 100755
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录