all()) . '发送回调信息!'); // 写回调记录 if (empty($orderId) || empty($payCode)) { throw new ApiException('参数错误'); } $orderId = intval($orderId); $payCode = strval($payCode); $orderInfo = OrderModel::query()->where('id', $orderId)->first(); if (empty($orderInfo)) { throw new ApiException('订单异常!'); } $payInterface = PaymentInterface::factory($payCode); if ($orderInfo->status == 2) { return $payInterface->stopNotify(); } $payment = PaymentModel::query()->where('pay_code', $payCode)->first(['partner_id']); $result = $payInterface->notify($orderSn, $tradeNo, $money, $payment->partner_id); if ($result) { $orderRes = app(OrderRepository::class)->doBuy($orderInfo->toArray(), $tradeNo, $money); if ($orderRes) { event(new PayTotalEvent($orderInfo->merchant_uid, $orderInfo->payment_uid, $orderInfo->payment_attr_uid, $orderInfo->real_amount, 2)); return $payInterface->stopNotify(); } } return 'nook'; } }