pull/1/head
wanghousheng 1 year ago
parent 2dd563da7e
commit 4477b22f9d
  1. 9
      app/api/service/identity/Payment.php

@ -116,16 +116,17 @@ class Payment extends BaseService
/**
* 订单支付成功事件
* @param string $orderNo 当前订单号
* @param int|null $tradeId
* @param array $paymentData
* @return void
* @throws BaseException
* @author: wanghousheng
*/
private function orderPaySuccess(string $orderNo): void
private function orderPaySuccess(string $orderNo, ?int $tradeId = null, array $paymentData = []): void
{
$paymentData = [];// 获取订单详情
$service = new IdentityPaySuccessService();
// 订单支付成功业务处理
$service->setOrderNo($orderNo)->setMethod($this->method)->setTradeId()->setPaymentData($paymentData);
$service->setOrderNo($orderNo)->setMethod($this->method)->setTradeId($tradeId)->setPaymentData($paymentData);
if (!$service->handle()) {
throwError($service->getError() ?: '订单支付失败');
}
@ -174,7 +175,7 @@ class Payment extends BaseService
// 获取第三方交易记录信息
$tradeInfo = PaymentTradeModel::detailByOutTradeNo($outTradeNo);
// 订单支付成功事件
$this->orderPaySucces($tradeInfo['order_no'], $tradeInfo['trade_id'], $result);
$this->orderPaySuccess($tradeInfo['order_no'], $tradeInfo['trade_id'], $result);
}
// 返回订单状态
return $result ? $result['paySuccess'] : false;

Loading…
Cancel
Save