Commit f6f4dab6 authored by wanjilong's avatar wanjilong

add: 增加订单支付时间的判断,增加订单商品超时的判断

parent 111294e8
...@@ -28,9 +28,7 @@ class PayException extends BaseException ...@@ -28,9 +28,7 @@ class PayException extends BaseException
13 => '生活号获取管理员ID失败,请联系管理员', 13 => '生活号获取管理员ID失败,请联系管理员',
14 => '订单缺少商品信息,请联系管理员', 14 => '订单缺少商品信息,请联系管理员',
15 => '订单存在过期商品,不能支付', 15 => '订单存在过期商品,不能支付',
16 => '订单过期,不允许支付',
]; ];
} }
<?php <?php
namespace Helpers; namespace Helpers;
use Api\PhpUtils\Log\FileLog;
use Helpers\Tracer; use Helpers\Tracer;
use Api\PhpUtils\Http\HttpUtil;
use Api\PhpUtils\Http\Request;
use App\Exception\BaseException;
/** /**
* DingTalk 获取接口 * DingTalk 获取接口
......
...@@ -50,6 +50,14 @@ class PayService ...@@ -50,6 +50,14 @@ class PayService
throw new PayException(['cus' => 3]); throw new PayException(['cus' => 3]);
} }
if (!empty($order_info['pay_expiration_time'])) {
$pay_expiration_time = strtotime($order_info['pay_expiration_time']);
if($pay_expiration_time < time()) {
throw new PayException(['cus' => 16]);
}
}
if(empty($data['result']['order_item_list'])) { if(empty($data['result']['order_item_list'])) {
throw new PayException(['cus' => 14]); throw new PayException(['cus' => 14]);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment