mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-01 03:18:33 +08:00
支付优化
This commit is contained in:
parent
b15b52e20f
commit
4c497f7acd
@ -231,10 +231,19 @@ class Order extends Common
|
||||
*/
|
||||
public function Respond()
|
||||
{
|
||||
// 获取支付回调数据
|
||||
// 参数
|
||||
$params = input();
|
||||
|
||||
// 是否自定义状态
|
||||
if(isset($params['appoint_status']))
|
||||
{
|
||||
$ret = ($params['appoint_status'] == 1) ? DataReturn('支付成功', 0) : DataReturn('支付失败', -100);
|
||||
|
||||
// 获取支付回调数据
|
||||
} else {
|
||||
$params['user'] = $this->user;
|
||||
$ret = OrderService::Respond($params);
|
||||
}
|
||||
|
||||
// 自定义链接
|
||||
$this->assign('to_url', MyUrl('index/order/index'));
|
||||
|
@ -213,6 +213,10 @@
|
||||
<span>退款说明:</span>
|
||||
<span>{{$new_aftersale_data.msg}}</span>
|
||||
</div>
|
||||
<div class="am-cf am-padding-vertical-xs">
|
||||
<span>退款方式:</span>
|
||||
<span>{{$new_aftersale_data.refundment_text}}</span>
|
||||
</div>
|
||||
<div class="am-cf am-padding-vertical-xs">
|
||||
<span>拒绝原因:</span>
|
||||
<span>{{$new_aftersale_data.refuse_reason}}</span>
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>退款金额<span class="am-form-group-label-tips-must">必填</span></label>
|
||||
<input type="number" name="price" value="{{$order.pay_price}}" step="0.01" min="0.01" max="{{$order.pay_price}}" class="am-radius" placeholder="退款金额" data-validation-message="请输入有效的退款金额,最低0.01元,最高{{$order.pay_price}}元" required />
|
||||
<input type="number" name="price" value="{{$order.pay_price}}" step="0.01" min="0.00" max="{{$order.pay_price}}" class="am-radius" placeholder="退款金额" data-validation-message="请输入有效的退款金额,最高{{$order.pay_price}}元" required />
|
||||
</div>
|
||||
|
||||
<div class="am-form-group">
|
||||
|
@ -839,6 +839,12 @@ class OrderAftersaleService
|
||||
return DataReturn('支付方式有误', -1);
|
||||
}
|
||||
|
||||
// 交易平台单号
|
||||
if(empty($pay_log['trade_no']))
|
||||
{
|
||||
return DataReturn('平台单号为空,请确认支付日志是否存在', -1);
|
||||
}
|
||||
|
||||
// 操作退款
|
||||
$pay_name = 'payment\\'.$pay_log['payment'];
|
||||
$pay_params = [
|
||||
|
@ -66,10 +66,6 @@ class OrderService
|
||||
{
|
||||
return DataReturn('资源不存在或已被删除', -1);
|
||||
}
|
||||
if($order['total_price'] <= 0.00)
|
||||
{
|
||||
return DataReturn('金额不能为0', -1);
|
||||
}
|
||||
if($order['status'] != 1)
|
||||
{
|
||||
$status_text = lang('common_order_user_status')[$order['status']]['name'];
|
||||
@ -90,6 +86,24 @@ class OrderService
|
||||
Db::name('Order')->where(['id'=>$order['id']])->update(['payment_id'=>$payment_id, 'upd_time'=>time()]);
|
||||
}
|
||||
|
||||
// 金额为0直接支付成功
|
||||
if($order['total_price'] <= 0.00)
|
||||
{
|
||||
// 非线上支付处理
|
||||
$params['user']['user_name_view'] = '用户-'.$params['user']['user_name_view'];
|
||||
$pay_result = self::OrderPaymentUnderLine([
|
||||
'order' => $order,
|
||||
'payment' => $payment[0],
|
||||
'user' => $params['user'],
|
||||
'subject' => $params,
|
||||
]);
|
||||
if($pay_result['code'] == 0)
|
||||
{
|
||||
return DataReturn('支付成功', 0, ['data'=>MyUrl('index/order/respond', ['appoint_status'=>1])]);
|
||||
}
|
||||
return $pay_result;
|
||||
}
|
||||
|
||||
// 支付入口文件检查
|
||||
$pay_checked = PaymentService::EntranceFileChecked($payment[0]['payment'], 'order');
|
||||
if($pay_checked['code'] != 0)
|
||||
@ -203,10 +217,6 @@ class OrderService
|
||||
{
|
||||
return DataReturn('资源不存在或已被删除', -1);
|
||||
}
|
||||
if($order['total_price'] <= 0.00)
|
||||
{
|
||||
return DataReturn('金额不能为0', -1);
|
||||
}
|
||||
if($order['status'] != 1)
|
||||
{
|
||||
$status_text = lang('common_order_admin_status')[$order['status']]['name'];
|
||||
@ -242,7 +252,7 @@ class OrderService
|
||||
{
|
||||
if(!empty($params['order']) && !empty($params['payment']) && !empty($params['user']))
|
||||
{
|
||||
if(in_array($params['payment']['payment'], config('shopxo.under_line_list')))
|
||||
if(in_array($params['payment']['payment'], config('shopxo.under_line_list')) || $params['order']['total_price'] <= 0.00)
|
||||
{
|
||||
// 支付处理
|
||||
$pay_params = [
|
||||
@ -256,6 +266,8 @@ class OrderService
|
||||
],
|
||||
];
|
||||
return self::OrderPayHandle($pay_params);
|
||||
} else {
|
||||
return DataReturn('仅线下支付方式处理', -1);
|
||||
}
|
||||
}
|
||||
return DataReturn('无需处理', 0);
|
||||
|
@ -114,6 +114,11 @@ return array (
|
||||
0 => 'app\\plugins\\touristbuy\\Hook',
|
||||
1 => 'app\\plugins\\weixinwebauthorization\\Hook',
|
||||
),
|
||||
'plugins_service_buy_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\newuserreduction\\Hook',
|
||||
1 => 'app\\plugins\\membershiplevel\\Hook',
|
||||
),
|
||||
'plugins_view_goods_detail_photo_bottom' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\share\\Hook',
|
||||
@ -134,10 +139,6 @@ return array (
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevel\\Hook',
|
||||
),
|
||||
'plugins_service_buy_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevel\\Hook',
|
||||
),
|
||||
'plugins_service_user_login_success_record' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\membershiplevel\\Hook',
|
||||
|
Loading…
Reference in New Issue
Block a user