|
|
@ -261,11 +261,12 @@ class PaymentService extends AbstractService
|
|
|
|
return [$order, $orderSplitInfos];
|
|
|
|
return [$order, $orderSplitInfos];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function updateOrder($params, $status = 'APPLY_SUCCESS') {
|
|
|
|
public function updateOrder($params, $status = null) {
|
|
|
|
$order = Order::where('order_no', $params['order_no'])->where('status', $status)->first();
|
|
|
|
$order = Order::where('order_no', $params['order_no'])->first();
|
|
|
|
if (empty($order)) {
|
|
|
|
if (empty($order)) {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$order->third_order_no = $params['third_order_no'];
|
|
|
|
$order->third_order_no = $params['third_order_no'];
|
|
|
|
$order->status = $params['status'];
|
|
|
|
$order->status = $params['status'];
|
|
|
|
$order->finished_at = date('Y-m-d H:i:s', strtotime($params['finished_at']));
|
|
|
|
$order->finished_at = date('Y-m-d H:i:s', strtotime($params['finished_at']));
|
|
|
@ -479,27 +480,25 @@ class PaymentService extends AbstractService
|
|
|
|
if (empty($order)) {
|
|
|
|
if (empty($order)) {
|
|
|
|
throw new BusinessException('订单不存在');
|
|
|
|
throw new BusinessException('订单不存在');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
|
|
|
|
$baofu = new Baofu();
|
|
|
|
$baofu = new Baofu();
|
|
|
|
$result = $baofu->queryOrder([
|
|
|
|
$result = $baofu->queryOrder([
|
|
|
|
'loginNo' => $order->member_id,
|
|
|
|
'loginNo' => $order->member_id,
|
|
|
|
'tradeId' => $order->order_no,
|
|
|
|
'tradeId' => $order->order_no,
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
$info = [
|
|
|
|
$info = [
|
|
|
|
'member_id' => $order->member_id,
|
|
|
|
'member_id' => $order->member_id,
|
|
|
|
'order_no' => $order->order_no,
|
|
|
|
'order_no' => $order->order_no,
|
|
|
|
'third_order_no' => $result['requestNo'] ?? '',
|
|
|
|
'third_order_no' => $result['requestNo'] ?? '',
|
|
|
|
'status' => $result['status'],
|
|
|
|
'status' => $result['status'],
|
|
|
|
'amount' => $result['amount'],
|
|
|
|
'amount' => $result['amount'],
|
|
|
|
'finished_at' => $result['finishDate'],
|
|
|
|
'finished_at' => $result['finishDate'],
|
|
|
|
'error_message' => $result['errorMsg'] ?? '',
|
|
|
|
'error_message' => $result['errorMsg'] ?? '',
|
|
|
|
'transaction_id' => $result['transactionId'] ?? '',
|
|
|
|
'transaction_id' => $result['transactionId'] ?? '',
|
|
|
|
'out_transaction_id' => $result['outTransactionId'] ?? '',
|
|
|
|
'out_transaction_id' => $result['outTransactionId'] ?? '',
|
|
|
|
];
|
|
|
|
];
|
|
|
|
return $this->updateOrder($info);
|
|
|
|
return $this->updateOrder($info);
|
|
|
|
} catch (ApiException $e) {
|
|
|
|
|
|
|
|
throw $e;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|