|
|
|
@ -471,4 +471,35 @@ class PaymentService extends AbstractService
|
|
|
|
|
throw $e;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function queryOrder(array $data, App $app)
|
|
|
|
|
{
|
|
|
|
|
$order = Order::where('app_id', $app->app_id)->where('out_order_no', $data['outOrderNo'])->first();
|
|
|
|
|
if (empty($order)) {
|
|
|
|
|
throw new BusinessException('订单不存在');
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
$baofu = new Baofu();
|
|
|
|
|
$result = $baofu->queryOrder([
|
|
|
|
|
'loginNo' => $order->member_id,
|
|
|
|
|
'tradeId' => $order->order_no,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$info = [
|
|
|
|
|
'member_id' => $order->member_id,
|
|
|
|
|
'order_no' => $order->order_no,
|
|
|
|
|
'third_order_no' => $result['requestNo'] ?? '',
|
|
|
|
|
'status' => $result['status'],
|
|
|
|
|
'amount' => $result['amount'],
|
|
|
|
|
'finished_at' => $result['finishDate'],
|
|
|
|
|
'error_message' => $result['errorMsg'] ?? '',
|
|
|
|
|
'transaction_id' => $result['transactionId'] ?? '',
|
|
|
|
|
'out_transaction_id' => $result['outTransactionId'] ?? '',
|
|
|
|
|
];
|
|
|
|
|
return $this->updateOrder($info);
|
|
|
|
|
} catch (ApiException $e) {
|
|
|
|
|
throw $e;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|