|
|
|
@ -506,7 +506,7 @@ class CcbPaymentService |
|
|
|
->where('created_at', '>=', (time() - 900)) |
|
|
|
->first(); |
|
|
|
if (empty($orderMain)) { |
|
|
|
throw new ErrorCodeException(ErrorCode::ORDER_NOT_AVAILABLE, '[支付订单号]'.$globalOrderId); |
|
|
|
throw new BusinessException(ErrorCode::ORDER_NOT_AVAILABLE, '[订单号无效]'.$globalOrderId); |
|
|
|
} |
|
|
|
|
|
|
|
$user = User::select('openid')->find($userId); |
|
|
|
@ -539,12 +539,12 @@ class CcbPaymentService |
|
|
|
$selfProfitRatio = config('ccb.self_profit_ratio'); |
|
|
|
|
|
|
|
if (bccomp($selfProfitRatio, '0', 3) == 0) { |
|
|
|
throw new BusinessException(500, '未配置分润比例,请联系管理员'); |
|
|
|
throw new BusinessException(500, '[未配置分润比例]'); |
|
|
|
} |
|
|
|
|
|
|
|
foreach ($orderMain->orders as $order) { |
|
|
|
if (empty($order->store->ccb_merchant_id)) { |
|
|
|
throw new BusinessException(500, '店铺'.$order->store_id.'未配置商户编号,请联系管理员'); |
|
|
|
throw new BusinessException(500, '[店铺未配置商家编号]'.$order->store_id); |
|
|
|
} |
|
|
|
foreach ($order->orderGoods as $orderGoods) { |
|
|
|
$goodsMoney = bcmul($orderGoods->price, (string)$orderGoods->number, 2); |
|
|
|
@ -588,7 +588,7 @@ class CcbPaymentService |
|
|
|
|
|
|
|
$model->py_trn_no = $result['Py_Trn_No']; |
|
|
|
$model->prim_ordr_no = $result['Prim_Ordr_No']; |
|
|
|
$model->ordr_gen_tm = $result['Ittparty_Tms']; |
|
|
|
$model->ordr_gen_tm = $result['Ordr_Gen_Tm']; |
|
|
|
if (isset($result['Cshdk_Url'])) { |
|
|
|
$model->cshdk_url = $result['Cshdk_Url']; |
|
|
|
} |
|
|
|
@ -621,7 +621,8 @@ class CcbPaymentService |
|
|
|
|
|
|
|
} catch (\Exception $e) { |
|
|
|
$this->log->event(LogLabel::ORDER_PAYMENT_LOG, ['payment_do_exception_msg' => $e->getMessage()]); |
|
|
|
throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL, '[稍后重试]'); |
|
|
|
$message = $e instanceof BusinessException ? $e->getMessage() : '[稍后重试]'; |
|
|
|
throw new ErrorCodeException(ErrorCode::PAYMENT_FAIL, $message); |
|
|
|
} |
|
|
|
} |
|
|
|
|