ljl 1 year ago
parent ab56ca6fbb
commit aced4299f7

@ -110,7 +110,7 @@ class NotifyController extends AbstractController
'transaction_id' => $params['transactionId'] ?? '',
'out_transaction_id' => $params['outTransactionId'] ?? '',
];
$order = $this->paymentService->updateOrder($info, 'APPLY_SUCCESS');
$order = $this->paymentService->updateOrder($info, ['APPLY_SUCCESS', 'PROCESS']);
if (empty($order)) {
return $baofu->notifySuccess();
}
@ -151,7 +151,7 @@ class NotifyController extends AbstractController
'amount' => $params['orderMoney'],
'finished_at' => $params['finishTime'],
];
$order = $this->paymentService->updateOrder($info, 'SUCCESS');
$order = $this->paymentService->updateOrder($info, ['SUCCESS']);
if (empty($order)) {
return $baofu->notifySuccess();
}

@ -261,11 +261,15 @@ class PaymentService extends AbstractService
return [$order, $orderSplitInfos];
}
public function updateOrder($params, $status = null) {
public function updateOrder($params, array $statusList = null) {
$order = Order::where('order_no', $params['order_no'])->first();
if (empty($order)) {
return null;
}
if ($statusList && !in_array($order->status, $statusList)) {
return null;
}
$order->third_order_no = $params['third_order_no'];
$order->status = $params['status'];

Loading…
Cancel
Save