This commit is contained in:
chenbo 2023-11-21 11:18:03 +08:00
parent 8cfe98adc6
commit 0130f4dbba
1 changed files with 4 additions and 1 deletions

View File

@ -201,7 +201,7 @@ class WeChatPayMerchantService extends BasePayService
$server->handlePaid(function (Message $message) {
\think\facade\Log::info(['支付回调信息', $message]);
if ($message['trade_state'] === 'SUCCESS') {
$this->handlePaid($message);
return $this->handlePaid($message);
} else {
\think\facade\Log::info('支付失败', $message);
}
@ -224,6 +224,9 @@ class WeChatPayMerchantService extends BasePayService
if (empty($order)) {
throw new Exception('回调订单不存在');
}
if ($order['pay_status'] == PayOrderEnum::PAY_STATUS_ISPAID && !empty($order['transaction_id'])) {
return true;
}
$order->transaction_id = $transaction_id;
$order->pay_status = PayOrderEnum::PAY_STATUS_ISPAID;
$order->finish_time = time();