feat : wechatPay callback

This commit is contained in:
2025-03-18 16:20:32 +08:00
parent bdffc3311d
commit 63b6cce2bd
5 changed files with 25 additions and 20 deletions

View File

@@ -19,7 +19,7 @@ trait RefundOrderTrait
*/
protected function checkRefundOrder(): void
{
$this->refundInfo = $this->refundOrderModel->getInfoByOrderSnoAndType($this->orderNo,self::OrderType);
$this->refundInfo = $this->refundOrderModel->getInfoByOrderSnoAndType($this->orderNo,self::PayType);
$this->orderInfo = $this->orderModel->getInfoById($this->refundInfo->order_id);
$this->payInfo = $this->payOrderModel->getInfoByOrderIdAndTypeAndRType($this->orderInfo->id,self::OrderType,self::PayType);
@@ -51,6 +51,7 @@ trait RefundOrderTrait
$this->refundInfo->refund_time = date('Y-m-d H:i:s');
$this->refundInfo->wx_transaction_id = $this->callbackData['transaction_id'];
$this->refundInfo->notify_json = json_encode($this->callbackData);
$this->refundInfo->remark = '退款成功';
if (!$this->refundInfo->save()) throw new Exception('更新退款订单失败');
@@ -72,7 +73,7 @@ trait RefundOrderTrait
if ($isRefundMoney <= 0) throw new Exception('订单退款金额错误');
if ($isRefundMoney == $this->orderInfo->actual_price) {
if ($isRefundMoney == $this->payInfo->pay_money) {
$this->orderInfo->status = OrderCode::FINISH_REFUND;
$this->orderInfo->is_refund_all = 1;//todo 感觉可以删除这个值
} else {